/* Oddisle website.
   Ground + ink + one accent. All saturated colour belongs to the island, not the chrome.
   One family (Fredoka, self-hosted, SIL OFL) plus a system monospace for small labels. */

@font-face { font-family: 'Fredoka'; src: url('../assets/fonts/Fredoka_400Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('../assets/fonts/Fredoka_500Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('../assets/fonts/Fredoka_600SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;

  /* colour */
  --ground: #F2EADC;
  --ink-rgb: 43, 29, 20;
  --ink: rgb(var(--ink-rgb));
  --ink-quiet: rgba(var(--ink-rgb), 0.68);   /* lowest strength that still clears AA */
  --line: rgba(var(--ink-rgb), 0.14);
  --wash: rgba(var(--ink-rgb), 0.045);        /* faint fill for cards */
  --accent: #B4502B;
  --coin: #E9A23B;                            /* content colour: the coin itself */
  --card: #FBF7EF;                            /* the app card floating on the island */

  /* type */
  --sans: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;

  --t-hero: clamp(2.6rem, 1.4rem + 4.6vw, 5.4rem);
  --t-display: clamp(2.1rem, 1.3rem + 3vw, 3.6rem);
  --t-section: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem);
  --t-heading: 1.25rem;
  --t-lead: clamp(1.12rem, 1rem + 0.4vw, 1.3rem);
  --t-body: 1.0625rem;
  --t-caption: 0.94rem;
  --t-label: 0.72rem;
  --t-metric: clamp(2.6rem, 1.8rem + 2.8vw, 4.2rem);

  /* frame */
  --page-max: 1320px;
  --page-gutter: max(16px, 5vw);
  --radius: 14px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #17142A;
    --ink-rgb: 242, 234, 220;
    --ink-quiet: rgba(var(--ink-rgb), 0.70);
    --line: rgba(var(--ink-rgb), 0.16);
    --wash: rgba(var(--ink-rgb), 0.05);
    --accent: #F0A17C;
    --card: #221E37;
  }
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ground); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 0.22em; transition: text-decoration-color 0.35s var(--ease); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 4px; }
::selection { background: rgba(var(--ink-rgb), 0.14); }

.skip-link { position: absolute; left: var(--page-gutter); top: -60px; z-index: 20; padding: 8px 14px; background: var(--ink); color: var(--ground); border-radius: 999px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 var(--page-gutter); }

/* Type roles */
.label { font-family: var(--mono); font-size: var(--t-label); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-quiet); }
.lead { font-size: var(--t-lead); line-height: 1.5; max-width: 46ch; }
.quiet { color: var(--ink-quiet); }

/* ------------------------------------------------------------ header */
.site-header { position: relative; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 22px; padding-bottom: 22px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 1.3rem; letter-spacing: -0.02em; }
.logo svg, .logo img { width: 30px; height: 30px; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { text-decoration: none; color: var(--ink-quiet); font-size: 0.98rem; transition: color 0.35s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav .launch { font-family: var(--mono); font-size: var(--t-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-quiet); }
@media (max-width: 760px) { .nav a:not(.btn):not(.launch) { display: none; } }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--ground);
  font: inherit; font-weight: 500; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}
.btn:hover { background: transparent; color: var(--ink); }
.btn .arrow { display: inline-block; transition: transform 0.35s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 0.94rem; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

/* ------------------------------------------------------------ hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding-top: clamp(8px, 3vw, 40px); padding-bottom: clamp(48px, 8vw, 110px); }
.hero h1 { font-size: var(--t-hero); line-height: 0.98; letter-spacing: -0.04em; max-width: 12ch; margin: 18px 0 22px; }
.hero .lead { color: var(--ink-quiet); }

.stage { position: relative; aspect-ratio: 1 / 0.9; width: 100%; }
.stage .island-fallback { position: absolute; inset: 6% 10%; width: 80%; height: 88%; transition: opacity 0.7s var(--ease); }
.stage canvas.island-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.7s var(--ease); }
.stage.is-3d canvas.island-canvas { opacity: 1; }
.stage.is-3d .island-fallback { opacity: 0; }

/* Phones: headline, then the island, then the checklist right under it,
   so ticking a task happens with the island in view. */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; row-gap: 0; }
  .hero-copy { display: contents; }
  .hero .demo { order: 2; margin: 4px calc(-1 * var(--page-gutter)) 0; }
  .hero .stage { aspect-ratio: 1 / 0.78; }
  .hero .try { position: relative; left: auto; bottom: auto; width: auto; margin: -36px var(--page-gutter) 0; }
  .hero .launch-note, .hero .waitlist { order: 3; }
  .hero .lead { margin-bottom: 0; }
}

