/* mri.lucheestiy.com — rotating strong-gradient MRI concept
   Theme-aware: dark by default (lab instrument feel), light supported. */

:root {
  color-scheme: dark light;

  --plane:        #0d1014;
  --surface-1:    #151a20;
  --surface-2:    #1b2129;
  --ink:          #ffffff;
  --ink-2:        #c3c2b7;
  --muted:        #898781;
  --rule:         rgba(255,255,255,0.10);
  --grid:         #2c2c2a;
  --baseline:     #383835;

  --series-1:     #3987e5;   /* blue  — the concept */
  --series-2:     #008300;   /* green — conventional baseline */
  --accent:       #3987e5;
  --good:         #0ca30c;
  --warning:      #fab219;
  --serious:      #ec835a;
  --critical:     #d03b3b;

  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --maxw: 1080px;
}

@media (prefers-color-scheme: light) {
  :root:where(:not([data-theme="dark"])) {
    color-scheme: light;
    --plane:     #f9f9f7;
    --surface-1: #fcfcfb;
    --surface-2: #f2f2ee;
    --ink:       #0b0b0b;
    --ink-2:     #52514e;
    --muted:     #6f6d68;
    --rule:      rgba(11,11,11,0.10);
    --grid:      #e1e0d9;
    --baseline:  #c3c2b7;
    --series-1:  #2a78d6;
    --series-2:  #008300;
    --accent:    #2a78d6;
    --good:      #006300;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --plane:     #f9f9f7;
  --surface-1: #fcfcfb;
  --surface-2: #f2f2ee;
  --ink:       #0b0b0b;
  --ink-2:     #52514e;
  --muted:     #6f6d68;
  --rule:      rgba(11,11,11,0.10);
  --grid:      #e1e0d9;
  --baseline:  #c3c2b7;
  --series-1:  #2a78d6;
  --series-2:  #008300;
  --accent:    #2a78d6;
  --good:      #006300;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--plane) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar .wrap {
  display: flex; align-items: center; gap: 20px;
  min-height: 56px; flex-wrap: wrap;
}
.brand {
  font-weight: 650; letter-spacing: -0.01em; font-size: 15px;
  display: flex; align-items: center; gap: 9px; margin-right: auto;
  color: var(--ink); text-decoration: none;
}
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  flex: none;
}
.navlinks { display: flex; gap: 18px; flex-wrap: wrap; }
.navlinks a {
  color: var(--ink-2); text-decoration: none; font-size: 14px;
  padding: 4px 0; border-bottom: 1px solid transparent;
}
.navlinks a:hover { color: var(--ink); border-bottom-color: var(--accent); }

.theme-toggle {
  background: transparent; border: 1px solid var(--rule); color: var(--ink-2);
  border-radius: 7px; padding: 5px 11px; font: inherit; font-size: 13px;
  cursor: pointer; line-height: 1.4;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--accent); }

/* ---------- hero ---------- */

.hero { padding: 76px 0 56px; border-bottom: 1px solid var(--rule); }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 18px;
}
h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.5rem); line-height: 1.08;
  letter-spacing: -0.03em; font-weight: 660; margin: 0 0 22px; max-width: 20ch;
}
.lede { font-size: clamp(1.06rem, 2.1vw, 1.25rem); color: var(--ink-2); max-width: 62ch; margin: 0 0 14px; }

.hero-note {
  margin-top: 28px; padding: 14px 18px;
  border-left: 3px solid var(--warning);
  background: var(--surface-1);
  border-radius: 0 8px 8px 0;
  font-size: 14.5px; color: var(--ink-2); max-width: 68ch;
}
.hero-note strong { color: var(--ink); }

/* ---------- headline stats ---------- */

.stat-row {
  display: grid; gap: 14px; margin: 40px 0 0;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.stat {
  background: var(--surface-1); border: 1px solid var(--rule);
  border-radius: 11px; padding: 18px 20px;
}
.stat .k {
  font-size: 11.5px; font-family: var(--mono); letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 9px;
}
.stat .v {
  font-size: 2rem; font-weight: 640; letter-spacing: -0.025em;
  line-height: 1.05; margin: 0 0 6px; color: var(--ink);
}
.stat .v em { font-style: normal; font-size: 1rem; color: var(--ink-2); font-weight: 450; }
.stat .s { font-size: 13px; color: var(--ink-2); margin: 0; line-height: 1.5; }

/* ---------- sections ---------- */

section { padding: 68px 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: 0; }

h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.05rem); letter-spacing: -0.025em;
  font-weight: 640; margin: 0 0 8px; line-height: 1.2;
}
.sec-kicker {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 12px;
}
h3 {
  font-size: 1.14rem; font-weight: 620; letter-spacing: -0.012em;
  margin: 34px 0 10px; line-height: 1.35;
}
p { margin: 0 0 16px; max-width: 68ch; }
p.wide { max-width: none; }
section > .wrap > p:first-of-type { color: var(--ink-2); }

a { color: var(--accent); }
strong { font-weight: 640; color: var(--ink); }

