/* ==========================================================================
   abbott.cloud — cover page
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --bg: #05060a;
  --ink: #f4f5f8;
  --ink-2: rgb(244 245 248 / .72);
  --ink-3: rgb(244 245 248 / .48);
  --line: rgb(255 255 255 / .09);
  --line-2: rgb(255 255 255 / .16);
  --glass: rgb(14 16 24 / .42);
  --glass-hi: rgb(255 255 255 / .06);

  /* Palette tracks the shader; app.js updates these on reshuffle */
  --c1: #9ef0ff;
  --c2: #a78bfa;
  --c3: #ff8fb1;

  --ok: #5af0a0;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --gutter: clamp(16px, 4vw, 48px);
  --radius: 20px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

@property --c1 { syntax: "<color>"; inherits: true; initial-value: #9ef0ff; }
@property --c2 { syntax: "<color>"; inherits: true; initial-value: #a78bfa; }
@property --c3 { syntax: "<color>"; inherits: true; initial-value: #ff8fb1; }
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root { transition: --c1 1.6s var(--ease-out), --c2 1.6s var(--ease-out), --c3 1.6s var(--ease-out); }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}

::selection { background: color-mix(in oklab, var(--c2) 55%, transparent); color: #fff; }

a { color: inherit; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--font-mono); font-feature-settings: "zero", "tnum"; letter-spacing: -.01em; }
.dim { color: var(--ink-3); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--c1); outline-offset: 3px; border-radius: 8px; }

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  padding: 10px 14px; border-radius: 10px;
  background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 600;
  transform: translateY(-150%); transition: transform .2s var(--ease-out);
}
.skip:focus { transform: none; }

/* --------------------------------------------------------------------------
   Background layers
   -------------------------------------------------------------------------- */

#sky, .sky-fallback, .veil, .grid, .grain {
  position: fixed; inset: 0; pointer-events: none;
}

#sky {
  width: 100%; height: 100%;
  z-index: -4;
  opacity: 0;
  transition: opacity 1.8s ease;
}
.gl-ready #sky { opacity: 1; }

.sky-fallback {
  z-index: -5;
  background:
    radial-gradient(60% 50% at 20% 25%, color-mix(in oklab, var(--c1) 38%, transparent), transparent 70%),
    radial-gradient(55% 45% at 80% 30%, color-mix(in oklab, var(--c2) 42%, transparent), transparent 70%),
    radial-gradient(70% 60% at 60% 90%, color-mix(in oklab, var(--c3) 26%, transparent), transparent 70%),
    var(--bg);
  filter: saturate(1.1);
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift {
  to { transform: scale(1.15) translate3d(-2%, 2%, 0) rotate(2deg); }
}

/* Darkens the lower half so text and tiles stay legible over any palette */
.veil {
  z-index: -3;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 40%, rgb(5 6 10 / .55) 100%),
    linear-gradient(to bottom, rgb(5 6 10 / .25), transparent 30%, transparent 55%, rgb(5 6 10 / .82));
}

.grid {
  z-index: -2;
  background-image:
    linear-gradient(to right, rgb(255 255 255 / .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / .045) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: calc(50% + 36px) 0;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 75%);
}

.grain {
  z-index: 50;
  opacity: .07;
  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%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(20px, env(safe-area-inset-top)) var(--gutter) 0;
  animation: fade-down 1s .1s var(--ease-out) backwards;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 550; letter-spacing: -.02em;
}
.brand-mark { width: 30px; height: 30px; color: var(--ink); }

.top-right { display: flex; align-items: center; gap: 12px; }
.top-link {
  padding: 8px 12px; border-radius: 999px;
  font-size: 14px; line-height: 1; color: var(--ink-2); text-decoration: none;
  transition: background .2s, color .2s;
}
.top-link:hover { background: rgb(255 255 255 / .06); color: var(--ink); }

.clock {
  margin: 0;
  display: inline-flex; align-items: baseline; gap: 8px;
  font-size: 13px; color: var(--ink-2);
}
.clock-label { color: var(--ink-3); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; }

