/* ChartLab site styles. All styles of the site live here: the pages carry no style attributes and no <style> blocks
   (the Content-Security-Policy in src/headers.ts allows only this file). Layout, colours, sizes and copy follow the
   approved design mock. */

@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/instrument-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --accent: #6d4cff;
  --accent-text: #a08cff;
  --bg: #000000;
  --bg-band: #07070a;
  --surface: #0e0e12;
  --surface-2: #15151b;
  --text: #f4f4f6;
  --muted: #b4b4bf;
  --dim: #a1a1ad;
  --line: #1d1d24;
  --line-band: #16161c;
  --border: #23232b;
  --border-btn: #2e2e38;
  --warn: #ffc46b;
  --warn-bg: #2b2110;
  --warn-line: #4a3a1a;
  --tile: #1a1630;
  --err: #ff8a95;
  --gutter: clamp(16px, 4vw, 48px);
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; font-family: var(--sans); color: var(--text); background: var(--bg); line-height: 1.4; min-height: 100vh; }
h1, h2, h3, p, ul, ol, dl { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.warn { color: var(--warn); }
.muted { color: var(--dim); font-size: 14px; }

.wrap { max-width: 1180px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---- buttons and links ---------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: #7b5eff; }
.btn-outline { border-color: var(--border-btn); }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); }
.btn-lg { min-height: 48px; padding: 0 22px; font-size: 16px; }
.btn-self { align-self: flex-start; }
.plain { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 12px 0 0; color: var(--muted); font-size: 15px; font-weight: 500; }

/* ---- header and footer ---------------------------------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-in { padding-top: 14px; padding-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); min-height: 44px; }
.brand-name { font-weight: 700; font-size: 21px; letter-spacing: -0.3px; }
.brand-sm { min-height: 0; }
.brand-sm .brand-name { font-size: 16px; }
.nav { display: flex; align-items: center; gap: 0 24px; flex-wrap: wrap; }
.nav a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--text); }
.site-footer { border-top: 1px solid var(--line-band); background: var(--bg); }
.footer-in { padding-top: 32px; padding-bottom: 32px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.footer-in p { font-size: 13px; color: var(--dim); }

/* ---- hero ----------------------------------------------------------------------------------------------------- */
.hero { padding-top: clamp(48px, 7vw, 96px); padding-bottom: 48px; display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero-copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--accent-text); letter-spacing: 0.2px; }
h1 { font-size: clamp(40px, 5.4vw, 68px); line-height: 1.04; letter-spacing: -1.6px; font-weight: 700; }
.lead { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--muted); max-width: 560px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.ticks { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--dim); }
.ticks li { display: inline-flex; align-items: center; gap: 8px; }
.ticks svg { flex: none; }

