/* Utsushi site — shared design system ("living glass", same tokens as the app: app/src/styles/tokens.css).
   Dark first, with a full light theme. Every page: aurora background, sticky glass nav, glass cards, footer.
   Landing-only pieces live in motion.css. Nothing here depends on JavaScript. */

/* Fonts are self-hosted (no third parties): Geist and Geist Mono, latin, variable weight. */
@font-face { font-family: "Geist"; src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2-variations"), url("/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations"), url("/fonts/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: dark;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);

  --mac: #5b8def;            /* machine A / blue glow */
  --pc: #e8795a;             /* machine B / coral glow */
  --brand: #9b9bf5;
  --grad: linear-gradient(100deg, #7fa6ff 0%, #9b9bf5 45%, #f09a7e 100%);
  --grad-edge: linear-gradient(135deg, #7fa6ff, #9b9bf5 45%, #f09a7e);

  --bg: #090b11;
  --bg-2: #0f1220;
  --text: rgba(255, 255, 255, .94);
  --text-2: rgba(255, 255, 255, .66);
  --text-3: rgba(255, 255, 255, .58);
  --hairline: rgba(255, 255, 255, .08);
  --glass: rgba(22, 25, 34, .55);
  --glass-strong: rgba(22, 25, 34, .88);
  --glass-edge: linear-gradient(160deg, rgba(255,255,255,.2), rgba(255,255,255,.04) 38%, rgba(155,155,245,.14) 70%, rgba(240,154,126,.22));
  --glass-hi: rgba(255, 255, 255, .1);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .75), 0 0 0 .5px rgba(0, 0, 0, .6);
  --ink: #ffffff;
  --on-ink: #0b0d14;
  --link: #8fb4ff;
  --aurora: 1;
  --grid-line: rgba(255, 255, 255, .035);
  --grain: .07;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --brand: #5b5bd6;
    --grad: linear-gradient(100deg, #2f62d0 0%, #4b4bc4 48%, #b8461f 100%);
    --grad-edge: linear-gradient(135deg, #5b8def, #5b5bd6 45%, #e8795a);
    --bg: #f5f6fb;
    --bg-2: #e9ecf8;
    --text: #0c0e16;
    --text-2: rgba(12, 14, 22, .7);
    --text-3: rgba(12, 14, 22, .64);
    --hairline: rgba(12, 14, 22, .09);
    --glass: rgba(255, 255, 255, .62);
    --glass-strong: rgba(255, 255, 255, .92);
    --glass-edge: linear-gradient(160deg, rgba(255,255,255,.95), rgba(12,14,22,.08) 40%, rgba(91,91,214,.22) 72%, rgba(232,121,90,.32));
    --glass-hi: rgba(255, 255, 255, .9);
    --shadow: 0 24px 60px -28px rgba(30, 34, 70, .28), 0 0 0 .5px rgba(12, 14, 22, .06);
    --ink: #0c0e16;
    --on-ink: #ffffff;
    --link: #3d5fd6;
    --aurora: .55;
    --grid-line: rgba(12, 14, 22, .045);
    --grain: .04;
  }
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body > main { flex: 1; }
::selection { background: color-mix(in srgb, var(--brand) 40%, transparent); }
a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .92em; }
img, svg, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 520px) { .wrap { padding: 0 16px; } }