.kbd-btn {
  appearance: none; border: 0; background: none; padding: 0; cursor: pointer;
  border-radius: 10px;
}
kbd {
  display: inline-flex; align-items: center; gap: 2px;
  min-width: 1.6em; justify-content: center;
  padding: 4px 8px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1;
  color: var(--ink-2);
  background: var(--glass-hi);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 8px;
}
.kbd-btn kbd { padding: 7px 10px; transition: background .2s, color .2s, transform .2s; }
.menu-ico {
  display: none; place-items: center;
  width: 40px; height: 34px;
  background: var(--glass-hi); border: 1px solid var(--line-2); border-radius: 10px;
}
.menu-ico svg { width: 18px; height: 18px; fill: var(--ink-2); }
@media (hover: none) and (pointer: coarse) {
  .kbd-btn .kbd-keys { display: none; }
  .menu-ico { display: grid; }
}
.kbd-btn:hover kbd { background: rgb(255 255 255 / .12); color: var(--ink); }
.kbd-btn:active kbd { transform: translateY(1px); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(40px, 8vh, 96px) var(--gutter) clamp(32px, 6vh, 64px);
  min-width: 0;
}

.eyebrow {
  margin: 0 0 clamp(16px, 3vh, 28px);
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px;
  font-size: 13px; color: var(--ink-2);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
          backdrop-filter: blur(14px) saturate(1.4);
}
.eyebrow .sep { color: var(--ink-3); }

.pulse {
  position: relative; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 12px var(--ok);
}
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--ok);
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(3.2); opacity: 0; } }

.title {
  margin: 0;
  font-size: clamp(3.6rem, 15.5vw, 15.5rem);
  line-height: .86;
  letter-spacing: -.055em;
  font-weight: 640;
  white-space: nowrap;
  user-select: none;
  /* optical nudge so the bowl of the "a" lines up with the text below */
  margin-left: -.04em;
}
.word { display: inline-block; }
.word-sans { font-variation-settings: "wght" 640; }
.word-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.02em;
  padding-right: .08em; /* room for the italic overhang under background-clip */
}

