/* Davyom — one stylesheet for index.html and 404.html.
   Fonts are self-hosted subsets (see /fonts/OFL.txt); nothing loads from a CDN.
   Theme: follows prefers-color-scheme until the toggle stores a choice,
   which theme.js writes to <html data-theme>. */

@font-face {
  font-family: "Rozha One";
  src: url("/fonts/rozha-one.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Mukta";
  src: url("/fonts/mukta-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Mukta";
  src: url("/fonts/mukta-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* ── tokens: light (parchment) ── */
:root {
  color-scheme: light;
  --bg: #f5eee2;
  --surface: #fbf6ee;
  --text: #33241d;
  --muted: #5e4a3e;
  --accent: #8e2b3a;
  --ink: #5c1a22;
  --gold: #b8862a;
  --line: rgba(51, 36, 29, 0.16);
  --bloom: rgba(200, 120, 124, 0.24);
  --bloom-2: rgba(184, 134, 42, 0.12);
  --orbit-opacity: 0.55;
  --card-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 22px 44px -28px rgba(92, 26, 34, 0.38);
  --sun: none;
  --moon: block;

  --font-display: "Rozha One", "Iowan Old Style", Georgia, serif;
  --font-body: "Mukta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --edge: clamp(16px, 5vw, 72px);
}

/* ── tokens: dark (warm charcoal) — once for the system setting, once for the toggle ── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1a1715;
    --surface: #24201d;
    --text: #efe6da;
    --muted: #c4b6a6;
    --accent: #eb9aa4;
    --ink: #f3e7d3;
    --gold: #e2bd6a;
    --line: rgba(239, 230, 218, 0.14);
    --bloom: rgba(128, 34, 48, 0.42);
    --bloom-2: rgba(226, 189, 106, 0.06);
    --orbit-opacity: 0.42;
    --card-shadow: 0 22px 44px -28px rgba(0, 0, 0, 0.8);
    --sun: block;
    --moon: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1715;
  --surface: #24201d;
  --text: #efe6da;
  --muted: #c4b6a6;
  --accent: #eb9aa4;
  --ink: #f3e7d3;
  --gold: #e2bd6a;
  --line: rgba(239, 230, 218, 0.14);
  --bloom: rgba(128, 34, 48, 0.42);
  --bloom-2: rgba(226, 189, 106, 0.06);
  --orbit-opacity: 0.42;
  --card-shadow: 0 22px 44px -28px rgba(0, 0, 0, 0.8);
  --sun: block;
  --moon: none;
}

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 720px at 88% -200px, var(--bloom), transparent 62%),
    radial-gradient(900px 640px at -14% 110%, var(--bloom-2), transparent 60%),
    var(--bg);
  background-color: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-body);
  text-wrap: pretty;
}
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
img, svg { display: block; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--edge); }

/* ── top bar ── */
.top {
  position: relative; z-index: 2; /* above the orbit */
  display: flex; align-items: center; justify-content: space-between; padding-block: 20px;
}
.mark { display: inline-flex; border-radius: 8px; }
.mark img { width: 34px; height: 34px; }
.toggle {
  width: 40px; height: 40px; padding: 0;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--text); cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.toggle[hidden] { display: none; }
.toggle:hover { border-color: var(--accent); color: var(--accent); }
.toggle svg { width: 18px; height: 18px; }
.toggle .i-sun { display: var(--sun); }
.toggle .i-moon { display: var(--moon); }

/* ── hero ── */
main { flex: 1; overflow-x: clip; } /* the orbit may hang past the edge; never scroll sideways */
.hero {
  position: relative;
  padding-block: clamp(40px, 9vh, 112px) clamp(48px, 9vh, 104px);
}
.hero > :not(.orbit) { position: relative; z-index: 1; }
.hero h1 { margin: 0; line-height: 0; }
.wm { width: min(100%, 500px); height: auto; margin-left: -0.4%; }
.wm-ink { fill: var(--ink); }
.wm-gold { fill: var(--gold); }
.soon {
  margin: clamp(22px, 3vw, 32px) 0 0;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1;
  color: var(--accent);
}
.lede {
  margin: 14px 0 0; max-width: 34ch;
  font-size: clamp(18px, 2vw, 21px); line-height: 1.55;
  color: var(--muted);
}

/* the orbit: decorative, drawn in gold hairlines, turning very slowly */
.orbit {
  position: absolute; z-index: 0; top: 50%; right: -3%;
  width: min(40vw, 460px); height: auto;
  transform: translateY(-50%);
  color: var(--gold); opacity: var(--orbit-opacity);
  pointer-events: none;
}
.orbit .spin { transform-origin: 0 0; animation: spin 300s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .orbit .spin { animation: none; } }

/* ── the product ── */
.product { padding-bottom: clamp(56px, 10vh, 112px); }
.kicker {
  display: flex; align-items: center; gap: 14px;
  max-width: 600px; margin: 0 0 18px;
  font: 600 13px/1.4 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.kicker::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.card {
  position: relative;
  display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center;
  max-width: 600px; padding: 22px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.15s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.card-logo { width: 96px; height: 96px; border-radius: 20px; }
.card h3 {
  margin: 0;
  font-family: var(--font-display); font-weight: 400;
  font-size: 30px; line-height: 1.1; color: var(--ink);
}
.card .tag { margin: 6px 0 0; font-size: 16px; line-height: 1.5; color: var(--text); }
.card .tag .sep { color: var(--gold); padding-inline: 2px; }
.card .desc { margin: 2px 0 0; font-size: 16px; line-height: 1.5; color: var(--muted); }
.card-link { display: inline-block; margin-top: 10px; font-weight: 600; font-size: 16px; }
/* the whole card is the link's hit area; the link alone carries the name */
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

/* ── footer ── */
.foot { padding-block: 0 28px; }
.foot-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px;
  padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 15px; line-height: 1.6; color: var(--muted);
}
.foot-row p { margin: 0; }

/* ── 404 ── */
.lost .soon { margin-top: 0; font-size: clamp(34px, 4.6vw, 52px); }
.lost .lede { max-width: 40ch; margin-top: 26px; }
.lost .home { display: inline-block; margin-top: 22px; font-weight: 600; }

/* ── narrow screens ── */
@media (max-width: 760px) {
  /* behind the wordmark only, and faint: text crossing a line must stay well above 4.5:1 */
  .orbit {
    top: -40px; right: -36%; transform: none;
    width: 88vw; opacity: calc(var(--orbit-opacity) * 0.4);
  }
  .hero { padding-block: 72px 56px; }
}
@media (max-width: 480px) {
  .card { gap: 16px; padding: 18px; align-items: start; }
  .card-logo { width: 64px; height: 64px; border-radius: 14px; }
  .card h3 { font-size: 26px; }
  .card .tag, .card .desc, .card-link { font-size: 15.5px; }
}
@media (max-width: 340px) {
  .card { grid-template-columns: 1fr; }
}