/* ---------- Background: drifting aurora, faint grid, grain ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 70% at 50% -10%, var(--bg-2), var(--bg) 60%); }
.bg i { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; opacity: calc(var(--aurora) * var(--o, .5));
  background: radial-gradient(closest-side, var(--c), transparent); animation: aurora var(--t, 26s) ease-in-out infinite alternate; will-change: transform; }
.bg i:nth-child(1) { --c: rgba(91, 141, 239, .6); --o: .6; left: -26vmax; top: -32vmax; --t: 24s; }
.bg i:nth-child(2) { --c: rgba(91, 91, 214, .65); --o: .55; right: -30vmax; top: -20vmax; --t: 31s; animation-direction: alternate-reverse; }
.bg i:nth-child(3) { --c: rgba(232, 121, 90, .5); --o: .3; left: -24vmax; top: 40vh; --t: 28s; }
.bg i:nth-child(4) { --c: rgba(63, 184, 164, .45); --o: .3; right: -24vmax; bottom: -46vmax; --t: 34s; animation-direction: alternate-reverse; }
@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(8vmax, 5vmax, 0) scale(1.12); }
  100% { transform: translate3d(-6vmax, 9vmax, 0) scale(.94); }
}
.bg::before { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px; background-position: center top;
  -webkit-mask: radial-gradient(90% 70% at 50% 0%, #000 20%, transparent 75%); mask: radial-gradient(90% 70% at 50% 0%, #000 20%, transparent 75%); }
.bg::after { content: ""; position: absolute; inset: 0; opacity: var(--grain); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease); }
.nav.scrolled, .nav.solid { background: color-mix(in srgb, var(--bg) 62%, transparent); border-bottom-color: var(--hairline);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 4px 18px -4px rgba(91, 141, 239, .6); }
.nav-links { display: flex; gap: 2px; margin-right: auto; }
.nav-links a { padding: 6px 12px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--text); background: var(--hairline); }
.nav-cta { display: flex; gap: 8px; align-items: center; }
@media (max-width: 720px) { .nav-links .opt { display: none; } .nav .wrap { gap: 12px; } }
@media (max-width: 400px) { .nav-links { display: none; } .nav-cta { margin-left: auto; } }

/* ---------- Type ---------- */
h1, h2, h3 { font-weight: 650; letter-spacing: -.03em; color: var(--text); text-wrap: balance; }
h1 { font-size: clamp(42px, 7vw, 84px); line-height: 1.02; letter-spacing: -.048em; margin: 0 0 22px; }
h2 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.06; letter-spacing: -.04em; margin: 0 0 16px; }
h3 { font-size: 17px; line-height: 1.3; letter-spacing: -.015em; margin: 0 0 6px; }
p { text-wrap: pretty; }
.lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--text-2); max-width: 640px; margin: 0; }
.muted { color: var(--text-2); }
.grad-text { background: var(--grad); background-size: 160% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheen 10s ease-in-out infinite alternate; }
@keyframes sheen { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 5px 12px 5px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand);
  background: color-mix(in srgb, var(--brand) 11%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent); }
.eyebrow .live { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; animation: live 2.2s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); } 70%, 100% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); } }
.kicker { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.kicker span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 12px;
  font: 600 15px/1 var(--font); letter-spacing: -.01em; text-decoration: none; white-space: nowrap; cursor: pointer;
  color: var(--text); background: var(--glass); border: 1px solid var(--hairline); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform .25s var(--ease), box-shadow .3s var(--ease), border-color .25s; }
.btn:hover { border-color: color-mix(in srgb, var(--text) 24%, transparent); transform: translateY(-1px); }
.btn.primary { color: var(--on-ink); background: var(--ink); border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 10px 30px -10px rgba(155, 155, 245, .75), 0 6px 40px -14px rgba(240, 154, 126, .65); }
.btn.primary:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 14px 40px -10px rgba(155, 155, 245, .9), 0 8px 50px -12px rgba(240, 154, 126, .8); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn small { font-weight: 500; opacity: .62; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Glass cards: gradient hairline border, pointer-following glow (motion.js sets --mx/--my) ---------- */
.glass { position: relative; isolation: isolate; border-radius: 20px; background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--shadow), inset 0 1px 0 var(--glass-hi); }
.glass::before { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; padding: var(--edge-w, 1px); pointer-events: none;
  background: var(--edge, var(--glass-edge));
  -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); }
.glass::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--brand) 16%, transparent), transparent 60%);
  transition: opacity .4s var(--ease); }
.glass:hover::after { opacity: 1; }

/* ---------- Sections ---------- */
.section { padding-top: clamp(80px, 11vw, 140px); }
.section-head { max-width: 760px; margin: 0 auto 52px; text-align: center; }
.section-head .lede { margin: 0 auto; }

