/* Trace — shared tokens for V1–V5 (brief §08, §09, §11, §13).
   Variants set their own fonts and pick 1–3 signals; everything else comes from here.
   Rule: signal colours are FILLS (washes, highlights, dots, photo tints). Strokes, text and
   state outlines use Ink/Graphite or the derived *-ink tones (all ≥4.7:1 on White and Paper). */

:root {
  /* Foundation */
  --white: #FFFFFF;
  --paper: #F7F6F2;      /* inside product surfaces and plates only, never the page ground */
  --stone: #E8E4DD;
  --sand: #D7CCBF;
  --ink: #111111;
  --graphite: #303033;
  --line: #DEDDD8;       /* rules only — 1.36:1, never text */
  --muted: #6B6A66;      /* secondary text, 5.4:1 on white */
  --muted-2: #5F5E5A;
  --muted-dark: #A3A29E; /* secondary text on ink, 7.4:1 */

  /* Signal library (fills) */
  --butter: #F5D864;
  --tangerine: #F47A3C;
  --coral: #F28A82;
  --pink: #F3B7C9;
  --lilac: #C6B6EB;
  --sky: #A9CCF5;
  --blue: #6299EA;
  --sage: #A8BC8F;

  /* Derived inks (strokes, text, states) */
  --butter-ink: #7F6500;
  --tangerine-ink: #B5501A;
  --coral-ink: #B5443B;
  --pink-ink: #A8456B;
  --lilac-ink: #6A55A8;
  --sky-ink: #2E6CA8;
  --blue-ink: #2C5FB0;
  --sage-ink: #526B3B;

  /* Light library (§09) — only as light: behind glass, inside photo plates, never as a section fill */
  --light: radial-gradient(120% 90% at 20% 10%, #EEF4FD 0%, rgb(238 244 253 / 0) 60%),
           radial-gradient(90% 80% at 85% 30%, #FDEEE6 0%, rgb(253 238 230 / 0) 55%),
           radial-gradient(80% 70% at 50% 100%, #F9EAF0 0%, rgb(249 234 240 / 0) 60%), #FFFFFF;
  --warm-signal: linear-gradient(115deg, #F5D864 0%, #F47A3C 55%, #F28A82 100%);
  --natural: linear-gradient(160deg, #A8BC8F 0%, #F5D864 55%, #FFFFFF 100%);

  /* Product language (§13) */
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --rule: 1px solid var(--line);
  --shadow-1: 0 1px 2px rgb(17 17 17 / .05), 0 0 0 .5px rgb(17 17 17 / .08);
  --shadow-float: 0 1px 2px rgb(17 17 17 / .04), 0 8px 24px -8px rgb(17 17 17 / .10), 0 32px 64px -24px rgb(17 17 17 / .12);

  /* Glass (§11): opaque-enough white for legibility + bezel; real blur only where it overlaps imagery */
  --glass-fill: rgb(255 255 255 / .72);
  --glass-fill-strong: rgb(255 255 255 / .88);
  --glass-blur: 22px;
  --glass-ring: rgb(255 255 255 / .38);

  /* Motion */
  --ease-out: cubic-bezier(.23, 1, .32, 1);      /* easeOutQuint — UI, 120–350ms */
  --ease-reveal: cubic-bezier(.22, .8, .22, 1);  /* reveals, ~0.8s */
  --ease-swap: cubic-bezier(.77, 0, .175, 1);    /* colour/background swaps, 0.55s */
  --t-fast: 160ms;
  --t: 280ms;
  --t-slow: 800ms;

  /* Layout */
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1320px;
}

/* ---------- glass bezel (Taito construction): opaque-ish card + 25% white outer ring + 1px masked highlight ---------- */
.tr-glass {
  position: relative;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.2);
  border-radius: var(--radius-l);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .55) inset, 0 1px 0 rgb(255 255 255 / .9) inset, var(--shadow-float);
}
.tr-glass::before { /* outer translucent ring (no blur of its own: the card already blurs, one backdrop pass is enough) */
  content: ""; position: absolute; inset: -7px; border-radius: calc(var(--radius-l) + 7px);
  background: var(--glass-ring); z-index: -1; pointer-events: none;
}
.tr-glass::after { /* soft edge highlight, fades left → right */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(100deg, rgb(255 255 255 / .95), rgb(255 255 255 / 0) 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* bezel without blur, for product UI on photos where blur is not needed */
.tr-bezel { position: relative; background: var(--white); border-radius: var(--radius-l); box-shadow: var(--shadow-float); }
.tr-bezel::before { content: ""; position: absolute; inset: -8px; border-radius: calc(var(--radius-l) + 8px); background: rgb(255 255 255 / .28); z-index: -1; pointer-events: none; }

/* ---------- film grain overlay: add class to a positioned photo wrapper ----------
   Fine monochrome luminance noise: one fractal-noise channel copied to R=G=B, alpha 1, contrast lifted, overlay-blended
   at low opacity (mid-tones get grain, highlights stay clean). Tune per variant with --grain-opacity. */
.tr-grain { position: relative; isolation: isolate; }
.tr-grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; opacity: var(--grain-opacity, .12); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n' x='0' y='0' width='100%' height='100%' color-interpolation-filters='sRGB'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='1 0 0 0 0  1 0 0 0 0  1 0 0 0 0  0 0 0 0 1'/><feComponentTransfer><feFuncR type='linear' slope='1.6' intercept='-.3'/><feFuncG type='linear' slope='1.6' intercept='-.3'/><feFuncB type='linear' slope='1.6' intercept='-.3'/></feComponentTransfer></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--white); color: var(--ink); }
img, video, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tnum { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