ul, ol { max-width: 68ch; padding-left: 22px; margin: 0 0 16px; }
li { margin-bottom: 9px; }
li::marker { color: var(--muted); }

code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--surface-2); padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--rule);
}

.eq {
  font-family: var(--mono); font-size: 15px;
  background: var(--surface-1); border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 9px 9px 0; padding: 16px 20px; margin: 20px 0;
  overflow-x: auto; color: var(--ink);
}
.eq .why { display: block; margin-top: 9px; font-family: var(--sans); font-size: 13.5px; color: var(--muted); }

/* ---------- panels & figures ---------- */

.panel {
  background: var(--surface-1); border: 1px solid var(--rule);
  border-radius: 13px; padding: 22px; margin: 26px 0;
}
.panel > h3:first-child { margin-top: 0; }

figure { margin: 26px 0; }
figcaption { font-size: 13.5px; color: var(--muted); margin-top: 11px; line-height: 1.55; max-width: 68ch; }

.fig-title { font-size: 14px; font-weight: 620; margin: 0 0 3px; color: var(--ink); }
.fig-sub { font-size: 13px; color: var(--muted); margin: 0 0 16px; }

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- two-column ---------- */

.cols {
  display: grid; gap: 26px; margin: 26px 0;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  align-items: start;
}
.cols p, .cols ul { max-width: none; }

/* ---------- the animation ---------- */

.sim {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}
.sim-cell {
  background: var(--surface-2); border: 1px solid var(--rule);
  border-radius: 11px; padding: 16px;
}
.sim-cell svg { display: block; width: 100%; height: auto; }

.controls {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--rule);
}
.controls label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 9px; }
.controls input[type=range] { accent-color: var(--accent); width: 132px; }
.btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 15px; font: inherit; font-size: 14px; font-weight: 550; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--rule); }
.btn.ghost:hover { color: var(--ink); border-color: var(--accent); filter: none; }
.readout { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.readout b { color: var(--accent); font-weight: 600; }

/* ---------- tables ---------- */

table { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 560px; }
caption { text-align: left; font-size: 13.5px; color: var(--muted); padding-bottom: 11px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th {
  font-size: 11.5px; font-family: var(--mono); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
  border-bottom: 1px solid var(--baseline);
}
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-family: var(--mono); padding: 2px 8px;
  border-radius: 20px; border: 1px solid var(--rule); color: var(--ink-2);
  white-space: nowrap;
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.tag.t-ok::before      { background: var(--good); }
.tag.t-warn::before    { background: var(--warning); }
.tag.t-serious::before { background: var(--serious); }
.tag.t-crit::before    { background: var(--critical); }

/* ---------- risk cards ---------- */

.risks { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 24px; }
.risk {
  background: var(--surface-1); border: 1px solid var(--rule);
  border-left: 3px solid var(--muted); border-radius: 0 11px 11px 0; padding: 17px 19px;
}
.risk.sev-crit    { border-left-color: var(--critical); }
.risk.sev-serious { border-left-color: var(--serious); }
.risk.sev-warn    { border-left-color: var(--warning); }
.risk h4 { margin: 0 0 4px; font-size: 15px; font-weight: 630; letter-spacing: -0.01em; }
.risk .sev { font-size: 11px; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 9px; }
.risk p { font-size: 14px; color: var(--ink-2); margin: 0; max-width: none; }
.risk p + p { margin-top: 10px; }

/* ---------- chart bits ---------- */

.legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 0 16px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex: none; }

.tooltip {
  position: fixed; pointer-events: none; z-index: 100; opacity: 0;
  background: var(--surface-1); border: 1px solid var(--rule);
  border-radius: 9px; padding: 9px 12px; font-size: 13px; color: var(--ink);
  box-shadow: 0 6px 22px rgba(0,0,0,0.32); transition: opacity .12s ease;
  max-width: 250px; line-height: 1.5;
}
.tooltip.on { opacity: 1; }
.tooltip .tt-k { font-weight: 620; display: block; margin-bottom: 2px; }
.tooltip .tt-v { color: var(--ink-2); font-family: var(--mono); font-size: 12.5px; }

details.table-view { margin-top: 16px; }
details.table-view summary {
  cursor: pointer; font-size: 13.5px; color: var(--ink-2);
  padding: 7px 0; list-style-position: outside;
}
details.table-view summary:hover { color: var(--ink); }
details.table-view[open] summary { margin-bottom: 12px; }

/* ---------- footer ---------- */

footer { padding: 46px 0 66px; color: var(--muted); font-size: 14px; }
footer p { max-width: 72ch; }
footer a { color: var(--ink-2); }

.disclaimer {
  background: var(--surface-1); border: 1px solid var(--rule);
  border-radius: 11px; padding: 20px 22px; margin-bottom: 30px;
}
.disclaimer h4 { margin: 0 0 8px; font-size: 14.5px; color: var(--ink); font-weight: 630; }
.disclaimer p { font-size: 14px; color: var(--ink-2); margin: 0; }
.disclaimer p + p { margin-top: 10px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  section { padding: 52px 0; }
  .hero { padding: 52px 0 44px; }
  .navlinks { display: none; }
}
