/* ============================================================================
   NOVA MEDICAL — concept demo for Swiss Web Bureau
   World: the negatoscopio (radiology light box). A calm graphite reading room;
   every piece of content is a luminous backlit panel. Luminosity means clarity —
   which is the clinic's actual promise. The booking surface inverts to light:
   the panel opened up, filling the screen, where the task is done.
   Self-contained: local fonts, no CDN, no framework, no third-party script.
   ========================================================================== */

@font-face {
  font-family: "Libre Franklin";
  src: url("../_fonts/librefranklin-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("../_fonts/fragmentmono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --graphite-950: #0b0e11;
  --graphite-900: #11161a;
  --graphite-850: #161c21;
  --graphite-800: #1d252b;
  --graphite-700: #2a343c;

  --lum: #f4fafd;              /* the lit film */
  --lum-2: #dceaf2;
  --ink: #e6eef3;
  --ink-2: #a5b6c2;
  --ink-3: #7b8d9a;

  --safelight: #d98f4a;        /* the reading room's warm lamp — current/active only */
  --line: rgba(160, 190, 210, 0.18);
  --line-strong: rgba(180, 210, 228, 0.4);

  --sp: clamp(20px, 4.4vw, 66px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --r: 3px;

  /* semantic surface tokens — remapped wholesale on the light surface */
  --bg: var(--graphite-900);
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --fg-3: var(--ink-3);
}

/* the booking surface: the film is on the box and the room lights are up */
body.lit {
  --bg: #eef4f7;
  --fg: #101a20;
  --fg-2: #41535e;
  /* AA against both the lit ground (4.9:1) and white inputs (5.5:1) — hints and
     placeholders are body-size text and must clear 4.5:1, not merely look quiet */
  --fg-3: #5a6c77;
  --line: rgba(16, 40, 56, 0.14);
  --line-strong: rgba(16, 40, 56, 0.3);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Libre Franklin", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--safelight); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: var(--sp); }

/* --- typography ---------------------------------------------------------- */

h1, h2, h3 { font-weight: 620; letter-spacing: -0.028em; line-height: 1.04; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.4vw, 5rem); }
h2 { font-size: clamp(1.9rem, 4.2vw, 3.3rem); }
h3 { font-size: clamp(1.15rem, 1.9vw, 1.5rem); line-height: 1.16; }

.lede { font-size: clamp(1.06rem, 1.5vw, 1.28rem); line-height: 1.55; color: var(--fg-2); max-width: 48ch; }
p { max-width: 66ch; }
.dim { color: var(--fg-2); }

/* the measurement voice of a reading room */
.note {
  font-family: "Fragment Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  line-height: 1.5;
}
.note-b { color: var(--fg-2); }
.tab { font-variant-numeric: tabular-nums; }
/* Fragment Mono is the measurement voice only. Column headings are ordinary
   labels, so they take the text face rather than wearing monospace as costume. */
.col-label { font-size: 0.82rem; font-weight: 620; letter-spacing: -0.005em; color: var(--fg); }

/* --- the panel: a backlit film, not glass ------------------------------- */

.panel {
  position: relative;
  background: var(--lum);
  border-radius: var(--r);
  /* light escaping around the film's edge */
  box-shadow:
    0 0 0 1px rgba(220, 238, 248, 0.22),
    0 0 46px -8px rgba(180, 220, 245, 0.3),
    0 26px 60px -30px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}
body.lit .panel {
  box-shadow: 0 0 0 1px rgba(16, 40, 56, 0.09), 0 20px 46px -28px rgba(16, 40, 56, 0.45);
}
.panel img { width: 100%; height: 100%; object-fit: cover; }

/* an unlit slot on the box: the empty state of a viewer */
.panel-empty {
  background: var(--graphite-850);
  border: 1px dashed var(--line-strong);
  box-shadow: none;
  display: grid;
  place-items: center;
  padding: 34px;
  text-align: center;
}

/* --- header -------------------------------------------------------------- */

.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  background: linear-gradient(to bottom, var(--bg) 45%, transparent);
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-head.is-stuck {
  background: color-mix(in srgb, var(--bg) 93%, transparent);
  backdrop-filter: blur(10px) saturate(150%);
  border-bottom-color: var(--line);
}
.head-bar { display: flex; align-items: center; justify-content: space-between; gap: 22px; height: 76px; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 660; font-size: 1.24rem; letter-spacing: -0.02em; }
/* the brand mark is the lamp of the viewer switching on */
.brand .lamp {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  background: var(--lum);
  box-shadow: 0 0 0 3px rgba(220, 238, 248, 0.14), 0 0 14px 2px rgba(200, 232, 250, 0.6);
}
body.lit .brand .lamp { background: var(--safelight); box-shadow: 0 0 0 3px rgba(217, 143, 74, 0.16); }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 10px 15px; font-size: 0.93rem; color: var(--fg-2); border-radius: var(--r);
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav a:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 8%, transparent); }
.nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"]::after {
  content: ""; display: block; height: 2px; margin-top: 5px; background: var(--safelight); border-radius: 2px;
}
.nav .cta { margin-left: 10px; }

