/* NOMUD WORK — the Soft UI of its app, nookd., in olive green and golden yellow: raised and recessed
   surfaces, glass for overlays only, spring motion. Saturation lives in the accent and the clay;
   surfaces stay low-key so the soft shadows read cleanly. */

:root {
  --app-bg: #E9ECD9;
  --surface: #E9ECD9;
  --surface-elevated: #F3F5E8;
  --surface-recessed: #DEE2C9;
  --text: #24301A;
  --text-2: #4A5636;
  --neon: #F2C230;
  --on-neon: #24301A;
  --hl: #FBFCF2;
  --sh: #BCC2A0;
  --gloss: rgba(255, 255, 250, 0.85);
  --gloss-strong: rgba(255, 255, 250, 0.9);
  --clay-base: #B9C384;
  --clay-low: #E8D27A;
  --clay-mid: #DFE3BC;
  --clay-high: #EFCB45;
  --clay-highlight: #FFF9E0;
  --clay-shade: #6C7A3C;
  --clay-name: #2E3B1A;
  --glass: rgba(243, 245, 232, 0.58);
  --glass-shadow: 0 10px 30px rgba(36, 48, 26, 0.16);
  --glow: rgba(242, 194, 48, 0.55);

  /* Soft UI shadows, as in nookd. (raised 9/18, raised-sm 4/10, recessed 6/12, recessed-sm 3/7). */
  --raised: 9px 9px 18px var(--sh), -9px -9px 18px var(--hl);
  --raised-sm: 4px 4px 10px var(--sh), -4px -4px 10px var(--hl);
  --recessed: inset 6px 6px 12px var(--sh), inset -6px -6px 12px var(--hl);
  --recessed-sm: inset 3px 3px 7px var(--sh), inset -3px -3px 7px var(--hl);
  --pop-text: 1px 1px 1px var(--hl), -1px -1px 1px rgba(108, 122, 60, 0.3);

  /* nookd.'s TactileMotion springs; site.js swaps these for exact linear() curves of the same springs. */
  --ease-press: cubic-bezier(0.34, 1.45, 0.64, 1);
  --dur-press: 0.45s;
  --ease-enter: cubic-bezier(0.22, 1.12, 0.36, 1);
  --dur-enter: 0.5s;

  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-card: 28px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --app-bg: #1F2918;
    --surface: #1F2918;
    --surface-elevated: #28331F;
    --surface-recessed: #19210F;
    --text: #EEF0DC;
    --text-2: #BCC6A0;
    --on-neon: #1F2918;
    --hl: #2B3722;
    --sh: #11170C;
    --gloss: rgba(255, 255, 240, 0.08);
    --gloss-strong: rgba(255, 255, 240, 0.12);
    --clay-base: #1C2515;
    --clay-low: #4A4521;
    --clay-mid: #38472A;
    --clay-high: #4D5E2F;
    --clay-highlight: #6A7D3C;
    --clay-shade: #070A04;
    --clay-name: #F2C230;
    --glass: rgba(40, 51, 31, 0.55);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    --glow: rgba(242, 194, 48, 0.4);
    --pop-text: 1px 1px 1px rgba(0, 0, 0, 0.4), -1px -1px 1px rgba(255, 255, 240, 0.04);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --app-bg: #1F2918;
  --surface: #1F2918;
  --surface-elevated: #28331F;
  --surface-recessed: #19210F;
  --text: #EEF0DC;
  --text-2: #BCC6A0;
  --on-neon: #1F2918;
  --hl: #2B3722;
  --sh: #11170C;
  --gloss: rgba(255, 255, 240, 0.08);
  --gloss-strong: rgba(255, 255, 240, 0.12);
  --clay-base: #1C2515;
  --clay-low: #4A4521;
  --clay-mid: #38472A;
  --clay-high: #4D5E2F;
  --clay-highlight: #6A7D3C;
  --clay-shade: #070A04;
  --clay-name: #F2C230;
  --glass: rgba(40, 51, 31, 0.55);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --glow: rgba(242, 194, 48, 0.4);
  --pop-text: 1px 1px 1px rgba(0, 0, 0, 0.4), -1px -1px 1px rgba(255, 255, 240, 0.04);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--app-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 12px; }
