/* Sophia Ho portfolio design tokens, v0.2 (2026-11-15).
   Light: Ink text and indigo accent on Moss surfaces. Dark: Moss surfaces with a light indigo accent.
   Dark follows the OS unless data-theme="light|dark" is set on <html>.
   Extracted from artifacts/portfolio-home.html (same as design-system/design-system.html plus --radius-pill). */


:root {
  /* ---------- Type ---------- */
  /* Apple system stack: SF Pro on Apple devices, closest native face elsewhere. */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* Scale: 17px body (Apple's default reading size). */
  --text-xs: 0.8125rem;   /* 13  captions, tags */
  --text-sm: 0.9375rem;   /* 15  meta, nav, labels */
  --text-md: 1.0625rem;   /* 17  body */
  --text-lg: 1.3125rem;   /* 21  section headings, card titles */
  --text-xl: 1.75rem;     /* 28  search-field questions, small tallies */
  --text-2xl: 2.25rem;    /* 36  page title */
  --text-3xl: clamp(2.25rem, 1.7rem + 2.2vw, 3rem); /* 36 to 48  home intro, case study Context sentence and big numbers */

  --leading-tight: 1.12;
  --leading-snug: 1.3;
  --leading-body: 1.6;

  --tracking-display: -0.022em;
  --tracking-heading: -0.012em;
  --tracking-body: -0.003em;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  --measure: 40rem;       /* reading column, ~68 characters */

  /* ---------- Spacing (Figma UI3 spacer scale) ---------- */
  /* spacer-0 to spacer-6 match Figma's UI3 kit exactly: base 4, clean multiples
     of 8 after that. 7 to 9 extend the same rule for page-level gaps. */
  --spacer-0: 0rem;     /* 0 */
  --spacer-1: 0.25rem;  /* 4 */
  --spacer-2: 0.5rem;   /* 8   default padding for dense elements */
  --spacer-3: 1rem;     /* 16 */
  --spacer-4: 1.5rem;   /* 24 */
  --spacer-5: 2rem;     /* 32 */
  --spacer-6: 2.5rem;   /* 40 */
  --spacer-7: 3rem;     /* 48  portfolio extension */
  --spacer-8: 4rem;     /* 64  portfolio extension */
  --spacer-9: 6rem;     /* 96  portfolio extension: between sections */

  /* Control and row heights (Figma UI3): 24 small, 32 default, 40 heading row */
  --size-sm: 24px;      /* tags, small chips */
  --size-md: 32px;      /* buttons, switch segments */
  --size-lg: 40px;      /* nav row, segmented control */
  --target-touch: 44px; /* minimum hit area on touch screens (Apple HIG) */

  /* ---------- Layout (after Apple HIG: Layout) ---------- */
  /* Size classes by available width, not device: compact under 640px, regular
     from 640px, wide from 59rem. Use container queries on the element's own width. */
  --size-class-break: 640px;
  --size-class-wide-break: 59rem; /* 944: room for a side column beside the reading
     width, like the case study section nav. Media queries can't read tokens, so they
     repeat it: (min-width: 59rem) in, (max-width: 58.99rem) out. */
  --margin-compact: 16px;   /* side margin, compact (plus safe-area inset) */
  --margin-regular: 32px;   /* side margin, regular */
  --page-max: 87.5rem; /* 1400: page width for home, this page and the case study frame */
  --read-max: 42rem;   /* 672: case study column */
  --intro-max: 34rem;  /* 544: home intro column, centred on the page, text left-aligned */

  /* ---------- Shape ---------- */
  /* Corners (2026-11-23, after 92learns' border radius rules). Pick by the
     shape's shortest side, so bigger things are rounder: xs under 16px, sm up
     to about 48px, md up to about 160px, lg beyond, and pill for controls you
     tap that float. Nested corners share a centre: inner = outer minus the gap
     between them, never the same radius twice. --radius-lg around a --spacer-2
     gap holds --radius-md, and --radius-sm around a --spacer-1 gap holds
     --radius-xs; otherwise calc(outer - gap), and never under --radius-xs.
     A ring drawn outside a shape takes its radius plus the gap. */
  --radius-xs: 4px;    /* tiny marks (skeleton lines, bars, small dots), and the smallest nested corner */
  --radius-sm: 8px;    /* tags, buttons */
  --radius-md: 14px;   /* stat blocks, small cards, app icons */
  --radius-lg: 22px;   /* cards, quotes, media, panels */
  --radius-pill: 999px; /* glass controls, switch thumbs */

  /* ---------- Motion (after Apple HIG: Motion) ---------- */
  /* Purposeful, brief, interruptible, optional. Motion shows what changed and
     never carries meaning on its own. No scroll-triggered reveals and no looping
     motion: content never animates in because it scrolled into view. A control
     that tracks your place on the page (like the case study section nav) may
     move to show which section you are in. Two things may loop: the
     search-field caret, which blinks slowly like a real cursor, and the
     Greenhouse "hard to find" scribble, which redraws itself like a GIF. */
  --duration-instant: 100ms; /* press feedback */
  --duration-fast: 180ms;    /* hover, color and focus changes */
  --duration-base: 280ms;    /* crossfades, state swaps */
  --duration-spring: 450ms;  /* things that move: switch thumb, panels */
  --duration: var(--duration-fast); /* legacy alias */

  --ease: cubic-bezier(0.2, 0, 0, 1);           /* standard ease-out */
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);  /* crossfades */
  /* Spring fallbacks for browsers without linear(); real springs below. */
  --spring-smooth: cubic-bezier(0.25, 1, 0.5, 1);
  --spring-snappy: cubic-bezier(0.3, 1.2, 0.5, 1);
  --spring-bouncy: cubic-bezier(0.34, 1.56, 0.64, 1); /* one-off delight only */

  /* ---------- Color: light ---------- */
  --color-bg: #f7f8f6;          /* Moss page */
  --color-surface: #eef0ec;     /* Moss surface: cards, media, stats */
  --color-surface-2: #e2e6df;   /* tags, placeholder fill */
  --color-line: #dce0d8;        /* hairlines */
  --color-text: #1d2036;        /* Ink */
  --color-text-2: #575c74;      /* secondary (5.7:1 on surface) */
  --color-accent: #3d4fd1;      /* Ink indigo (5.7:1 on surface) */
  --color-accent-hover: #2c3ca8;
  --color-on-accent: #ffffff;
  --color-focus: #3d4fd1;

  /* ---------- Cursor (Figma multiplayer feel, own shape) ---------- */
  /* Accent arrowhead with a thick light edge and a soft drop shadow. Pointer = inverted (hollow) arrow.
     Text fields keep the system I-beam. Hotspot is the tip (6, 5). */
  --cursor-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='-2 -2 28 28'%3E%3Cdefs%3E%3Cfilter id='s' x='-30%' y='-30%' width='160%' height='160%'%3E%3CfeDropShadow dx='0' dy='1' stdDeviation='1.1' flood-color='%23000' flood-opacity='0.28'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M4.2 3.1 L20.1 9.4 C21 9.8 21 10.9 20.1 11.2 L13.6 13.6 L11.2 20.1 C10.9 21 9.8 21 9.4 20.1 Z' fill='%233d4fd1' stroke='%23ffffff' stroke-width='2.2' stroke-linejoin='round' filter='url%28%23s%29'/%3E%3C/svg%3E") 6 5, auto;
  --cursor-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='-2 -2 28 28'%3E%3Cdefs%3E%3Cfilter id='s' x='-30%' y='-30%' width='160%' height='160%'%3E%3CfeDropShadow dx='0' dy='1' stdDeviation='1.1' flood-color='%23000' flood-opacity='0.22'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M4.2 3.1 L20.1 9.4 C21 9.8 21 10.9 20.1 11.2 L13.6 13.6 L11.2 20.1 C10.9 21 9.8 21 9.4 20.1 Z' fill='%23ffffff' stroke='%233d4fd1' stroke-width='2' stroke-linejoin='round' filter='url%28%23s%29'/%3E%3C/svg%3E") 6 5, pointer;

  /* ---------- Liquid glass (floating controls layer only) ---------- */
  /* Matched to Apple's look: nearly clear, barely blurred, a crisp bright edge
     with specular highlights on opposite corners, and (Chromium) a lens at the rim.
     Values tuned by Otis in the glass tester, 2026-11-15. Two variants: Light (white tint, dark text) for light pages, Clear (slight
     dim, white text) over photos and media. Never on cards or content. */
  --glass-tint: rgb(255 255 255 / 0.24);        /* Light variant */
  --glass-text: #1d2036;
  --glass-clear-tint: rgb(0 0 0 / 0.08);        /* Clear variant */
  --glass-clear-text: #ffffff;
  --glass-blur: 1.5px;
  --glass-saturate: 135%;
  --glass-brightness: 1.04;
  --glass-edge: rgb(255 255 255 / 0.17);        /* 1px rim */
  --glass-specular: rgb(255 255 255 / 0.3);    /* rim highlight, top-left and bottom-right */
  --glass-shadow: 0 2px 12px rgb(0 0 0 / 0.12);
  --glass-selected: rgb(255 255 255 / 0.5);     /* selected segment / pressed */
  --glass-refraction: 39;                       /* lens strength at the rim, Chromium only */
  /* Adaptive text: glass reads what is behind it and flips its text.
     .on-light = bright content behind, dark text. .on-dark = dark content behind, white text. */
  --glass-ink-dark: #1d2036;
  --glass-ink-light: #ffffff;
  /* Over text: frost harder so words behind read as a soft smudge */
  --glass-blur-text: 8px;
  --glass-tint-text: rgb(255 255 255 / 0.36);
  /* Split light/dark behind one control: one text color, stronger backing */
  --glass-tint-mixed: rgb(255 255 255 / 0.54);
  --glass-dim-mixed: rgb(0 0 0 / 0.32);
}