.title .ch {
  display: inline-block;
  animation: rise 1.4s var(--ease-out) backwards;
  will-change: transform, filter, opacity;
}
.word-serif .ch {
  background: linear-gradient(100deg, var(--c1) 0%, var(--c2) 45%, var(--c3) 100%);
  background-size: 600% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
/* Each glyph shows its own slice of a shared gradient */
.word-serif .ch:nth-child(1) { background-position: 0% 0; }
.word-serif .ch:nth-child(2) { background-position: 20% 0; }
.word-serif .ch:nth-child(3) { background-position: 40% 0; }
.word-serif .ch:nth-child(4) { background-position: 60% 0; }
.word-serif .ch:nth-child(5) { background-position: 80% 0; }
.word-serif .ch:nth-child(6) { background-position: 100% 0; }

.word-sans .ch:nth-child(1)  { animation-delay: .20s; }
.word-sans .ch:nth-child(2)  { animation-delay: .25s; }
.word-sans .ch:nth-child(3)  { animation-delay: .30s; }
.word-sans .ch:nth-child(4)  { animation-delay: .35s; }
.word-sans .ch:nth-child(5)  { animation-delay: .40s; }
.word-sans .ch:nth-child(6)  { animation-delay: .45s; }
.word-serif .ch:nth-child(1) { animation-delay: .55s; }
.word-serif .ch:nth-child(2) { animation-delay: .60s; }
.word-serif .ch:nth-child(3) { animation-delay: .65s; }
.word-serif .ch:nth-child(4) { animation-delay: .70s; }
.word-serif .ch:nth-child(5) { animation-delay: .75s; }
.word-serif .ch:nth-child(6) { animation-delay: .80s; }

@keyframes rise {
  from { opacity: 0; transform: translate3d(0, .35em, 0) rotate(6deg); filter: blur(18px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

/* Hover: letters lift individually (set by app.js on pointer devices) */
.title .ch.lift { transform: translate3d(0, -.06em, 0); transition: transform .5s var(--ease-spring); }
.title .ch.settled { animation: none; transition: transform .9s var(--ease-out); }

.lede {
  margin: clamp(20px, 3.5vh, 36px) 0 0;
  max-width: 46ch;
  font-size: clamp(1.1rem, 1.9vw, 1.6rem);
  line-height: 1.35;
  letter-spacing: -.015em;
  color: var(--ink-2);
  text-wrap: pretty;
}
.rot-line { display: block; min-height: 1.35em; }
.rotator {
  color: var(--ink);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.12em;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.rotator .glyph-scramble { font-family: var(--font-mono); font-style: normal; font-size: .82em; color: var(--c1); }
.caret {
  display: inline-block; width: 2px; height: .95em; margin-left: 3px;
  vertical-align: -.1em;
  background: var(--c1);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Visitor's IP address */
.ip {
  display: inline-flex; align-items: center; flex-wrap: wrap;
  gap: 8px 12px;
  align-self: flex-start;
  max-width: 100%;
  margin-top: clamp(18px, 3vh, 28px);
  padding: 8px 8px 8px 10px;
  background: var(--glass);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
          backdrop-filter: blur(14px) saturate(1.4);
  animation: fade-up .9s var(--ease-out) backwards;
}
.ip[hidden] { display: none; }
.ip-ver {
  padding: 3px 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  color: #05060a;
  background: linear-gradient(100deg, var(--c1), color-mix(in oklab, var(--c2) 70%, white));
  border-radius: 7px;
}
.ip-label { font-size: 13px; color: var(--ink-3); }
.ip-addr {
  min-width: 0;
  font-family: var(--font-mono);
  font-feature-settings: "zero", "tnum";
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
  user-select: all;
}
.ip-copy {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--glass-hi);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.ip-copy:hover { background: rgb(255 255 255 / .12); color: var(--ink); }
.ip-copy svg { width: 14px; height: 14px; }

.actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: clamp(20px, 3.5vh, 40px);
}

.btn {
  --mx: 0px; --my: 0px;
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 20px;
  border-radius: 999px;
  font-size: 15px; font-weight: 520; letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  transform: translate3d(var(--mx), var(--my), 0);
  transition: transform .5s var(--ease-out), background .3s, border-color .3s, box-shadow .3s;
}
.btn svg { width: 18px; height: 18px; }
.btn .arrow { transition: transform .4s var(--ease-spring); }
.btn:hover .arrow { transform: translate(2px, -2px); }

.btn-primary {
  color: #0a0b10;
  background: var(--ink);
  border: 0;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .4) inset, 0 10px 40px -10px color-mix(in oklab, var(--c2) 80%, transparent);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgb(255 255 255 / .6) inset, 0 14px 50px -8px color-mix(in oklab, var(--c1) 80%, transparent); }

.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--line-2);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
          backdrop-filter: blur(14px) saturate(1.4);
}
.btn-ghost:hover { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .28); }

.swatch {
  width: 16px; height: 16px; border-radius: 50%;
  background: conic-gradient(from var(--angle), var(--c1), var(--c2), var(--c3), var(--c1));
  animation: spin 6s linear infinite;
  box-shadow: 0 0 10px color-mix(in oklab, var(--c2) 70%, transparent);
}
@keyframes spin { to { --angle: 360deg; } }

/* --------------------------------------------------------------------------
   Tiles
   -------------------------------------------------------------------------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 var(--gutter);
}

.tile {
  --x: 50%; --y: 50%;
  position: relative;
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 18px 20px 20px;
  text-align: left;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
          backdrop-filter: blur(20px) saturate(1.5);
  overflow: hidden;
  isolation: isolate;
  transition: border-color .3s, transform .5s var(--ease-out);
}
/* Cursor spotlight */
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(420px circle at var(--x) var(--y), rgb(255 255 255 / .09), transparent 45%);
  opacity: 0; transition: opacity .4s;
}
/* Spotlight on the border only */
.tile::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: radial-gradient(260px circle at var(--x) var(--y), color-mix(in oklab, var(--c1) 85%, white), transparent 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);
  opacity: 0; transition: opacity .4s;
  pointer-events: none;
}
.tiles:hover .tile::before, .tiles:hover .tile::after { opacity: 1; }

.tile-btn { cursor: pointer; font: inherit; color: inherit; }
.tile-btn:hover { transform: translateY(-2px); }
.tile-btn:active { transform: translateY(0) scale(.99); }