/* Demo: the island with an app card floating on it. The page's one loud moment. */
.demo { position: relative; }
.try {
  position: absolute; left: -9%; bottom: 2%; z-index: 2;
  width: min(390px, 72%);
  padding: 18px 20px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -18px rgba(20, 12, 6, 0.35);
}
@media (max-width: 1180px) { .try { left: 0; } }
.try-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.coins { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.coin { width: 18px; height: 18px; border-radius: 50%; background: var(--coin); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18); flex: none; }
.coins.bump .coin { animation: bump 0.5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.45); } }
.try ul { list-style: none; margin: 0; padding: 0; }
.try li + li { border-top: 1px solid var(--line); }
.task { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 2px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.task .box { position: relative; width: 26px; height: 26px; flex: none; border: 1.5px solid var(--ink-quiet); border-radius: 8px; display: grid; place-items: center; transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease); }
.task .box svg { width: 15px; height: 15px; opacity: 0; transform: scale(0.6); transition: opacity 0.3s var(--ease), transform 0.4s var(--ease); }
.task .name { flex: 1; transition: color 0.35s var(--ease); }
.task .meta { font-family: var(--mono); font-size: var(--t-label); letter-spacing: 0.06em; color: var(--ink-quiet); white-space: nowrap; }
.task:hover .box { border-color: var(--ink); }
.task[aria-pressed="true"] { cursor: default; }
.task[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); }
.task[aria-pressed="true"] .box svg { opacity: 1; transform: none; }
.task[aria-pressed="true"] .name { color: var(--ink-quiet); text-decoration: line-through; text-decoration-color: var(--line); }
/* Gentle cue on the next box until it's ticked */
.task.cue .box::after { content: ''; position: absolute; inset: -6px; border-radius: 12px; border: 2px solid var(--accent); opacity: 0; animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0.7; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.25); } }
.try-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.try-note { margin: 0; font-size: var(--t-caption); color: var(--ink-quiet); min-height: 1.6em; }
.again { background: none; border: 0; padding: 4px 0; color: var(--ink); font: inherit; font-size: var(--t-caption); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 0.22em; }
.again:hover { text-decoration-color: var(--ink); }
.launch-note { margin-top: 28px; }

/* Coin flying from the checkbox into the island */
.fly { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; will-change: transform; }
.fly .coin { width: 22px; height: 22px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2), 0 4px 10px rgba(233, 162, 59, 0.45); }
/* What just arrived, pinned over the new item */
.pop-label { position: absolute; z-index: 1; transform: translate(-50%, -100%); pointer-events: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--ground); font-size: 0.9rem; font-weight: 500; white-space: nowrap; animation: pop 2.6s var(--ease) forwards; }
.pop-label .coin { width: 14px; height: 14px; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, -60%) scale(0.8); } 12% { opacity: 1; transform: translate(-50%, -100%) scale(1); } 80% { opacity: 1; transform: translate(-50%, -110%); } 100% { opacity: 0; transform: translate(-50%, -130%); } }

/* Waitlist (off until a provider is connected; see README) */
[data-waitlist="off"] .needs-waitlist { display: none !important; }
[data-waitlist="on"] .waitlist-off-only { display: none !important; }
.waitlist { margin-top: 28px; max-width: 440px; }
.waitlist-row { display: flex; gap: 10px; flex-wrap: wrap; }
.waitlist input[type="email"] { flex: 1 1 220px; min-height: 48px; padding: 0 18px; border: 1.5px solid var(--line); border-radius: 999px; background: transparent; color: inherit; font: inherit; }
.waitlist input[type="email"]:focus { border-color: var(--ink); outline: none; }
.waitlist .hp { position: absolute; left: -9999px; }
.fineprint { margin-top: 10px; font-size: var(--t-caption); color: var(--ink-quiet); }
.form-status { font-size: var(--t-caption); }