.menu-btn {
  display: none; width: 46px; height: 46px; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line-strong); border-radius: var(--r); color: var(--fg); cursor: pointer;
}
.menu-btn svg { width: 20px; height: 20px; }
.menu-btn .x { display: none; }
.menu-btn[aria-expanded="true"] .x { display: block; }
.menu-btn[aria-expanded="true"] .b { display: none; }

@media (max-width: 940px) {
  .nav {
    position: fixed; inset: 76px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-block: 1px solid var(--line);
    padding: 10px var(--sp) 24px;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 0.32s var(--ease), transform 0.32s var(--ease), visibility 0.32s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 15px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a[aria-current="page"]::after { display: none; }
  .nav .cta { margin: 18px 0 0; justify-content: center; border-bottom: 0; }
  .menu-btn { display: inline-flex; }
}

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 13px 24px; border-radius: var(--r);
  font-size: 0.96rem; font-weight: 580; letter-spacing: -0.005em;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.2s var(--ease);
}
/* the primary action is a lit panel */
.btn.primary {
  background: var(--lum); color: var(--graphite-950);
  box-shadow: 0 0 30px -8px rgba(190, 226, 248, 0.5);
}
.btn.primary:hover { background: #ffffff; box-shadow: 0 0 40px -6px rgba(190, 226, 248, 0.7); }
body.lit .btn.primary { background: var(--graphite-900); color: var(--lum); box-shadow: none; }
body.lit .btn.primary:hover { background: #000; }
.btn.ghost { border-color: var(--line-strong); color: var(--fg); }
.btn.ghost:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }

.link {
  display: inline-flex; align-items: center; gap: 10px; font-size: 0.95rem; font-weight: 520;
  color: var(--fg); border-bottom: 1px solid var(--line-strong); padding-bottom: 4px;
  transition: gap 0.4s var(--ease), border-color 0.3s var(--ease);
}
.link:hover { gap: 16px; border-color: var(--fg); }
.link svg { width: 15px; flex: none; }

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

section { padding-block: clamp(66px, 9vw, 138px); }
.sec-head { margin-bottom: clamp(30px, 4vw, 56px); max-width: 62ch; }
.sec-head h2 { margin-bottom: 18px; }

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

.hero { padding-top: clamp(122px, 15vw, 176px); padding-bottom: clamp(50px, 7vw, 100px); }
.hero-grid { display: grid; gap: clamp(34px, 5vw, 64px); align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.02fr 0.98fr; } }
.hero .actions { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 34px; }
.hero-assure { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 0.98rem; max-width: 52ch; }

/* --- annotated panel: the labelled radiograph interaction ---------------- */

.plate { position: relative; }
.plate .panel { aspect-ratio: 3 / 2; }
.key {
  position: absolute;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(11, 14, 17, 0.82);
  color: var(--lum);
  border: 1px solid rgba(230, 244, 252, 0.7);
  font-family: "Fragment Mono", monospace;
  font-size: 0.72rem;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: background 0.3s var(--ease), transform 0.35s var(--ease), box-shadow 0.3s var(--ease);
}
.key::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; }
.key:hover, .key[aria-expanded="true"] {
  background: var(--safelight);
  color: #150c04;
  transform: translate(-50%, -50%) scale(1.14);
  box-shadow: 0 0 0 6px rgba(217, 143, 74, 0.2);
}
.key-list { margin-top: 22px; display: grid; gap: 2px; }
.key-item {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 16px; align-items: start;
  padding: 14px 12px; border-radius: var(--r);
  border: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.key-item.is-on { background: color-mix(in srgb, var(--safelight) 12%, transparent); border-color: color-mix(in srgb, var(--safelight) 34%, transparent); }
.key-item .n { font-family: "Fragment Mono", monospace; font-size: 0.72rem; color: var(--safelight); padding-top: 3px; }
.key-item p { font-size: 0.95rem; margin-top: 3px; }

/* --- specialties: lit rows, not icon cards ------------------------------- */

.rows { border-top: 1px solid var(--line); }
.row {
  position: relative; display: grid; gap: 6px 26px; align-items: baseline;
  padding: clamp(22px, 2.8vw, 32px) 0; border-bottom: 1px solid var(--line);
  transition: background 0.4s var(--ease);
}
@media (min-width: 880px) { .row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) 168px 26px; align-items: center; } }
.row:hover { background: color-mix(in srgb, var(--fg) 5%, transparent); }
/* the title advances on transform; the row box never reflows */
.row h3 { transition: color 0.3s var(--ease), transform 0.42s var(--ease); }
.row:hover h3 { transform: translateX(10px); }
.row .arrow { width: 20px; color: var(--fg-3); justify-self: end; transition: transform 0.45s var(--ease), color 0.3s var(--ease); }
.row:hover .arrow { transform: translateX(6px); color: var(--fg); }
.row a::after { content: ""; position: absolute; inset: 0; }
@media (max-width: 879px) { .row .arrow { display: none; } }