/* ---- sign-in card (data-state on #signin is set by js/page.js) ------------------------------------------------- */
.card { flex: 0 1 400px; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.card[data-state="granted"] { border-color: #3a2f7a; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--dim); text-align: right; }
.badge-accent { color: var(--accent-text); }
.badge-warn { color: var(--warn); }
.card-text { font-size: 15px; line-height: 1.5; color: var(--muted); }
.card-text strong { color: var(--text); font-weight: 700; }
.card-sub { font-size: 14px; line-height: 1.5; color: var(--muted); }
.card-fine { font-size: 13px; line-height: 1.5; color: var(--dim); }
/* the elements that belong to some states only: data-not lists the states in which an element is hidden */
.card[data-state="signed_out"] [data-not~="signed_out"],
.card[data-state="waiting"] [data-not~="waiting"],
.card[data-state="granted"] [data-not~="granted"],
.card[data-state="need_chart"] [data-not~="need_chart"],
.card[data-state="unavailable"] [data-not~="unavailable"] { display: none; }

.note { font-size: 13px; line-height: 1.45; border-radius: 8px; padding: 10px 12px; border: 1px solid; }
.note-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.note-info { color: var(--text); background: var(--surface-2); border-color: var(--border-btn); }

.waiting { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 15px; line-height: 1.45; }
.spinner { flex: none; }
@media (prefers-reduced-motion: no-preference) { .spinner { animation: spin 0.9s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }

.panel { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.row { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: 14px; }
.row-k { color: var(--dim); }
.row-v { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; word-break: break-all; text-align: left; min-width: 0; }

/* #access carries the server's text: styled by its own data-state */
.access { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.access[data-state="granted"] { color: var(--muted); }
.access[data-state="need_chart"] { color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px; padding: 14px 16px; }
.access[data-state="unavailable"] { color: var(--text); background: var(--surface-2); border: 1px solid var(--border-btn); border-radius: 8px; padding: 14px 16px; }
.error { font-size: 14px; line-height: 1.5; color: var(--err); overflow-wrap: anywhere; }
.error:empty { display: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.wallets { display: flex; flex-direction: column; gap: 10px; }
.wallets .connect { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--border-btn); background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; font-weight: 600; text-align: left; cursor: pointer; }
.wallets .connect:hover { border-color: #43435a; background: #1b1b23; }
.wallets .connect::before { content: ""; flex: none; width: 28px; height: 28px; border-radius: 7px; background-color: var(--border); background-repeat: no-repeat; background-position: center; background-size: 16px 16px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='2' y='4' width='12' height='9' rx='2' fill='none' stroke='%23f4f4f6' stroke-width='1.5'/%3E%3Cpath d='M10 8.5h4' stroke='%23f4f4f6' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M4 4l6-2' stroke='%23f4f4f6' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); }
.wallets .connect::after { content: "Detected"; margin-left: auto; font-size: 13px; font-weight: 500; color: var(--dim); }
.install { font-size: 14px; line-height: 1.5; color: var(--muted); }
.install a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; margin: 2px 2px; border: 1px solid var(--border-btn); border-radius: 8px; color: var(--text); font-weight: 600; text-decoration: none; }
.install a:hover { background: var(--surface-2); }

/* ---- report preview ------------------------------------------------------------------------------------------- */
.preview-sec { padding-bottom: 24px; }
.rp { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rp-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.rp-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rp-pair { font-size: 18px; font-weight: 700; }
.rp-title .mono { font-size: 12px; }
.tag { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--border-btn); border-radius: 6px; padding: 3px 8px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-family: var(--mono); font-size: 12px; padding: 5px 9px; border-radius: 6px; color: var(--dim); border: 1px solid var(--border); }
.chip-on { color: #ffffff; background: var(--accent); border-color: var(--accent); }
.rp-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 20px; background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); color: var(--warn); font-size: 14px; }
.rp-warn strong { font-weight: 600; }
.rp-body { display: flex; flex-wrap: wrap; }
.rp-chart { flex: 3 1 560px; min-width: 0; padding: 20px; border-right: 1px solid var(--line); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; margin-bottom: 12px; }
.legend-i { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; }
.sw-line { width: 14px; height: 2px; background: var(--accent-text); }
.sw-dash { width: 14px; height: 0; border-top: 1px dashed var(--warn); }
.chart-svg { width: 100%; height: auto; display: block; }
.rp-side { flex: 1 1 280px; min-width: 0; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--dim); }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-tight { gap: 8px; }
.li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.li-dim { color: var(--muted); }
.rule { height: 1px; background: var(--line); }
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter-fill { width: 25.11%; height: 8px; background: var(--warn); }
.skel { display: inline-block; background: var(--line); border-radius: 6px; flex: none; }
.skel-pill { width: 52px; height: 22px; border: 1px solid var(--border-btn); background: var(--surface-2); }
.skel-bar { width: 56px; height: 12px; border-radius: 4px; }
.caption { margin-top: 12px; font-size: 13px; color: var(--dim); }

/* ---- how it works --------------------------------------------------------------------------------------------- */
.how { padding-top: 56px; padding-bottom: 56px; }
.steps { display: flex; flex-wrap: wrap; gap: 16px; }
.step { flex: 1 1 280px; min-width: 0; display: flex; gap: 16px; align-items: flex-start; padding: 20px; border: 1px solid var(--line); border-radius: 12px; }
.step-n { font-size: 14px; color: var(--accent-text); padding-top: 2px; }
.step-b { display: flex; flex-direction: column; gap: 6px; }
.step-b strong { font-size: 17px; }
.step-b span { font-size: 15px; line-height: 1.5; color: var(--muted); }

/* ---- sections ------------------------------------------------------------------------------------------------- */
.features { padding-top: 40px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 32px; }
#sample-reports { padding-top: 72px; }
.sec-head { display: flex; flex-direction: column; gap: 12px; max-width: 680px; }
.h2 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; letter-spacing: -0.8px; font-weight: 700; }
.sec-lead { font-size: 17px; line-height: 1.55; color: var(--muted); }
.grid { display: flex; flex-wrap: wrap; gap: 16px; }
.fcard { flex: 1 1 250px; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.ficon { width: 40px; height: 40px; border-radius: 10px; background: var(--tile); display: inline-flex; align-items: center; justify-content: center; }
.fcard h3 { font-size: 19px; font-weight: 700; }
.fcard ul { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.fine { font-size: 13px; color: var(--dim); }
.band { background: var(--bg-band); border-top: 1px solid var(--line-band); }
.band:not(.band-bt) { border-bottom: 1px solid var(--line-band); }
.band-in { padding-top: 72px; padding-bottom: 72px; }
.video-in { display: flex; flex-direction: column; gap: 28px; }

/* video: a static poster, nothing is loaded */
.poster { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: var(--text); }
.play { width: 84px; height: 84px; border-radius: 42px; background: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.poster-text { font-family: var(--mono); font-size: 14px; color: var(--muted); text-align: center; padding: 0 16px; }

/* sample report cards */
.grid-2 .rcard { flex: 1 1 380px; }
.rcard { flex: 1 1 380px; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.rcard-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.rcard-name { display: flex; align-items: center; gap: 10px; }
.rcard-pair { font-size: 20px; font-weight: 700; }
.lock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--dim); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tagc { font-size: 13px; color: var(--muted); border: 1px solid var(--border-btn); border-radius: 6px; padding: 4px 10px; }
.tagc-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.rcard-p { font-size: 15px; line-height: 1.5; color: var(--muted); }
.reports-page { padding-top: 56px; }
.reports-page h1 { letter-spacing: -0.8px; }

/* access */
.access-in { display: flex; flex-wrap: wrap; gap: 48px; }
.access-l { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.alist { padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; }
.alist li { display: flex; gap: 14px; align-items: flex-start; }
.num { flex: none; width: 30px; height: 30px; border-radius: 15px; background: var(--tile); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.atext { font-size: 16px; line-height: 1.5; padding-top: 3px; }
.atext span { color: var(--muted); }
.faq { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.faq-i { padding: 20px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.faq-i strong { font-size: 16px; }
.faq-i span { font-size: 15px; line-height: 1.55; color: var(--muted); }

@media (max-width: 920px) { .rp-chart { border-right: 0; border-bottom: 1px solid var(--line); } }

/* ---- phone ---------------------------------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .card { padding: 20px; }
  .rp-top, .rp-warn, .rp-chart, .rp-side { padding-left: 16px; padding-right: 16px; }
  .fcard, .rcard { padding: 20px; }
  .band-in { padding-top: 56px; padding-bottom: 56px; }
  #sample-reports { padding-top: 56px; }
  .access-in, .hero { gap: 32px; }
  .play { width: 64px; height: 64px; border-radius: 32px; }
}

/* keep the footer at the bottom of a short page */
#top { min-height: 100vh; display: flex; flex-direction: column; }
#top > main { flex: 1 0 auto; }