/* ---------- Color: dark (Moss surfaces, indigo accent) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0f110f;
    --color-surface: #181b18;
    --color-surface-2: #222622;
    --color-line: #2a2f2a;
    --color-text: #eef1ec;
    --color-text-2: #a4aca2;
    --color-accent: #9aa8ff;
    --color-accent-hover: #bcc5ff;
    --color-on-accent: #0f110f;
    --color-focus: #9aa8ff;
    --cursor-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='-2 -2 28 28'%3E%3Cdefs%3E%3Cfilter id='s' x='-30%' y='-30%' width='160%' height='160%'%3E%3CfeDropShadow dx='0' dy='1' stdDeviation='1.1' flood-color='%23000' flood-opacity='0.6'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M4.2 3.1 L20.1 9.4 C21 9.8 21 10.9 20.1 11.2 L13.6 13.6 L11.2 20.1 C10.9 21 9.8 21 9.4 20.1 Z' fill='%239aa8ff' stroke='%230f110f' stroke-width='2.2' stroke-linejoin='round' filter='url%28%23s%29'/%3E%3C/svg%3E") 6 5, auto;
    --cursor-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='-2 -2 28 28'%3E%3Cdefs%3E%3Cfilter id='s' x='-30%' y='-30%' width='160%' height='160%'%3E%3CfeDropShadow dx='0' dy='1' stdDeviation='1.1' flood-color='%23000' flood-opacity='0.6'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M4.2 3.1 L20.1 9.4 C21 9.8 21 10.9 20.1 11.2 L13.6 13.6 L11.2 20.1 C10.9 21 9.8 21 9.4 20.1 Z' fill='%230f110f' stroke='%239aa8ff' stroke-width='2' stroke-linejoin='round' filter='url%28%23s%29'/%3E%3C/svg%3E") 6 5, pointer;
    --glass-tint: rgb(255 255 255 / 0.08); --glass-tint-text: rgb(255 255 255 / 0.14);
    --glass-text: #eef1ec;
    --glass-edge: rgb(255 255 255 / 0.22);
    --glass-specular: rgb(255 255 255 / 0.6);
    --glass-selected: rgb(255 255 255 / 0.16);
    --glass-shadow: 0 2px 14px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --color-bg: #0f110f;
  --color-surface: #181b18;
  --color-surface-2: #222622;
  --color-line: #2a2f2a;
  --color-text: #eef1ec;
  --color-text-2: #a4aca2;
  --color-accent: #9aa8ff;
  --color-accent-hover: #bcc5ff;
  --color-on-accent: #0f110f;
  --color-focus: #9aa8ff;
  --cursor-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='-2 -2 28 28'%3E%3Cdefs%3E%3Cfilter id='s' x='-30%' y='-30%' width='160%' height='160%'%3E%3CfeDropShadow dx='0' dy='1' stdDeviation='1.1' flood-color='%23000' flood-opacity='0.6'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M4.2 3.1 L20.1 9.4 C21 9.8 21 10.9 20.1 11.2 L13.6 13.6 L11.2 20.1 C10.9 21 9.8 21 9.4 20.1 Z' fill='%239aa8ff' stroke='%230f110f' stroke-width='2.2' stroke-linejoin='round' filter='url%28%23s%29'/%3E%3C/svg%3E") 6 5, auto;
  --cursor-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='-2 -2 28 28'%3E%3Cdefs%3E%3Cfilter id='s' x='-30%' y='-30%' width='160%' height='160%'%3E%3CfeDropShadow dx='0' dy='1' stdDeviation='1.1' flood-color='%23000' flood-opacity='0.6'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M4.2 3.1 L20.1 9.4 C21 9.8 21 10.9 20.1 11.2 L13.6 13.6 L11.2 20.1 C10.9 21 9.8 21 9.4 20.1 Z' fill='%230f110f' stroke='%239aa8ff' stroke-width='2' stroke-linejoin='round' filter='url%28%23s%29'/%3E%3C/svg%3E") 6 5, pointer;
  --glass-tint: rgb(255 255 255 / 0.08); --glass-tint-text: rgb(255 255 255 / 0.14);
  --glass-text: #eef1ec;
  --glass-edge: rgb(255 255 255 / 0.22);
  --glass-specular: rgb(255 255 255 / 0.6);
  --glass-selected: rgb(255 255 255 / 0.16);
  --glass-shadow: 0 2px 14px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

/* Increase Contrast (prefers-contrast: more): full-ink secondary text, darker lines, nearly solid glass.
   The #a11y id selector only raises specificity so this wins over both theme blocks. */