/* ---------- Legal pages ---------- */
.legal { max-width: 800px; padding-top: 56px; }
.legal-card { padding: clamp(24px, 5vw, 56px); }
.legal h1 { font-size: clamp(38px, 6vw, 58px); margin-bottom: 10px; }
.legal .updated { margin: 0 0 28px; font-size: 13px; color: var(--text-3); }
.legal h2 { font-size: 21px; letter-spacing: -.02em; margin: 36px 0 10px; padding-top: 28px; border-top: 1px solid var(--hairline); }
.legal p, .legal li { color: var(--text-2); }
.legal b { color: var(--text); font-weight: 600; }
.legal ul { padding-left: 0; list-style: none; margin: 12px 0; }
.legal li { position: relative; padding-left: 22px; margin: 10px 0; }
.legal li::before { content: ""; position: absolute; left: 3px; top: .68em; width: 7px; height: 7px; border-radius: 50%; background: var(--grad-edge); }

/* ---------- Small centred pages (checkout) ---------- */
.center-main { display: grid; place-items: center; padding: 72px 16px 0; }
.center-card { width: 100%; max-width: 480px; padding: 44px 32px; text-align: center; }
.center-card h1 { font-size: clamp(32px, 6vw, 42px); margin: 22px 0 10px; }
.center-card p { margin: 0 0 26px; color: var(--text-2); }
.status-icon { width: 56px; height: 56px; margin: 0 auto; display: grid; place-items: center; border-radius: 16px; color: #fff; background: var(--grad-edge);
  box-shadow: 0 12px 34px -10px rgba(155, 155, 245, .8); }
.status-icon.quiet { background: var(--glass-strong); color: var(--text-2); box-shadow: var(--shadow); }

/* ---------- Footer ---------- */
.footer { margin-top: clamp(88px, 11vw, 150px); border-top: 1px solid var(--hairline); background: color-mix(in srgb, var(--bg) 60%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.footer-top { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; padding-top: 56px; padding-bottom: 40px; }
.footer-top p { margin: 14px 0 0; color: var(--text-3); font-size: 14px; max-width: 290px; }
.footer h4, .footer .fh { margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: normal; line-height: 1.6; color: var(--text); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer ul a { color: var(--text-2); text-decoration: none; font-size: 14px; transition: color .2s; overflow-wrap: anywhere; }
.footer ul a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-top: 20px; padding-bottom: 32px;
  border-top: 1px solid var(--hairline); font-size: 13px; color: var(--text-3); }
.footer-bottom .enc { display: inline-flex; align-items: center; gap: 8px; }
.footer-bottom .enc::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 10px #4ade80; }
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-top > :first-child { grid-column: 1 / -1; } }

/* ---------- Download page ---------- */
.dl { max-width: 600px; padding-top: 64px; text-align: center; }
.dl h1 { font-size: clamp(42px, 8vw, 68px); margin-bottom: 14px; }
.dl .lede { margin: 0 auto; }
.dl-card { padding: clamp(22px, 5vw, 40px); margin-top: 40px; text-align: left; }
.dl .buttons { display: grid; gap: 10px; color: var(--text-2); text-align: center; }
.dl .buttons .btn { height: 54px; width: 100%; justify-content: space-between; padding: 0 18px; border-radius: 14px; }
.dl ol { counter-reset: s; list-style: none; margin: 28px 0 0; padding: 24px 0 0; border-top: 1px solid var(--hairline); display: grid; gap: 12px; color: var(--text-2); font-size: 15px; }
.dl ol li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; }
.dl ol li::before { content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: 12px; font-weight: 650;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 13%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent); }
.dl-meta { margin-top: 22px; font-size: 13px; color: var(--text-3); }
.dl-version { margin: 0 0 14px; font-size: 13px; color: var(--text-3); text-align: center; }
.dl-item { display: grid; gap: 6px; }
.dl-file, .dl-note { margin: 0 4px 4px; font-size: 12px; line-height: 1.5; color: var(--text-3); text-align: left; }
.dl-file code { font-family: var(--mono); font-size: 11px; overflow-wrap: anywhere; user-select: all; }
/* Room kept for what downloads.json fills in, so the page doesn't jump when it arrives. */
.dl .is-pending { visibility: hidden; }
.dl-note { color: var(--text-2); }
.dl-web { margin-top: 22px; font-size: 15px; color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
