/* ==========================================================================
   taste · web tokens and base components
   Default theme: Quiet Glass (light + dark, follows the OS; data-theme="light|dark"
   on <html> forces one). Other themes: add a class on <html>:
     theme-atmos (light) · theme-nocturne (dark)
   Solid colors only. The only gradient functions here are masks and dot patterns.
   Load Google Sans: https://fonts.googleapis.com/css2?family=Google+Sans:wght@400..700&family=Google+Sans+Code:wght@400..600&display=swap
   ========================================================================== */

:root {
  /* color */
  --canvas: #F7F8FA;        /* page ground: spacefs.com, measured 2026-10-11; never pure white */
  --surface: #FFFFFF;       /* solid cards */
  --surface-2: #EEF0F3;     /* recessed wells, segmented tracks */
  --ink: #0E0F12;           /* headlines, primary text */
  --ink-2: #686D78;         /* second line of two-tone headlines, body copy */
  --ink-3: #8A8F99;         /* decoration only: icons, rings, disabled. Never readable text (3:1) */
  --hairline: #E0E3E8;      /* spacefs border */
  --accent: #1F4E79;        /* Ink blue from the accent library; replace per product (4.5:1 for words) */
  --primary: #0E0F12;       /* the pill CTA */
  --on-primary: #FFFFFF;
  --glass-fill: rgb(255 255 255 / .66);   /* spacefs nav and chips */
  --glass-rim: rgb(0 0 0 / .08);
  --glass-highlight: rgb(255 255 255 / .95);
  --control-fill: rgb(255 255 255 / .66);        /* spacefs glass control */
  --control-fill-hover: rgb(255 255 255 / .9);
  --control-border: rgb(15 23 42 / .09);
  --control-border-hover: rgb(15 23 42 / .14);
  --control-highlight: rgb(255 255 255 / .9);
  --panel-fill: rgb(255 255 255 / .92);          /* the open menu: words must read */
  --shade: 15 23 42;        /* rgb triplet for shadows: spacefs uses slate, never pure black */
  --dot-a: #4D6B99;         /* stipple hue A (cool) */
  --dot-b: #C47A3A;         /* stipple hue B (warm) */

  /* type: one family + its mono sibling */
  --font: "Google Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Google Sans Code", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --w-regular: 400;
  --w-medium: 500;
  --w-strong: 500;          /* section titles and headings: spacefs weight; never lighter */
  --w-bold: 650;

  /* shape */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 40px;
  --r-pill: 9999px;

  /* depth: hairline ring + soft layered shadow + inner top highlight */
  --shadow-1: 0 0 0 .5px rgb(var(--shade) / .12), 0 1px 2px rgb(var(--shade) / .10);
  --shadow-2: 0 0 0 .5px rgb(var(--shade) / .07), 0 1px 3px rgb(var(--shade) / .05), 0 10px 28px -12px rgb(var(--shade) / .16), inset 0 .5px 0 var(--glass-highlight);
  --shadow-3: 0 0 0 .5px rgb(var(--shade) / .12), 0 30px 70px -18px rgb(var(--shade) / .28), 0 10px 24px -12px rgb(var(--shade) / .16);

  /* motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-std: cubic-bezier(.4, 0, .2, 1);
  --dur-1: 160ms;
  --dur-2: 320ms;
  --dur-3: 560ms;

  /* layout */
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(64px, 6.35vw, 96px);   /* spacefs: 96px section padding */

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0C0D10;
    --surface: #15171B;
    --surface-2: #101215;
    --ink: #F4F5F7;
    --ink-2: #9AA0AB;
    --ink-3: #737A86;
    --hairline: #24272D;
    --accent: #7FA7D6;
    --primary: #F4F5F7;
    --on-primary: #0C0D10;
    --glass-fill: rgb(28 30 35 / .62);
    --glass-rim: rgb(255 255 255 / .09);
    --glass-highlight: rgb(255 255 255 / .07);
    --control-fill: rgb(255 255 255 / .06);
    --control-fill-hover: rgb(255 255 255 / .1);
    --control-border: rgb(255 255 255 / .12);
    --control-border-hover: rgb(255 255 255 / .18);
    --control-highlight: rgb(255 255 255 / .08);
    --panel-fill: rgb(22 24 28 / .92);
    --shade: 0 0 0;
    --dot-a: #7D9BD0;
    --dot-b: #D99860;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --canvas: #0C0D10;
  --surface: #15171B;
  --surface-2: #101215;
  --ink: #F4F5F7;
  --ink-2: #9AA0AB;
  --ink-3: #737A86;
  --hairline: #24272D;
  --accent: #7FA7D6;
  --primary: #F4F5F7;
  --on-primary: #0C0D10;
  --glass-fill: rgb(28 30 35 / .62);
  --glass-rim: rgb(255 255 255 / .09);
  --glass-highlight: rgb(255 255 255 / .07);
  --control-fill: rgb(255 255 255 / .06);
  --control-fill-hover: rgb(255 255 255 / .1);
  --control-border: rgb(255 255 255 / .12);
  --control-border-hover: rgb(255 255 255 / .18);
  --control-highlight: rgb(255 255 255 / .08);
  --panel-fill: rgb(22 24 28 / .92);
  --shade: 0 0 0;
  --dot-a: #7D9BD0;
  --dot-b: #D99860;
  color-scheme: dark;
}