@media (prefers-contrast: more) {
  :root:not(#a11y) {
    --color-text-2: var(--color-text);
    --color-line: color-mix(in srgb, var(--color-text) 45%, var(--color-bg));
    --glass-tint: color-mix(in srgb, var(--color-bg) 92%, transparent);
    --glass-tint-text: var(--glass-tint);
    --glass-tint-mixed: var(--glass-tint);
    --glass-clear-tint: rgb(0 0 0 / 0.66);
    --glass-blur: 12px;
    --glass-blur-text: 12px;
    --glass-edge: color-mix(in srgb, var(--color-text) 35%, transparent);
    --glass-specular: var(--glass-edge);
  }
}

/* Glass turns solid when the visitor asks for less transparency. */
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-tint: var(--color-bg); --glass-clear-tint: rgb(0 0 0 / 0.72); --glass-blur: 0px; --glass-saturate: 100%; --glass-brightness: 1; --glass-refraction: 0; --glass-blur-text: 0px; --glass-tint-text: var(--color-bg); --glass-tint-mixed: var(--color-bg); --glass-dim-mixed: rgb(0 0 0 / 0.72); }
}

/* Springs modelled on SwiftUI's .smooth (bounce 0), .snappy (0.15) and .bouncy (0.3). */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring-smooth: linear(0, 0.05, 0.158, 0.286, 0.413, 0.527, 0.626, 0.707, 0.774, 0.826, 0.868, 0.9, 0.925, 0.943, 0.958, 0.969, 0.977, 0.983, 0.987, 0.991, 0.993, 0.995, 0.996, 0.997, 1);
    --spring-snappy: linear(0, 0.047, 0.156, 0.289, 0.426, 0.552, 0.661, 0.752, 0.825, 0.881, 0.922, 0.952, 0.974, 0.988, 0.997, 1.002, 1.005, 1.006, 1.006, 1.006, 1.005, 1.004, 1.003, 1.003, 1);
    --spring-bouncy: linear(0, 0.061, 0.201, 0.373, 0.544, 0.695, 0.817, 0.909, 0.973, 1.014, 1.036, 1.045, 1.045, 1.04, 1.033, 1.025, 1.017, 1.011, 1.006, 1.003, 1, 0.999, 0.998, 0.998, 1);
  }
}

/* Reduce motion: nothing moves. Crossfades stay, shortened, so state changes still read. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 0ms;
    --duration-fast: 0ms;
    --duration-spring: 0ms;
    --duration-base: 120ms;
  }
}