.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;
}
.wrap { width: min(1080px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Glass navigation (an overlay, so it's glass) ---------- */

.nav {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 20;
  translate: -50% 0;
  width: min(1080px, 100% - 24px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 20px;
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--gloss-strong), inset 0 0 0 1px var(--gloss);
}
.nav-name {
  font-weight: 900;
  font-size: 21px;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
}
.nav-name .minor { font-size: 0.6em; font-weight: 800; letter-spacing: 0.2em; color: var(--text-2); }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover { color: var(--text); background: var(--gloss); }

.theme-toggle {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-recessed) 70%, transparent);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
}
.theme-toggle button {
  width: 32px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform var(--dur-press) var(--ease-press);
}
.theme-toggle button:active { transform: scale(0.92); }
.theme-toggle button[aria-pressed="true"] {
  background: var(--surface-elevated);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}
.theme-toggle svg { width: 16px; height: 16px; }

@media (max-width: 640px) {
  .nav { padding-left: 16px; }
  .nav-links a { padding: 8px 9px; }
}
/* The hero's "Meet Nookd" covers it, and the full name needs the room. */
@media (max-width: 420px) {
  .nav-links a.optional { display: none; }
}

/* ---------- Buttons: raised Soft UI capsules that press in ---------- */

.button {
  --scale: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--raised-sm);
  transform: scale(var(--scale));
  transition: transform var(--dur-press) var(--ease-press), box-shadow 0.25s ease-out, background-color 0.2s;
}
.button:hover { text-decoration: none; }
.button:active { --scale: 0.96; box-shadow: var(--recessed-sm); }
.button.primary {
  color: var(--on-neon);
  background: var(--neon);
  box-shadow: var(--raised-sm), 0 0 0 0 var(--glow);
}
.button.primary:hover { box-shadow: var(--raised-sm), 0 0 22px 2px var(--glow); }
.button.primary:active { box-shadow: 0 0 0 0 var(--glow), inset 0 2px 8px rgba(0, 0, 0, 0.3); }
.button svg { width: 18px; height: 18px; }

/* ---------- Hero: the name rises out of the clay ---------- */

.hero {
  position: relative;
  min-height: max(640px, 100svh);
  display: grid;
  background: var(--clay-base);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}
.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: max(96px, 12svh) var(--gutter) 64px;
  pointer-events: none;
}
.hero-inner a, .hero-inner button { pointer-events: auto; }
.hero-square {
  width: min(420px, 80vw, 46svh);
  aspect-ratio: 1;
  flex: none;
}
/* Without WebGL, the icon stands in for the clay. */
.no-clay .hero-square {
  background: url("img/icon-512.png") center / cover;
  border-radius: 22.4%;
  box-shadow: var(--raised);
}
.lede {
  margin-top: clamp(20px, 4svh, 40px);
  font-size: clamp(26px, 4.2vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 18ch;
  text-shadow: var(--pop-text);
}
/* --text, not --text-2: the line sits on every clay plate, and only --text clears 4.5:1 on all. */
.hero .sub {
  margin-top: 14px;
  max-width: 34ch;
  font-size: clamp(17px, 2vw, 19px);
  font-weight: 500;
}
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 28px; }
.hint {
  margin-top: 26px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.6s ease-out, translate var(--dur-enter) var(--ease-enter);
}
.clay-touched .hint, .no-clay .hint { opacity: 0; translate: 0 6px; }
@media (prefers-reduced-motion: reduce) { .hint { display: none; } }

/* ---------- Sections ---------- */

.section { padding: clamp(72px, 12vw, 128px) 0; }
.eyebrow {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}
.section h2 {
  margin-top: 10px;
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 20ch;
  text-shadow: var(--pop-text);
}

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--raised);
  padding: clamp(22px, 3vw, 32px);
}

/* ---------- The app: one raised card ---------- */

.product {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(22px, 4vw, 44px);
  align-items: center;
  margin-top: clamp(36px, 5vw, 56px);
  padding: clamp(24px, 4vw, 44px);
}
.product-icon {
  width: clamp(112px, 16vw, 168px);
  aspect-ratio: 1;
  border-radius: 22.4%;
  box-shadow: var(--raised-sm);
  overflow: hidden;
}
.product-icon img { width: 100%; height: 100%; }
.product h2 { font-size: clamp(28px, 3.6vw, 36px); font-weight: 900; letter-spacing: -0.02em; }
.product .tagline { margin-top: 6px; font-size: 19px; font-weight: 700; }
.product .about { margin-top: 10px; max-width: 52ch; color: var(--text-2); }
.product .cta { justify-content: flex-start; margin-top: 22px; }
.product .links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 18px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.product .links a { text-decoration: none; }
.product .links a:hover { color: var(--text); }
.status {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-recessed);
  box-shadow: var(--recessed-sm);
}
@media (max-width: 600px) {
  .product { grid-template-columns: 1fr; }
}

/* ---------- Reveal: things rise out of the surface as they arrive ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(16px) scale(0.94);
  transition: opacity 0.36s ease-out, transform var(--dur-enter) var(--ease-enter);
}
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { transform: none; transition: opacity 0.2s ease-out; }
}

/* ---------- Closing band ---------- */

.band {
  position: relative;
  overflow: hidden;
  background: var(--clay-base);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 22%, #000 78%, transparent);
}
.band canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.band-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  padding: clamp(80px, 12vw, 140px) var(--gutter);
}
.band h2 { font-size: clamp(30px, 5vw, 50px); font-weight: 900; letter-spacing: -0.02em; text-shadow: var(--pop-text); }

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

.footer { padding: 40px 0 48px; color: var(--text-2); font-size: 15px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-right: auto; }
.footer a { text-decoration: none; font-weight: 600; }
.footer a:hover { color: var(--text); }

/* ---------- 404 ---------- */

.lost { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: var(--gutter); }
.lost h1 { font-size: clamp(44px, 9vw, 88px); font-weight: 900; color: var(--text); text-shadow: var(--pop-text); }
.lost p { margin: 12px 0 28px; color: var(--text-2); }