/* --- Themes (each redefines every color token, so the OS dark block never leaks in) --- */

:root.theme-atmos {            /* frosted sheets in soft light */
  --canvas: #EEF0F3;
  --surface: #FFFFFF;
  --surface-2: #E6E9EE;
  --ink: #111214;
  --ink-2: #6B7280;
  --ink-3: #8E95A1;
  --hairline: #DDE1E7;
  --accent: #3E6E91;
  --primary: #0A0A0B;
  --on-primary: #FFFFFF;
  --glass-fill: rgb(255 255 255 / .70);
  --glass-rim: rgb(255 255 255 / .55);
  --glass-highlight: rgb(255 255 255 / .95);
  --shade: 20 30 48;
  --dot-a: #6F95B2;
  --dot-b: #9DB0C9;
  --atmos: #6F95B2;            /* the one hue used as light behind glass */
  color-scheme: light;
}

:root.theme-nocturne {         /* dark, flat, one accent */
  --canvas: #0A0A0A;
  --surface: #141416;
  --surface-2: #101012;
  --ink: #F2F2F0;
  --ink-2: #9B9BA1;
  --ink-3: #6E6E75;
  --hairline: #232326;
  --accent: #7AA2FF;           /* replace with the product's brand hue */
  --primary: #F2F2F0;
  --on-primary: #0A0A0A;
  --glass-fill: rgb(30 30 34 / .55);
  --glass-rim: rgb(255 255 255 / .08);
  --glass-highlight: rgb(255 255 255 / .06);
  --control-fill: rgb(255 255 255 / .06);
  --control-fill-hover: rgb(255 255 255 / .1);
  --control-border: rgb(255 255 255 / .12);
  --control-border-hover: rgb(255 255 255 / .18);
  --control-highlight: rgb(255 255 255 / .08);
  --panel-fill: rgb(20 20 22 / .92);
  --shade: 0 0 0;
  --dot-a: #5B6B8C;
  --dot-b: #8C6A4E;
  color-scheme: dark;
}

/* --- Base --- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--canvas); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; } /* overscroll shows the canvas, never black */
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: var(--w-regular) 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--primary); color: var(--on-primary); }

/* --- Type --- */

