:root {
  --bg: #0f1115;
  --bg-alt: #151821;
  --panel: #1b1f2a;
  --panel-2: #222736;
  --line: #2c3242;
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --brand: #7c9cff;
  --brand-2: #b48cff;
  --good: #4ad295;
  --ok: #ffc861;
  --warn: #ff8f6b;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; }
h2 { font-size: 1.9rem; margin-bottom: 0.8em; }
a { color: var(--brand); text-decoration: none; }
small { color: var(--muted); font-size: 0.8rem; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 17, 21, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--brand); font-size: 1.4rem; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); font-size: 0.92rem; }
.nav-links a:hover { color: var(--text); }

/* buttons */
.btn { display: inline-block; padding: 12px 20px; border-radius: 999px; font-weight: 600; cursor: pointer; border: 1px solid transparent; font-size: 0.95rem; transition: transform .08s ease, filter .2s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #0c0e13; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-block { width: 100%; margin-top: 18px; }

/* hero */
.hero { padding: 72px 0 56px; background: radial-gradient(1200px 500px at 70% -10%, rgba(124,156,255,.18), transparent 60%); }
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--brand); font-weight: 600; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 14px; }
.hero h1 { font-size: 2.8rem; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 56ch; }
.hero-cta { display: flex; gap: 14px; margin: 26px 0 18px; flex-wrap: wrap; }
.trust-row { list-style: none; display: flex; gap: 20px; padding: 0; margin: 18px 0 0; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.hero-card { background: linear-gradient(160deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: 24px; padding: 26px; box-shadow: var(--shadow); }
.hero-card-inner { display: grid; gap: 12px; }
.mini-region { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; font-size: 1.05rem; }
.mini-region b { font-size: 1.5rem; }
.mini-note { color: var(--muted); font-size: .8rem; text-align: center; margin-top: 4px; }
.g { color: var(--good); } .y { color: var(--ok); } .r { color: var(--warn); }

/* bands */
.band { padding: 64px 0; border-top: 1px solid var(--line); }
.band-alt { background: var(--bg-alt); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: rgba(124,156,255,.15); color: var(--brand); font-weight: 700; margin-bottom: 12px; }
.step p { color: var(--muted); margin: 0; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.consent { background: rgba(124,156,255,.06); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 22px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { margin-top: 4px; }

.cohort-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .9rem; }
select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .92rem; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: .88rem; cursor: pointer; }
.chip input { accent-color: var(--brand); }

/* dropzone */
.upload-row { display: flex; gap: 20px; align-items: center; margin-top: 8px; }
.dropzone { flex: 1; border: 1.5px dashed var(--line); border-radius: 16px; padding: 30px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: rgba(124,156,255,.05); }
.dz-icon { font-size: 1.8rem; color: var(--brand); }
.dz-text { margin-top: 8px; }
.dz-sub { color: var(--muted); font-size: .82rem; margin-top: 4px; }
#preview { width: 180px; height: 180px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }

.error { color: var(--warn); margin-top: 12px; }

/* spinner */
.spinner { width: 42px; height: 42px; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; margin: 10px auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }
#panel-processing { text-align: center; }

/* ===== report ===== */
.report-head { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: center; margin-bottom: 12px; }
.report-photo { position: relative; }
.report-photo canvas, .report-photo img { width: 100%; border-radius: 16px; border: 1px solid var(--line); display: block; }
.harmony { text-align: center; }
.harmony-ring { --p: 0; width: 168px; height: 168px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.harmony-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--panel); }
.harmony-ring span { position: relative; font-size: 2.6rem; font-weight: 700; }
.harmony-ring small { position: relative; display: block; color: var(--muted); font-size: .8rem; }
.harmony-tier { font-size: 1.2rem; font-weight: 600; }
.harmony-note { color: var(--muted); font-size: .85rem; max-width: 44ch; margin: 8px auto 0; }

.quality-banner { background: rgba(255,143,107,.1); border: 1px solid rgba(255,143,107,.4); border-radius: 12px; padding: 12px 16px; margin: 16px 0; font-size: .9rem; }
.quality-banner ul { margin: 6px 0 0; padding-left: 18px; }

.summary-line { font-size: 1.05rem; margin: 18px 0; }
.summary-line .pill { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-weight: 600; }

h3.section-title { margin: 28px 0 14px; font-size: 1.3rem; }

/* region cards */
.regions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.region-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.region-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; cursor: pointer; }
.region-top h4 { margin: 0; font-size: 1.05rem; }
.region-score { font-size: 1.5rem; font-weight: 700; }
.bar { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 0 16px; }
.bar > i { display: block; height: 100%; border-radius: 999px; }
.region-detail { padding: 4px 16px 16px; display: none; }
.region-card.open .region-detail { display: block; }
.metric { border-top: 1px solid var(--line); padding: 12px 0; }
.metric-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.metric-name { font-weight: 600; }
.metric-val { font-variant-numeric: tabular-nums; }
.band-tag { font-size: .72rem; padding: 2px 8px; border-radius: 999px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.band-ideal { background: rgba(74,210,149,.15); color: var(--good); }
.band-typical { background: rgba(255,200,97,.15); color: var(--ok); }
.band-outside { background: rgba(255,143,107,.15); color: var(--warn); }
.metric-plain { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.metric-sci { color: var(--muted); font-size: .78rem; margin-top: 4px; }
.metric-sci b { color: var(--text); }

/* protocol */
.top3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rec-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.rec-card.featured { border-color: rgba(124,156,255,.5); }
.rec-channel { color: var(--brand); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.rec-card h4 { margin: 6px 0 8px; font-size: 1.02rem; }
.rec-product { font-size: .85rem; color: var(--muted); }
.rec-why { margin-top: 10px; }
.rec-why summary { cursor: pointer; color: var(--brand); font-size: .85rem; }
.rec-why .why-body { font-size: .83rem; color: var(--muted); margin-top: 8px; }
.rec-why .why-body span.tag { display: inline-block; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; margin: 2px 3px 2px 0; font-size: .75rem; }

.routine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.routine-col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.routine-col h4 { margin: 0 0 10px; }
.routine-col ol { margin: 0; padding-left: 18px; }
.routine-col li { margin-bottom: 8px; font-size: .9rem; }
.routine-col li small { display: block; }

.rest-list { display: grid; gap: 10px; }
.rest-item { display: flex; justify-content: space-between; gap: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: .92rem; }

.report-actions { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; }

/* science / privacy */
.science-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.sci { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.sci p { color: var(--muted); margin: 0; }
.privacy ul { color: var(--muted); line-height: 1.7; }
.privacy strong { color: var(--text); }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0; background: var(--bg-alt); }
.site-footer p { color: var(--muted); margin: 0 0 10px; }
.disclaimer { font-size: .82rem; max-width: 80ch; }

/* responsive */
@media (max-width: 880px) {
  .hero-grid, .report-head { grid-template-columns: 1fr; }
  .steps, .science-cards, .top3, .routine { grid-template-columns: 1fr; }
  .cohort-grid { grid-template-columns: repeat(2, 1fr); }
  .regions { grid-template-columns: 1fr; }
  .nav-links a:not(.btn) { display: none; }
  .hero h1 { font-size: 2.1rem; }
}
