@import url('/assets/studyverse-tokens.css');

/* ============================================================
   MedCoreX · landing page · home.css
   The landing loads /assets/studyverse.css first (the one
   design file shared by every page) and this sheet second:
   only landing-specific modules. Shared vocabulary — base,
   header, buttons, type scale, sections, quote, footer —
   lives in the kit file and is never duplicated here.
   ============================================================ */

/* ── device chrome tokens (the monitor's materials) ───────── */
html[data-theme="dark"] {
  --leaf: #222228;
  --body-top: #2a2a2f;
  --body-bottom: #1a1a1d;
  --body-edge: #000;
  --led-off: #3a3a3f;
  --device-shadow: 0 1px 0 #000, 0 30px 60px -30px #000c;
}
html[data-theme="light"] {
  --leaf: #e2dfd8;
  --body-top: #dcd8d0;
  --body-bottom: #cbc7bf;
  --body-edge: #8a857c;
  --led-off: #aaa59b;
  --device-shadow: 0 1px 0 #fff8, 0 24px 48px -30px #0006;
}
:root {
  /* instrument chrome: the screen is always dark glass */
  --screen: #070707;
  --trace: #f2ede4;
  --trace-dim: #8f8a80;
}

/* ── hero band (landing markup) ───────────────────────────── */
.hero { padding: clamp(44px, 7vw, 100px) 0 clamp(56px, 7vw, 96px); }
.hero .grid12 { align-items: center; row-gap: 44px; }
.hero-copy { grid-column: 1 / -1; }
.hero-monitor { grid-column: 1 / -1; }