.display, .title, .heading { margin: 0; color: var(--ink); text-wrap: balance; }
/* spacefs.com type scale, measured 2026-10-11 at 1512px (hero 76, sections 60 and 54, rows 34, lede 17) */
.display { font-size: clamp(40px, 10vw, 48px); line-height: 1.02; letter-spacing: -0.035em; font-weight: var(--w-strong); }   /* spacefs hero sizes; 500 keeps the owner's bold rule (spacefs sets 400) */
@media (min-width: 640px) { .display { font-size: clamp(48px, 5.6vw, 76px); } }
.title { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.04; letter-spacing: -0.035em; font-weight: var(--w-strong); }
.title-2 { margin: 0; color: var(--ink); text-wrap: balance; font-size: clamp(32px, 4.4vw, 54px); line-height: 1.04; letter-spacing: -0.03em; font-weight: var(--w-strong); }
.heading { font-size: clamp(24px, 2.25vw, 34px); line-height: 1.25; letter-spacing: -0.025em; font-weight: var(--w-medium); }
.lede { font-size: 17px; line-height: 1.625; letter-spacing: 0; color: var(--ink-2); text-wrap: pretty; max-width: 480px; }
.meta { font-size: 12px; line-height: 16px; letter-spacing: .3px; color: color-mix(in srgb, var(--ink) 80%, transparent); }
.muted { color: var(--ink-2); }
.label { font-size: 12px; line-height: 1.2; font-weight: var(--w-medium); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.mono { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.two-tone > * { display: block; }
.two-tone > :last-child { color: var(--ink-2); }

/* --- Layout --- */

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.hairline { border: 0; border-top: 1px solid var(--hairline); margin: 0; }

/* --- Surfaces --- */

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.glass {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 0 0 .5px var(--glass-rim), 0 8px 24px -10px rgb(var(--shade) / .18), inset 0 .5px 0 var(--glass-highlight);
}

/* --- spacefs glass control: nav pieces, chips, segmented strips, the menu --- */
.glass-control { background: var(--control-fill); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); border: 1px solid var(--control-border); box-shadow: inset 0 1px 0 var(--control-highlight), 0 1px 2px rgb(var(--shade) / .05); transition: background-color .2s, border-color .2s; }
.glass-control:hover { background: var(--control-fill-hover); border-color: var(--control-border-hover); }

/* --- spacefs menu: a 52px pill that grows into a glass panel (spacefs.md) --- */
.menu-morph { position: fixed; top: 14px; left: 50%; translate: -50% 0; z-index: 60; width: 112px; height: 52px; overflow: clip; border-radius: 28px;
  transition: width .25s cubic-bezier(.4,0,.2,1), height .25s cubic-bezier(.4,0,.2,1); }
.menu-morph[data-open] { width: min(520px, 100vw - 32px); height: var(--menu-h, 430px); background: var(--panel-fill);
  -webkit-backdrop-filter: blur(32px) saturate(1.7); backdrop-filter: blur(32px) saturate(1.7);
  box-shadow: inset 0 1px 0 var(--control-highlight), 0 32px 80px -32px rgb(30 45 80 / .4);
  transition-duration: .45s; transition-timing-function: cubic-bezier(.22,1,.36,1); }
.menu-morph .item { opacity: 0; transform: translateY(18px); transition: opacity .3s, transform .45s cubic-bezier(.22,1,.36,1); }
.menu-morph[data-open] .item { opacity: 1; transform: none; transition-delay: calc(120ms + var(--i, 0) * 40ms); }
@media (prefers-reduced-motion: reduce) { .menu-morph, .menu-morph .item { transition: none; } }

/* --- Buttons --- */

.btn {
  --h: 48px;                /* spacefs hero CTA: 48px, padding 0 28px */
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h); padding: 0 28px;
  border: 0; border-radius: var(--r-pill);
  font: var(--w-medium) 14px/20px var(--font); letter-spacing: 0;
  color: var(--ink); background: transparent;
  cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition: transform 90ms var(--ease-out), background-color var(--dur-1) var(--ease-std), opacity var(--dur-1) var(--ease-std);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: inset 0 1px 0 rgb(255 255 255 / .16), 0 8px 20px -10px rgb(var(--shade) / .5); }   /* spacefs Download pill */
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 86%, var(--canvas)); }
.btn-glass {
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 0 0 .5px var(--glass-rim), 0 6px 18px -10px rgb(var(--shade) / .2), inset 0 .5px 0 var(--glass-highlight);
}
.btn-glass:hover { background: color-mix(in srgb, var(--glass-fill) 70%, var(--surface)); }
.btn-outline { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 60%, transparent); }
.btn-circle { --h: 44px; width: var(--h); padding: 0; background: var(--surface); box-shadow: var(--shadow-1); }
.btn-sm { --h: 40px; padding: 0 16px; }   /* spacefs nav Download: 40px, padding 0 16px */
.btn-xs { --h: 32px; padding: 0 12px; }   /* small 32px pill: chips and inner buttons; the Menu pill itself is 52px */
.btn svg { width: 18px; height: 18px; flex: none; }
.arrow { transition: transform var(--dur-2) var(--ease-out); }
a:hover .arrow, button:hover .arrow { transform: translateX(4px); }

/* --- Small parts --- */

.chip {                     /* spacefs chip: glass, 32px, 12px words */
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 32px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .9), 0 1px 2px rgb(var(--shade) / .05);
  font-size: 12px; line-height: 16px; color: var(--ink-2);
}
.glass-card {               /* spacefs link card: glass, radius 24, padding 28 32 */
  border-radius: 24px; padding: 28px 32px;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .95), 0 24px 60px -28px rgb(var(--shade) / .28), 0 0 0 .5px var(--glass-rim);
}
.segmented {
  display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--r-pill);
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 0 0 .5px var(--glass-rim), 0 6px 18px -10px rgb(var(--shade) / .18);
}
.segmented button {
  min-height: 36px; padding: 8px 16px; border: 0; border-radius: var(--r-pill);   /* spacefs: 36px */
  background: transparent; color: var(--ink-2); cursor: pointer;
  font: var(--w-medium) 14px/20px var(--font);
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-1) var(--ease-std), box-shadow var(--dur-2) var(--ease-out);
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

/* Horizontal rail: snap, scrollbar hidden on rails only */
.rail { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: none; scroll-snap-align: center; }

/* Dot-matrix text: a hard-edged dot pattern, not a color blend */
.dot-matrix {
  color: transparent;
  background-image: radial-gradient(circle at center, var(--ink-3) 1.15px, transparent 1.5px);
  background-size: 6px 6px;
  -webkit-background-clip: text;
  background-clip: text;
}

/* Floating nav: three separate pieces over a feathered blur band */
.feather {
  position: fixed; inset: 0 0 auto; z-index: 49; pointer-events: none;
  height: calc(env(safe-area-inset-top, 0px) + 92px);
  background: color-mix(in srgb, var(--canvas) 55%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent);
}
.feather.clear { background: transparent; } /* over full-bleed photos: blur only, no pale band */

/* Scroll reveal: starts visible, CSS-only, skipped without support or with Reduce Motion */
@keyframes taste-reveal { from { opacity: .4; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: taste-reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* --- Fallbacks: last in the file so no component rule overrides them --- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .btn-glass, .segmented, .nav-pill, .glass-card, .glass-control, .chip, .menu-morph { background: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .btn-glass, .segmented, .nav-pill, .glass-card, .glass-control, .chip, .menu-morph { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