/* ------------------------------------------------------------ sections */
.section { padding: clamp(64px, 10vw, 140px) 0; }
.section h2 { font-size: var(--t-section); line-height: 1.05; letter-spacing: -0.03em; max-width: 16ch; margin: 14px 0 20px; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.split > :first-child p { color: var(--ink-quiet); max-width: 46ch; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Numbers */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin: 0; }
.metrics div { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 18px; }
.metrics dd { order: -1; }
.metrics dd { margin: 0; font-size: var(--t-metric); font-weight: 500; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.metrics dt { margin-top: 12px; }
.metrics-note { margin-top: 28px; color: var(--ink-quiet); max-width: 60ch; }
@media (max-width: 860px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Big goal plan (drawn like the app) */
.plan { border: 1px solid var(--line); border-radius: var(--radius); background: var(--wash); padding: clamp(20px, 3vw, 32px); }
.plan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.plan h3 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); letter-spacing: -0.025em; margin: 8px 0 16px; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 18px; }
.bar span { display: block; height: 100%; width: 33%; background: var(--accent); border-radius: 3px; }
.plan ol { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.plan li { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.plan li .n { font-family: var(--mono); font-size: var(--t-label); color: var(--ink-quiet); width: 2ch; }
.plan li .t { flex: 1; }
.plan li .d { font-family: var(--mono); font-size: var(--t-label); letter-spacing: 0.08em; color: var(--ink-quiet); }
.plan li.done .t { color: var(--ink-quiet); text-decoration: line-through; text-decoration-color: var(--line); }
.plan li.next .t { font-weight: 500; }
.plan li.next .n { color: var(--accent); }
.plan-foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--t-caption); color: var(--ink-quiet); }

/* Bento: isolated, animated objects. One WebGL canvas (js/bento.js) draws into each .tile-stage. */
.bento {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: clamp(170px, 17vw, 260px);
  gap: clamp(12px, 1.6vw, 20px);
}
.bento-canvas { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; }
.tile { --tile-bg: var(--ground); display: flex; flex-direction: column; margin: 0; overflow: hidden; border-radius: 22px; background: var(--tile-bg); border: 1px solid var(--line); transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease); }
.tile-stage { position: relative; flex: 1; min-height: 0; }
/* The chicken is a bust: fade its cut-off chest into the card. */
.tile-chicken .tile-stage::after { content: ""; position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 38%; background: linear-gradient(to bottom, transparent, var(--tile-bg)); pointer-events: none; transition: background 0.35s var(--ease); }
.tile-cap { margin: 0; padding: 14px 18px 18px; font-size: var(--t-caption); color: var(--ink-quiet); line-height: 1.45; }
.tile-cap .label { display: block; margin-bottom: 4px; }
.tile-time { position: absolute; z-index: 2; left: 16px; top: 14px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-quiet); letter-spacing: 0.1em; font-variant-numeric: tabular-nums; }
/* Hover plays a tile (js/bento.js); touch screens play whatever is in view. */
@media (hover: hover) {
  .bento.is-3d .tile:hover { --tile-bg: var(--card); border-color: rgba(var(--ink-rgb), 0.32); }
}
.tile-clock { grid-column: span 2; grid-row: span 2; }
.tile-chicken { grid-column: span 1; grid-row: span 2; }
.tile-weather { grid-column: span 2; }
.tile-land { grid-column: span 2; }
.tile-windmill, .tile-lantern { grid-row: span 1; }
.tile-weather, .tile-land { grid-row: span 2; }
@media (max-width: 860px) {
  /* Phone: rows size to content; each stage gets a fixed height so captions can't squeeze the scene. */
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
  .tile { grid-row: auto !important; }
  .tile-stage { flex: none; height: 190px; }
  .tile-clock, .tile-weather { grid-column: span 2; }
  .tile-clock .tile-stage, .tile-weather .tile-stage { height: 260px; }
  .tile-chicken, .tile-windmill, .tile-lantern, .tile-land { grid-column: span 1; }
  .tile-weather { order: 5; }
}
.no-3d .tile-time { display: none; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0; cursor: pointer; list-style: none; font-size: var(--t-heading); font-weight: 500; letter-spacing: -0.015em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); color: var(--ink-quiet); transition: transform 0.35s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-quiet); max-width: 60ch; margin: -4px 0 22px; }

/* Closing */
.closing { padding: clamp(80px, 12vw, 160px) 0; }
.closing-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
@media (max-width: 860px) { .closing-grid { grid-template-columns: 1fr; } }
.no-3d .closing-stage { display: none; }
.closing h2 { font-size: var(--t-display); line-height: 1; letter-spacing: -0.04em; max-width: 14ch; margin: 14px 0 28px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }

/* ------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 26px; padding-bottom: 40px; font-size: var(--t-caption); color: var(--ink-quiet); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 22px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ------------------------------------------------------------ legal pages */
.legal { padding: clamp(32px, 6vw, 72px) 0 clamp(64px, 10vw, 120px); }
.legal .wrap > * { max-width: 68ch; }
.legal h1 { font-size: var(--t-display); line-height: 1; letter-spacing: -0.04em; margin: 0 0 16px; }
.legal h2 { font-size: 1.35rem; letter-spacing: -0.015em; margin: 2.2em 0 0.5em; }
.legal h3 { font-size: 1.1rem; margin: 1.8em 0 0.4em; }
.legal p, .legal li { color: var(--ink-quiet); }
.legal .lede { font-size: var(--t-lead); line-height: 1.5; color: var(--ink); }

/* ------------------------------------------------------------ reveal */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--i, 0) * 50ms); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