/* ── the monitor as a physical instrument ─────────────────── */
.device {
  position: relative; padding: 18px 18px 14px; border-radius: 6px;
  background: linear-gradient(180deg, var(--body-top), var(--body-bottom));
  border: 1px solid var(--body-edge);
  box-shadow: inset 0 1px 0 #ffffff1f, inset 0 -2px 0 #0000005c, var(--device-shadow);
}
.device::before { /* bezel screws */
  content: ""; position: absolute; inset: 6px; border-radius: 4px; pointer-events: none;
  background:
    radial-gradient(circle at 6px 6px, #0006 0 1.2px, #fff2 1.4px, transparent 2px),
    radial-gradient(circle at calc(100% - 6px) 6px, #0006 0 1.2px, #fff2 1.4px, transparent 2px),
    radial-gradient(circle at 6px calc(100% - 6px), #0006 0 1.2px, #fff2 1.4px, transparent 2px),
    radial-gradient(circle at calc(100% - 6px) calc(100% - 6px), #0006 0 1.2px, #fff2 1.4px, transparent 2px);
}
.device-top { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 12px; font-family: var(--f-mono); font-size: var(--fs-label); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.device-top .model { color: var(--ink); }
.leds { display: flex; gap: 6px; align-items: center; }
.led { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 8px; background: transparent; border: 1px solid transparent; border-radius: 2px; cursor: pointer; font: inherit; font-size: .62rem; letter-spacing: .08em; color: var(--muted); }
.led:hover { border-color: var(--line-strong); color: var(--ink); }
.led-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--led-off); box-shadow: inset 0 1px 1px #0008; }
.led.on .led-dot { background: var(--accent); box-shadow: 0 0 0 1px #0007, 0 0 8px #ff6a3d80; }
.led[aria-pressed="true"]:not(.on) .led-dot { background: var(--accent); box-shadow: 0 0 0 1px #0007, 0 0 8px #ff6a3d80; }
.device.alarm-active #ledAlarm .led-dot { animation: alarmFlash .9s steps(2, start) infinite; }
@keyframes alarmFlash { to { visibility: hidden; } }
.device.alarm-active #ledAlarm { color: var(--accent); }
.chip-btn { background: transparent; border: 1px solid transparent; border-radius: 2px; padding: 2px 6px; margin: -2px -6px; font: inherit; font-size: inherit; letter-spacing: inherit; color: var(--trace); cursor: pointer; }
.chip-btn:hover { border-color: var(--line-strong); }
.state-line { margin: 10px 0 0; font-family: var(--f-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--trace-dim); }
.device.standby .screen::before { content: "Standby"; position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font-family: var(--f-mono); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--trace-dim); background: var(--screen); }
.device.in-scenario .screen-top { color: var(--accent); }
.screen {
  position: relative; border-radius: 3px; padding: 14px 14px 10px; overflow: hidden;
  background: var(--screen);
  box-shadow: inset 0 0 0 1px #ffffff0d, inset 0 0 0 4px #000, inset 0 18px 36px -10px #000, 0 1px 0 #ffffff14;
}
.screen::after { /* glass: a soft diagonal reflection and a faint scan texture */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 3px;
  background:
    linear-gradient(118deg, #ffffff12 0%, #ffffff00 34%, #ffffff00 66%, #ffffff08 100%),
    repeating-linear-gradient(0deg, #ffffff06 0 1px, transparent 1px 3px);
}
.screen-top { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--trace-dim); margin-bottom: 8px; }
.screen-top .state { color: var(--accent); }
.screen-top .scn-tag[hidden] { display: none; }
.wave-stack { position: relative; height: clamp(190px, 26vw, 280px); }
.wave-stack canvas { width: 100%; height: 100%; }
.grid-lines { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(to right, #f2ede40f 1px, transparent 1px), linear-gradient(to bottom, #f2ede40f 1px, transparent 1px); background-size: 20px 20px; }
.readings { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-top: 10px; border-top: 1px solid #f2ede41a; }
.reading { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 10px 8px 0; min-width: 0; background: none; border: 0; border-right: 1px solid #f2ede41a; text-align: left; cursor: pointer; }
.reading:last-child { border-right: 0; }
.reading:hover .val { color: var(--ink); }
.reading[aria-pressed="true"] .name { color: var(--accent); }
.reading .name { font-family: var(--f-mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--trace-dim); }
.reading .val { font-family: var(--f-mono); font-weight: 500; font-size: clamp(1.05rem, .85rem + .9vw, 1.6rem); line-height: 1; color: var(--trace); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.reading .unit { font-size: .55em; color: var(--trace-dim); margin-left: 3px; }
.reading .limit { position: relative; width: 100%; height: 3px; background: #f2ede41f; }
.reading .limit i { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--accent); }
.reading .limit b { position: absolute; top: 0; bottom: 0; background: #f2ede45c; }
.trend { display: block; width: 100%; margin-top: 10px; padding: 8px 0 0; background: transparent; border: 0; border-top: 1px solid #f2ede41a; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.trend:hover { background: #ffffff05; }
.trend-label { display: flex; justify-content: space-between; gap: 10px; font-family: var(--f-mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--trace-dim); margin-bottom: 4px; }
.trend svg { width: 100%; height: 40px; }
.explain { min-height: 2.8em; margin-top: 10px; padding: 9px 12px; font-size: var(--fs-small); line-height: 1.5; color: var(--ink); background: #00000040; border-left: 2px solid var(--accent); }
.alarm-line { margin: 12px 0 0; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--trace-dim); }
.device.alarm-active .alarm-line { color: var(--accent); }
.controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ctl { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; background: #00000033; border: 1px solid #f2ede433; border-radius: 2px; color: var(--trace); font: inherit; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.ctl:hover { border-color: var(--trace); }
.ctl[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.ctl:disabled { opacity: .5; cursor: default; }
.reveal { margin-top: 10px; padding: 12px 14px; border-left: 2px solid var(--accent); background: #00000040; }
.reveal[hidden] { display: none; }
.reveal-name { font-weight: 600; font-size: var(--fs-small); color: var(--trace); }
.reveal-why { margin-top: 6px; font-size: var(--fs-small); line-height: 1.5; color: var(--trace); opacity: .9; }
.reveal-study { margin-top: 8px; font-family: var(--f-mono); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; color: var(--trace-dim); }
.device-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding: 12px 4px 0; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.device-foot .sim { color: var(--accent); }
.try-row { display: flex; justify-content: flex-start; margin-top: 14px; }

/* ── catalogue ────────────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.resume { font-size: var(--fs-small); }
.filter { width: 100%; max-width: 360px; padding: 0 14px; min-height: 44px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 4px; font-size: var(--fs-small); }
.filter::placeholder { color: var(--muted); }
.filter:focus { outline: none; border-color: var(--accent); }
.tablist { position: relative; display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tablist::-webkit-scrollbar { display: none; }
.tab { position: relative; z-index: 1; flex: 0 0 auto; background: transparent; border: 0; cursor: pointer; padding: 14px 16px 13px; font-family: var(--f-mono); font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; transition: color .2s var(--ease); }
.tab:hover, .tab[aria-selected="true"] { color: var(--ink); }
.tab .count { margin-left: 6px; color: var(--trace-dim); }
.tab-indicator { position: absolute; left: 0; top: 0; height: 2px; width: 0; z-index: 2; background: var(--accent); transition: transform .24s var(--ease), width .24s var(--ease); }
.tab-indicator.no-anim { transition: none; }
.panel-wrap { margin-top: 26px; }
.panel { display: grid; gap: 24px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.panel[hidden] { display: none; }
.panel.enter { animation: panelIn .18s var(--ease) both; }
@keyframes panelIn { from { opacity: 0; } to { opacity: 1; } }
.panel-desc { grid-column: 1 / -1; }
.panel-list { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.panel-desc h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.02em; margin: 10px 0; }
.panel-desc p { color: var(--muted); max-width: 46ch; }
.panel-desc .go { margin-top: 18px; }
.panel-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background-color .2s var(--ease), padding .3s var(--ease); }
.panel-list a:hover { background: var(--surface); padding-left: 12px; }
.panel-list .t { font-weight: 600; }
.panel-list .d { display: block; color: var(--muted); font-size: var(--fs-small); }
.panel-list .arrow { font-family: var(--f-mono); color: var(--accent); }
.nores { color: var(--muted); padding: 12px 0; }
@media (min-width: 900px) {
  .panel-desc { grid-column: 1 / span 5; }
  .panel-list { grid-column: 6 / span 7; border-top: 0; }
}

/* ── the standard (three rules) ───────────────────────────── */
.standard { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .standard { grid-template-columns: 5fr 7fr; }
  .standard-head { position: sticky; top: 110px; align-self: start; }
}
.rule-list { display: grid; border-top: 1px solid var(--line); }
.rule { padding: 30px 0; border-bottom: 1px solid var(--line); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.js .rule { opacity: 0; transform: translateY(12px); }
.js .rule.is-on { opacity: 1; transform: none; }
.rule .num { display: inline-block; font-family: var(--f-mono); font-size: var(--fs-label); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.rule h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.02em; margin-bottom: 10px; }
.rule p { color: var(--muted); max-width: 58ch; }
.progress { margin-top: 26px; height: 2px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .55s var(--ease); }

/* ── final CTA + sprint ───────────────────────────────────── */
.final { border-top: 1px solid var(--line); padding: clamp(60px, 8vw, 108px) 0; }
.final .grid12 { row-gap: 40px; align-items: start; }
.final-copy, .sprint-card { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .final-copy { grid-column: 1 / span 6; }
  .sprint-card { grid-column: 7 / span 6; }
}
.final-copy h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -.035em; line-height: 1.04; }
.final-copy p { color: var(--muted); margin-top: 16px; max-width: 40ch; }
.final-copy .cta-row { margin-top: 28px; }
.game { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: clamp(18px, 2.4vw, 26px); box-shadow: var(--device-shadow); }
.game-head { display: flex; justify-content: space-between; gap: 12px; font-family: var(--f-mono); font-size: var(--fs-label); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.game h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.02em; margin: 14px 0 6px; }
.game p.lead { color: var(--muted); font-size: var(--fs-small); }
.timer { font-family: var(--f-mono); font-weight: 500; font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem); line-height: 1; color: var(--trace); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer.low { color: var(--accent); }
.timer-bar { height: 2px; background: var(--line); margin-top: 12px; overflow: hidden; }
.timer-bar span { display: block; height: 100%; width: 100%; background: var(--trace); transform-origin: left; }
.timer-bar.low span { background: var(--accent); }
.options { display: grid; gap: 0; margin-top: 14px; border-top: 1px solid var(--line); }
.options .opt { text-align: left; cursor: pointer; padding: 12px 4px; background: transparent; border: 0; border-bottom: 1px solid var(--line); font-size: var(--fs-small); line-height: 1.45; transition: background-color .2s var(--ease), padding .3s var(--ease); }
.options .opt:hover:not([disabled]) { background: var(--leaf); padding-left: 12px; }
.options .opt[disabled] { cursor: default; }
.options .opt.right { color: var(--ink); box-shadow: inset 3px 0 0 var(--trace); }
.options .opt.wrong { color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.verdict { margin-top: 14px; padding: 12px 14px; border-left: 2px solid var(--trace); background: var(--leaf); font-size: var(--fs-small); line-height: 1.5; }
.verdict.bad { border-left-color: var(--accent); }
.verdict .cat { display: inline-block; margin-top: 8px; font-family: var(--f-mono); font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.game-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.result-big { font-family: var(--f-mono); font-weight: 500; font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.2rem); font-variant-numeric: tabular-nums; color: var(--trace); line-height: 1; }
.misses { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1px solid var(--line); }
.misses li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-small); }
.game-dismiss { background: transparent; border: 1px solid var(--line-strong); border-radius: 2px; padding: 0 12px; min-height: 34px; cursor: pointer; color: var(--muted); font-family: var(--f-mono); font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase; }
.game-dismiss:hover { color: var(--ink); border-color: var(--ink); }
.game-slot:empty { display: none; }

/* ── landing-only responsive ──────────────────────────────── */
@media (min-width: 900px) {
  .hero-copy { grid-column: 1 / span 5; }
  .hero-monitor { grid-column: 6 / span 7; }
}
@media (max-width: 640px) {
  .readings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reading { border-right: 0; border-bottom: 1px solid #f2ede41a; }
  .reading:nth-child(odd) { padding-right: 10px; border-right: 1px solid #f2ede41a; }
  .reading:last-child { grid-column: 1 / -1; border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .device.alarm-active #ledAlarm .led-dot { animation: none; }
}
@media print { .device { box-shadow: none; } }