.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3);
}
.tile-meta { font-size: 12px; color: var(--ink-3); }
.tile-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3);
  transition: background .4s, box-shadow .4s;
}
.tile-dot.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

.tile-big {
  margin: 4px 0 0;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -.035em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#tile-sky .tile-big { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.unit { font-size: .5em; color: var(--ink-3); letter-spacing: 0; }
.tile-sub { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 22px var(--gutter) max(22px, env(safe-area-inset-bottom));
  font-size: 12.5px; color: var(--ink-3);
  animation: fade-up 1s 1.3s var(--ease-out) backwards;
}
.foot p { margin: 0; }

/* --------------------------------------------------------------------------
   Entrance
   -------------------------------------------------------------------------- */

.reveal { animation: fade-up 1.2s var(--ease-out) backwards; }
.eyebrow.reveal { animation-delay: .05s; }
.lede.reveal    { animation-delay: .85s; }
.actions.reveal { animation-delay: 1s; }
.tiles .reveal:nth-child(1) { animation-delay: 1.1s; }
.tiles .reveal:nth-child(2) { animation-delay: 1.18s; }
.tiles .reveal:nth-child(3) { animation-delay: 1.26s; }

@keyframes fade-up   { from { opacity: 0; transform: translate3d(0, 16px, 0); filter: blur(6px); } }
@keyframes fade-down { from { opacity: 0; transform: translate3d(0, -12px, 0); } }

/* --------------------------------------------------------------------------
   Command palette
   -------------------------------------------------------------------------- */

.palette {
  width: min(560px, calc(100vw - 32px));
  max-height: min(520px, calc(100svh - 32px));
  margin: 14vh auto auto;
  padding: 0;
  color: var(--ink);
  background: rgb(14 16 24 / .72);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: 0 40px 120px -20px rgb(0 0 0 / .8), 0 0 0 1px rgb(0 0 0 / .4);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
          backdrop-filter: blur(28px) saturate(1.6);
  overflow: hidden;
}
.palette::backdrop {
  background: rgb(3 4 8 / .5);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
}
.palette[open] { animation: pop .35s var(--ease-out); }
.palette[open]::backdrop { animation: fade .3s ease; }
@keyframes pop  { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes fade { from { opacity: 0; } }

.palette-inner { display: flex; flex-direction: column; max-height: inherit; }

.palette-search {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
}
.palette-search svg { width: 18px; height: 18px; flex: none; }
.palette-search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 16px;
}
.palette-search input::placeholder { color: var(--ink-3); }

.palette-list {
  list-style: none; margin: 0; padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.palette-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14.5px;
  color: var(--ink-2);
  cursor: pointer;
  scroll-margin: 8px;
}
.palette-list li .ico {
  display: grid; place-items: center;
  width: 28px; height: 28px; flex: none;
  border-radius: 8px;
  background: var(--glass-hi); border: 1px solid var(--line);
  font-size: 14px;
}
.palette-list li .hint { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.palette-list li[aria-selected="true"] {
  color: var(--ink);
  background: linear-gradient(90deg, color-mix(in oklab, var(--c2) 22%, transparent), rgb(255 255 255 / .04));
  box-shadow: 0 0 0 1px rgb(255 255 255 / .08) inset;
}
.palette-list .empty { color: var(--ink-3); cursor: default; justify-content: center; }

.palette-foot {
  display: flex; gap: 18px;
  margin: 0; padding: 10px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-3);
}
.palette-foot kbd { padding: 3px 6px; font-size: 11px; margin-right: 4px; }

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 60;
  padding: 10px 16px;
  font-size: 14px;
  background: rgb(14 16 24 / .8);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(16px);
          backdrop-filter: blur(16px);
  transform: translate(-50%, 24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .5s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  #tile-sky { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .clock-label { display: none; }
  .hero { padding-top: 56px; }
  .title { letter-spacing: -.05em; }
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .tile { padding: 16px 18px 18px; }
  .btn { height: 46px; padding: 0 18px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .grid { background-size: 48px 48px; }
}

/* Short landscape screens: keep everything on one page */
@media (min-width: 861px) and (max-height: 760px) {
  .hero { padding-top: 24px; padding-bottom: 24px; }
  .title { font-size: clamp(3.6rem, 22vh, 15.5rem); }
  .ip { margin-top: 14px; }
  .actions { margin-top: 16px; }
  .tile { padding: 14px 18px 16px; }
}

@media (hover: none) {
  .tiles .tile::before, .tiles .tile::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
  .caret { animation: none; }
}

@media (forced-colors: active) {
  .word-serif .ch { color: CanvasText; background: none; }
  #sky, .grain, .grid, .veil, .sky-fallback { display: none; }
}

/* --------------------------------------------------------------------------
   States toggled by app.js
   -------------------------------------------------------------------------- */

.paused .swatch, .paused .pulse::after, .paused .sky-fallback, .paused .caret { animation-play-state: paused; }

.zen .top, .zen .hero, .zen .tiles, .zen .foot { pointer-events: none; }
.grid, .veil { transition: opacity .8s; }
.zen .grid { opacity: 0; }
.zen .veil { opacity: .35; }
.zen, .zen body { cursor: none; }

/* 404 page: no tiles row */
.lost { grid-template-rows: auto 1fr auto; }

/* --------------------------------------------------------------------------
   Footer link, and the "How this site was made" page
   -------------------------------------------------------------------------- */

.foot-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot-link {
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / .25);
  text-underline-offset: 3px;
  transition: color .2s, text-decoration-color .2s;
}
.foot-link:hover { color: var(--ink); text-decoration-color: var(--c1); }

.doc { grid-template-rows: auto 1fr auto; }
.doc .veil { background: linear-gradient(to bottom, rgb(5 6 10 / .2), rgb(5 6 10 / .78) 45%, rgb(5 6 10 / .92)); }

.back-link {
  font-size: 14px; color: var(--ink-2); text-decoration: none;
  padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: background .2s, color .2s;
}
.back-link:hover { background: rgb(255 255 255 / .1); color: var(--ink); }

.doc-main {
  width: 100%; max-width: 860px;
  padding: clamp(40px, 9vh, 96px) var(--gutter) 56px;
  display: flex; flex-direction: column;
}
.doc-title {
  margin: 0;
  font-size: clamp(3rem, 10vw, 7rem);
  line-height: .92; letter-spacing: -.05em; font-weight: 640;
}
.serif-grad {
  font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em;
  padding-right: .06em;
  background: linear-gradient(100deg, var(--c1), var(--c2) 50%, var(--c3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.doc-lede {
  margin: clamp(18px, 3vh, 28px) 0 0; max-width: 40ch;
  font-size: clamp(1.15rem, 2vw, 1.45rem); line-height: 1.4; letter-spacing: -.015em;
  color: var(--ink-2); text-wrap: pretty;
}
.doc-main .reveal:nth-child(2) { animation-delay: .1s; }
.doc-main .reveal:nth-child(3) { animation-delay: .2s; }
.doc-main .reveal:nth-child(4) { animation-delay: .3s; }

.doc-body { margin-top: clamp(36px, 6vh, 64px); display: grid; gap: clamp(36px, 5vh, 52px); }
.doc-body h2 {
  margin: 0 0 14px;
  font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-2);
}
.doc-body h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.doc-body p, .doc-body li { font-size: 16.5px; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.doc-body p { margin: 0; max-width: 64ch; }
.doc-body a { color: var(--ink); text-decoration-color: var(--c1); text-underline-offset: 3px; }
.doc-body strong { color: var(--ink); font-weight: 600; }
.doc-body q { color: var(--ink); font-style: italic; }

.sources { margin: 0; display: grid; border-top: 1px solid var(--line); }
.sources > div {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 6px 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.sources dt { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.sources dd { margin: 0; min-width: 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); max-width: 60ch; }

.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.facts li {
  padding: 14px 18px 14px 42px; position: relative;
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.facts li::before {
  content: ""; position: absolute; left: 18px; top: 23px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 10px var(--ok);
}

@media (max-width: 640px) {
  .sources > div { grid-template-columns: 1fr; gap: 4px; }
}
