/* Design tokens. Every colour used on the page comes from here.
   Two surface themes: .t-dark (studio) and .t-paper (warm white).
   Components read the --s-* surface variables, never the raw palette. */

:root {
  /* palette ---------------------------------------------------------- */
  --ink-990: #060c14;  /* deepest: canvas and screen fills */
  --ink-950: #08101a;  /* sunken studio surface */
  --ink-900: #0c1420;  /* studio background */
  --ink-800: #111c2b;  /* panel */
  --ink-700: #16243a;  /* raised panel */
  --ink-600: #1e3a5f;  /* MediBrix navy */
  --ink-500: #2c4e78;

  --paper-0: #ffffff;
  --paper-50: #fffdfa;
  --paper-100: #f6f4f0; /* warm white background */
  --paper-200: #ebe7e0;
  --paper-300: #ddd8cf;

  /* On paper, contrast against the darkest paper surface (--paper-200):
     slate-900 13.5:1 · slate-600 7.0:1 · slate-400 4.6:1 */
  --slate-900: #16202c;
  --slate-600: #434e58;
  --slate-400: #5d6974;

  /* On the studio surfaces, contrast against the lightest (--ink-800):
     mist-100 14.7:1 · mist-300 7.7:1 · mist-500 5.0:1 */
  --mist-100: #e9eef4;
  --mist-300: #9fb0c3;
  --mist-500: #7a8da2;

  --tally-500: #cc2a20; /* fills that carry white text (5.4:1) */
  --tally-400: #e2362c; /* decorative lamp only */
  --tally-300: #ff7a6b; /* accent text on the dark surface (7.3:1) */
  --tally-ink: #b32316; /* accent text on paper (6.0:1) */

  /* Tints of the two colours above. Needed outside .t-dark as well — the header
     and the screen mockups sit on a studio surface inside paper sections. */
  --ondark-line-soft: rgba(233, 238, 244, 0.08);
  --ondark-line: rgba(233, 238, 244, 0.14);
  --ondark-line-strong: rgba(233, 238, 244, 0.26);
  --ondark-fill-soft: rgba(233, 238, 244, 0.1);
  --ondark-fill: rgba(233, 238, 244, 0.26);
  --header-bg: rgba(12, 20, 32, 0.92);
  --screen-scrim: rgba(8, 16, 26, 0.88);

  /* surface defaults = paper -------------------------------------- */
  --s-bg: var(--paper-100);
  --s-bg-raised: var(--paper-50);
  --s-bg-sunken: var(--paper-200);
  --s-fg: var(--slate-900);
  --s-fg-muted: var(--slate-600);
  --s-fg-faint: var(--slate-400);
  --s-line: var(--paper-300);
  --s-line-soft: var(--paper-200);
  --s-accent: var(--tally-ink);
  --s-btn-bg: var(--slate-900);
  --s-btn-fg: var(--paper-50);
  --s-focus: var(--ink-600);

  /* type ----------------------------------------------------------- */
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;

  --fs-100: 0.75rem;
  --fs-200: 0.8125rem;
  --fs-300: 0.875rem;
  --fs-400: 1rem;
  --fs-500: 1.0625rem;
  --fs-600: clamp(1.125rem, 0.98rem + 0.55vw, 1.375rem);
  --fs-700: clamp(1.375rem, 1.12rem + 1.1vw, 1.95rem);
  --fs-800: clamp(1.75rem, 1.28rem + 2vw, 2.9rem);
  --fs-900: clamp(1.95rem, 1.22rem + 2.6vw, 3.35rem);

  --lh-tight: 1.22;
  --lh-snug: 1.4;
  --lh-body: 1.72;

  /* space ----------------------------------------------------------- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  --shell: 1240px;
  --shell-narrow: 920px;
  --gutter: clamp(20px, 5vw, 56px);
  --section-y: clamp(64px, 9vw, 128px);

  /* shape ----------------------------------------------------------- */
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 8px;
  --r-4: 14px;
  --shadow-1: 0 1px 2px rgba(12, 20, 32, 0.06), 0 8px 24px rgba(12, 20, 32, 0.06);
  --shadow-2: 0 24px 64px rgba(6, 11, 18, 0.45);

  --ease: cubic-bezier(0.22, 0.68, 0.3, 1);
  --dur: 480ms;

  --header-h: 76px;
}

.t-dark {
  --s-bg: var(--ink-900);
  --s-bg-raised: var(--ink-800);
  --s-bg-sunken: var(--ink-950);
  --s-fg: var(--mist-100);
  --s-fg-muted: var(--mist-300);
  --s-fg-faint: var(--mist-500);
  --s-line: var(--ondark-line);
  --s-line-soft: var(--ondark-line-soft);
  --s-accent: var(--tally-300);
  --s-btn-bg: var(--paper-100);
  --s-btn-fg: var(--slate-900);
  --s-focus: var(--tally-300);
  color-scheme: dark;
}

.t-paper {
  --s-bg: var(--paper-100);
  --s-bg-raised: var(--paper-50);
  --s-bg-sunken: var(--paper-200);
  --s-fg: var(--slate-900);
  --s-fg-muted: var(--slate-600);
  --s-fg-faint: var(--slate-400);
  --s-line: var(--paper-300);
  --s-line-soft: var(--paper-200);
  --s-accent: var(--tally-ink);
  --s-btn-bg: var(--slate-900);
  --s-btn-fg: var(--paper-50);
  --s-focus: var(--ink-600);
  color-scheme: light;
}

/* base ------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper-100);
  color: var(--slate-900);
  font-family: var(--font-sans);
  font-size: var(--fs-400);
  line-height: var(--lh-body);
  font-feature-settings: "tnum" 0;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.022em;
  word-break: keep-all;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

:focus-visible {
  outline: 2px solid var(--s-focus);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

::selection {
  background: var(--ink-600);
  color: var(--paper-0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* motion ----------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

html.shot-mode .reveal {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

html.shot-mode *,
html.shot-mode *::before,
html.shot-mode *::after {
  animation-play-state: paused !important;
  transition-duration: 1ms !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
