/* ═══════════════════════════════════════════════════════════════════
   GRATUS.CC · tokens v4 — QUIET LIGHT.
   A dark violet ground. One hue at four alphas. Ink is solid and carries hue,
   never grey, never alpha. Borders are hairlines; depth is inner light, never a
   drop shadow. Display type is large at weight 500. Body type never shrinks.
   One figure per screen carries the meaning. One gold per page marks the act.
   ═══════════════════════════════════════════════════════════════════ */
:root {
  color-scheme: dark;
  --ground: #030014; --chrome: rgba(6, 3, 23, .96); --raise: rgba(255, 255, 255, .02); --raise-2: rgba(255, 255, 255, .04); --wash: rgba(109, 72, 255, .04); --scrim: rgba(3, 0, 20, .62);
  --hue: #6D48FF; --hue-04: rgba(109, 72, 255, .04); --hue-16: rgba(109, 72, 255, .16); --hue-48: rgba(109, 72, 255, .48); --hue-76: rgba(109, 72, 255, .76);
  --action: #5046E4; --violet-text: #9382FF;
  --ink: #F4F0FF; --ink-2: #ECE7FF; --ink-3: #D9D2FF;
  --gold: #E8C46B; --on-gold: #3A2B06;
  --hair: rgba(255, 255, 255, .05); --hair-2: rgba(255, 255, 255, .10); --hair-hue: rgba(196, 187, 255, .10);
  --lit-rest: inset 0 0 24px rgba(255, 255, 255, .04);
  --lit-hover: inset 0 0 24px rgba(255, 255, 255, .06);
  --lit-below: inset 0 -7px 11px rgba(164, 143, 255, .12);
  --r-5: 5px; --r-6: 6px; --r-8: 8px; --r-16: 16px; --r-24: 24px;

  /* the eight families — dots, hairlines and halos only, never ink */
  --f-joy: #FFC531; --f-calm: #35E5FF; --f-love: #FF3D8F; --f-hope: #FF7A1F;
  --f-sad: #3D6BFF; --f-afraid: #8A3BFF; --f-angry: #FF5A3D; --f-tired: #9A8CFF; --f-quiet: #E6E2FF;

  --display: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;

  --t-fast: 200ms; --t: 300ms; --ease: cubic-bezier(.22, .61, .36, 1);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; background: var(--ground); }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; letter-spacing: normal; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: normal; margin: 0; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(34px, 9.4vw, 44px); line-height: 1.14; }
h2 { font-size: 28px; line-height: 36px; }
h3 { font-size: 20px; line-height: 28px; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .2em; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: normal; }
button { cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--violet-text); outline-offset: 3px; border-radius: var(--r-6); }
img, svg, canvas, video { display: block; max-width: 100%; }
::selection { background: var(--hue-48); }
::-webkit-scrollbar { width: 0; height: 0; }

/* ink roles — all solid, all above 7:1 on the ground */
.lead { font-size: 18px; line-height: 28px; color: var(--ink-2); }
.body { font-size: 16px; line-height: 24px; color: var(--ink-2); }
.cap { font-size: 14px; line-height: 20px; color: var(--ink-3); }
.label { font-size: 13px; line-height: 16px; font-weight: 500; color: var(--violet-text); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.emoji { font-family: var(--emoji); line-height: 1; }
.gold-ink { color: var(--gold); }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* surfaces: three tones within 2% of the ground; separation is hairline + inner light */
.panel { background: var(--raise); border: 1px solid var(--hair); border-radius: var(--r-16); box-shadow: var(--lit-rest); }
.panel.lit { box-shadow: var(--lit-rest), var(--lit-below); border-color: var(--hair-2); }
.hairline { height: 1px; background: var(--hair); border: 0; margin: 0; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-6); font-family: var(--body); font-weight: 500; font-size: 15px; line-height: 20px; color: var(--ink); background: var(--raise-2); border: 1px solid var(--hair-2); box-shadow: var(--lit-rest); transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); user-select: none; -webkit-user-select: none; touch-action: manipulation; text-decoration: none; }
.btn:hover, .btn:focus-visible { background: var(--hue-16); border-color: var(--hair-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.solid { background: var(--action); border-color: transparent; color: #fff; }
.btn.solid:hover { background: #5C52F0; }
.btn.gold { background: var(--gold); border-color: transparent; color: var(--on-gold); font-weight: 600; }
.btn.gold:hover { background: #F0D07E; }
.btn.quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--violet-text); padding: 0 8px; }
.btn.quiet:hover { background: var(--hue-04); transform: none; }
.btn.wide { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: var(--r-5); font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink-2); background: var(--raise); border: 1px solid var(--hair); transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); white-space: nowrap; }
.chip.on { background: var(--hue-16); border-color: var(--hue-48); color: var(--ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.field { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-8); color: var(--ink); background: var(--raise); border: 1px solid var(--hair-2); font-size: 16px; line-height: 24px; resize: none; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.field::placeholder { color: var(--violet-text); }
.field:focus { outline: none; border-color: var(--hue-48); box-shadow: var(--lit-rest); }

/* the emoji orb: an emoji inside a breath of its family's light */
.orb { position: relative; display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; font-family: var(--emoji); font-size: 28px; line-height: 1; color: var(--ink); background: var(--raise); border: 1px solid var(--hair); box-shadow: var(--lit-rest); transition: transform var(--t) var(--ease), border-color var(--t-fast) var(--ease); flex: none; }
.orb::before { content: ""; position: absolute; inset: -1px; border-radius: 50%; background: radial-gradient(circle at 50% 60%, color-mix(in oklab, var(--h, #6D48FF) 22%, transparent), transparent 70%); pointer-events: none; }
.orb > * { position: relative; }
.orb.on { border-color: var(--hue-48); box-shadow: var(--lit-hover), 0 0 0 1px var(--hue-16); }
.orb.sm { width: 40px; height: 40px; font-size: 20px; }
.orb.lg { width: 84px; height: 84px; font-size: 44px; }
.orb.xl { width: 128px; height: 128px; font-size: 68px; }
.orb.empty { color: var(--violet-text); font-family: var(--display); font-weight: 500; font-size: 24px; }

/* the seed mark from the logo: white, small, the sign of keeping */
.seed-mark { display: block; fill: var(--ink); width: 18px; height: 18px; }

/* motion: 200 and 300, fade and slide, nothing else */
/* choreography runs only under html.anim, and html.landed lands everything: text never waits on motion */
html.anim:not(.landed) .in { opacity: 0; transform: translateY(12px); animation: rise var(--t) var(--ease) forwards; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes breathe-light { 0%, 100% { opacity: .82; } 50% { opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } html.anim .in { opacity: 1; transform: none; animation: none; } }
@media (forced-colors: active) { .panel, .btn, .chip, .orb, .field { border: 1px solid CanvasText; } }