/* --- the step wedge: a real calibration strip, used as a section rule ---- */

.wedge { display: flex; height: 8px; margin-block: clamp(30px, 4vw, 52px); border-radius: 1px; overflow: hidden; }
.wedge i { flex: 1 1 0; }

/* --- pathway steps ------------------------------------------------------- */

.path { display: grid; gap: 0; border-top: 1px solid var(--line); }
.path-step { display: grid; gap: 10px 40px; padding: clamp(22px, 3vw, 34px) 0; border-bottom: 1px solid var(--line); }
@media (min-width: 860px) { .path-step { grid-template-columns: 132px minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; } }
/* below the desktop grid the step marker rides beside its heading rather than
   stacking above it, which would read as an eyebrow */
@media (min-width: 620px) and (max-width: 859px) {
  .path-step { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
  .path-step > .note { grid-column: 2; grid-row: 1; text-align: right; }
  .path-step > h3 { grid-column: 1; grid-row: 1; }
  .path-step > p, .path-step > div { grid-column: 1 / -1; grid-row: 2; }
}
/* on a narrow phone the marker gets its own line UNDER the heading: beside it
   would crush the heading measure, above it would be an eyebrow */
@media (max-width: 619px) {
  .path-step { grid-template-columns: minmax(0, 1fr); }
  .path-step > h3 { order: 1; }
  .path-step > .note { order: 2; }
  .path-step > p, .path-step > div { order: 3; }
}

/* --- the week: a clinic's real artefact is its schedule ------------------ */

.week { width: 100%; border-collapse: collapse; margin-top: 40px; text-align: left; }
.week caption { text-align: left; padding-bottom: 12px; }
.week th, .week td { padding: 12px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.week th {
  font-weight: 540; font-size: 0.95rem; color: var(--fg); padding-right: 20px;
}
.week td { color: var(--fg-2); font-size: 0.88rem; letter-spacing: 0.04em; text-align: right; white-space: nowrap; }
@media (max-width: 560px) {
  .week th, .week td { display: block; border: 0; padding: 0; text-align: left; }
  .week tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .week td { margin-top: 4px; white-space: normal; }
}

/* --- booking form (light surface) ---------------------------------------- */

.form-shell { display: grid; gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (min-width: 1000px) { .form-shell { grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.85fr); } }

fieldset { border: 0; margin-bottom: 34px; }
legend { font-weight: 620; font-size: 1.06rem; letter-spacing: -0.02em; margin-bottom: 6px; }
.field-help { display: block; color: var(--fg-2); font-size: 0.9rem; margin-bottom: 18px; }

.choices { display: grid; gap: 10px; }
@media (min-width: 620px) { .choices { grid-template-columns: repeat(2, 1fr); } }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice span {
  display: flex; flex-direction: column; gap: 3px;
  min-height: 62px; padding: 13px 16px; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  background: #fff; cursor: pointer;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.choice span small { color: var(--fg-2); font-size: 0.82rem; }
.choice input:hover + span { border-color: var(--fg-3); }
.choice input:checked + span { border-color: var(--graphite-900); box-shadow: inset 0 0 0 1px var(--graphite-900); }
.choice input:focus-visible + span { outline: 2px solid var(--safelight); outline-offset: 2px; }
.choice input:disabled + span { opacity: 0.42; cursor: not-allowed; background: #f2f5f7; }

.slots { display: grid; gap: 9px; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
.slot span {
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: #fff; cursor: pointer; font-variant-numeric: tabular-nums; font-size: 0.95rem;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.slot input:checked + span { border-color: var(--graphite-900); box-shadow: inset 0 0 0 1px var(--graphite-900); }
.slot input:disabled + span { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; background: #f2f5f7; }
.slot input:focus-visible + span { outline: 2px solid var(--safelight); outline-offset: 2px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 540; font-size: 0.92rem; margin-bottom: 7px; }
.field .req { color: #b23a2c; }
.field input, .field textarea {
  width: 100%; min-height: 50px; padding: 13px 15px;
  font: inherit; font-size: 1rem; color: var(--fg);
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field textarea { min-height: 108px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--graphite-900); box-shadow: inset 0 0 0 1px var(--graphite-900); }
.field input::placeholder, .field textarea::placeholder { color: #5a6c77; }
.field .hint { display: block; color: var(--fg-2); font-size: 0.84rem; margin-top: 6px; }
.field .err { display: none; color: #b23a2c; font-size: 0.86rem; margin-top: 7px; font-weight: 520; }
.field.is-bad input, .field.is-bad textarea { border-color: #b23a2c; box-shadow: inset 0 0 0 1px #b23a2c; }
.field.is-bad .err { display: block; }

.summary { position: sticky; top: 100px; border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; padding: 24px; }
.summary dl { display: grid; gap: 13px; margin: 18px 0 22px; }
.summary dt { font-size: 0.78rem; letter-spacing: 0.04em; color: var(--fg-3); font-weight: 560; }
.summary dd { font-weight: 540; margin-top: 2px; }
.summary dd.empty { color: var(--fg-3); font-weight: 400; }

.done { display: none; }
.done.is-on { display: block; }
form.is-sent { display: none; }
.done-mark {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--graphite-900); color: var(--lum); margin-bottom: 22px;
}
.done-mark svg { width: 26px; }

.alert {
  display: none; gap: 12px; align-items: flex-start;
  padding: 15px 17px; border-radius: var(--r); margin-bottom: 22px;
  background: #fdf0ee; border: 1px solid #e6b6ae; color: #8c2c20; font-size: 0.93rem;
}
.alert.is-on { display: flex; }
.alert svg { width: 19px; flex: none; margin-top: 2px; }

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

.site-foot { padding-block: clamp(54px, 7vw, 96px) 40px; border-top: 1px solid var(--line); }
.foot-grid { display: grid; gap: 36px; }
@media (min-width: 800px) { .foot-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 42px; } }
.foot-grid a.block, .foot-grid span.block { display: block; color: var(--fg-2); margin-top: 8px; font-size: 0.95rem; }
.foot-grid a.block:hover { color: var(--fg); }
.foot-fine { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: clamp(42px, 5vw, 74px); padding-top: 20px; border-top: 1px solid var(--line); }

/* --- concept provenance badge ------------------------------------------- */

.concept-badge {
  position: fixed; left: 14px; bottom: 14px; z-index: 70;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 13px; border-radius: 999px;
  background: var(--graphite-950); border: 1px solid rgba(180, 210, 228, 0.34);
  font-family: "Fragment Mono", monospace; font-size: 0.58rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: #a5b6c2;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}
.concept-badge:hover { color: var(--lum); border-color: var(--lum); }
.concept-badge b { color: var(--lum); font-weight: 400; }
.concept-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--safelight); flex: none; }
@media (max-width: 560px) { .concept-badge { font-size: 0.52rem; padding: 7px 10px; } }

/* --- motion: the viewer powers on --------------------------------------- */

/* Content is visible by default. Script arms the unlit state only once it is
   running, so a JS failure leaves a complete readable page rather than a blank one. */
[data-lit] { transition: opacity 0.85s var(--ease), transform 0.85s var(--ease), filter 1.15s var(--ease); }
[data-lit].is-armed { opacity: 0; transform: translateY(18px); }
/* panels ramp their luminance rather than merely fading */
.panel[data-lit].is-armed { filter: brightness(0.25) contrast(1.3); }

@media (prefers-reduced-motion: reduce) {
  [data-lit], [data-lit].is-armed { opacity: 1 !important; transform: none !important; filter: none !important; transition: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.skip { position: absolute; left: -9999px; top: 0; z-index: 100; padding: 12px 18px; background: var(--fg); color: var(--bg); font-weight: 600; }
.skip:focus { left: 12px; top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
