/* Fennec landing page. Flat vector, hard edges, system type.
   Colours are sampled from the master art, as the Product Hunt media are. */

:root {
  --sky: #2373C3;
  --twilight: #294D70;
  --dune: #EF792D;
  --dune-shadow: #BD5D26;
  --sand: #ECB478;
  --cream: #FDDCAF;
  --ink: #2C2927;
  --void: #23190E;
  --red: #FF3B30;

  --bg: #FFF8EC;
  --surface: #FFFFFF;
  --band: #F7E9D2;
  --text: #2C2927;
  --muted: #6B635C;
  --rule: #E8D9C2;
  --accent: #1D64AC;        /* sky, darkened for AA text on cream */
  --focus: #1D64AC;

  --radius: 14px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17120D;
    --surface: #221B15;
    --band: #1E1812;
    --text: #F6EADA;
    --muted: #B9AB98;
    --rule: #3A3027;
    --accent: #8CC0F0;
    --focus: #8CC0F0;
  }
}
:root[data-theme="dark"] {
  --bg: #17120D;
  --surface: #221B15;
  --band: #1E1812;
  --text: #F6EADA;
  --muted: #B9AB98;
  --rule: #3A3027;
  --accent: #8CC0F0;
  --focus: #8CC0F0;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, canvas { display: block; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: 0.9em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 32px; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--cream); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  background: var(--sky);
  color: var(--cream);
  --focus: var(--cream);
}
.hero a { color: var(--cream); }

.nav { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; text-decoration: none; }
.brand img { border-radius: 7px; }
.nav-links { display: flex; gap: 24px; font-size: 15px; font-weight: 500; }
.nav-links a { text-decoration: none; opacity: 0.92; }
.nav-links a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 560px) { .nav-links a:not(:last-child) { display: none; } }

.hero-copy { text-align: center; padding-top: 32px; padding-bottom: 8px; }
.hero-icon {
  width: 176px; height: 176px; margin: 0 auto 24px;
  border-radius: 22.5%;
}
.hero h1 { font-size: clamp(56px, 11vw, 104px); line-height: 1; letter-spacing: -0.035em; margin: 0; font-weight: 800; }
.tagline { font-size: clamp(22px, 3.4vw, 30px); font-weight: 600; letter-spacing: -0.01em; margin: 14px 0 0; }
.lede { max-width: 600px; margin: 16px auto 0; font-size: 18px; color: #FFF2DC; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }
.button {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 12px;
  font: 600 17px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
}
.button.primary { background: var(--cream); color: var(--ink) !important; }
.button.primary:hover { background: #FFF0D6; }
.button.primary:active { transform: translateY(1px); }
.button.secondary { border-color: rgba(253, 220, 175, 0.7); color: var(--cream); }
.button.secondary:hover { border-color: var(--cream); }
.meta { font-size: 14px; margin: 16px 0 0; opacity: 0.88; }

/* ---------------------------------------------------------------- demo */

.demo { position: relative; z-index: 1; padding-top: 48px; padding-bottom: 0; }
.screen {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--twilight);
  border: 2px solid rgba(35, 25, 14, 0.35);
  aspect-ratio: 16 / 9;
  min-height: 340px;
  display: flex; flex-direction: column;
  color: var(--cream);
}
.menubar {
  display: flex; align-items: center; gap: 16px;
  height: 30px; padding: 0 14px; flex: none;
  background: rgba(246, 241, 234, 0.9);
  color: var(--ink); font-size: 13px;
}
.mb-app { font-weight: 700; }
.mb-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
@media (max-width: 760px) { .mb-item.wide { display: none; } }
@media (max-width: 420px) { .mb-item { display: none; } }

.glyph .glyph-body { fill: var(--ink); }
.glyph .glyph-hole { fill: rgba(246, 241, 234, 1); display: none; }
.glyph .glyph-waves { stroke: var(--red); display: none; }
.glyph[data-state="detected"] .glyph-body { fill: var(--red); }
.glyph[data-state="detected"] .glyph-waves { display: inline; }
.glyph[data-state="repairing"] .glyph-hole { display: inline; }

.screen-body { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px clamp(18px, 5vw, 64px) 72px; }
.caption { display: flex; align-items: center; gap: 16px; min-height: 56px; }
.caption img { border-radius: 10px; flex: none; }
.caption p {
  margin: 0; font-size: clamp(24px, 4.4vw, 48px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
  transition: opacity 160ms linear;
}
.caption p.swap { opacity: 0; }
.now-playing { margin: clamp(16px, 4vw, 40px) 0 6px; font-size: 14px; font-weight: 600; opacity: 0.85; }
#scope { width: 100%; height: clamp(110px, 18vw, 200px); }

.notice {
  position: absolute; top: 40px; right: 12px; z-index: 2;
  display: flex; align-items: center; gap: 12px;
  width: min(300px, calc(100% - 24px));
  padding: 12px 14px; border-radius: 14px;
  background: #F5F3F0; color: var(--ink);
  transform: translateX(calc(100% + 24px));
  transition: transform 280ms linear;
}
.notice.show { transform: none; }
.notice img { border-radius: 8px; }
.notice-text { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; color: var(--muted); }
.notice-text strong { color: var(--ink); font-size: 15px; }
.notice-time { margin-left: auto; align-self: flex-start; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .notice, .caption p { transition: none; } }

.screen-dunes { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 64px; }
.screen-note { position: absolute; right: 14px; bottom: 8px; margin: 0; font-size: 12px; font-weight: 600; color: var(--cream); }

@media (max-width: 640px) {
  .screen { aspect-ratio: auto; min-height: 380px; }
  .notice { top: 38px; }
}

.demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 16px; }
.sound {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 12px;
  background: var(--ink); color: var(--cream);
  border: 2px solid var(--ink);
  font: 600 16px/1 var(--font); cursor: pointer;
}
.sound:disabled { opacity: 0.6; cursor: default; }
.sound .wave-off { display: none; }
.sound[aria-pressed="true"] { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.sound[aria-pressed="false"] .wave-on { display: none; }
.sound[aria-pressed="false"] .wave-off { display: inline; }
.sound-hint { margin: 0; font-size: 14px; opacity: 0.9; }

.hero-dunes { display: block; width: 100%; height: clamp(80px, 11vw, 160px); margin-top: -40px; position: relative; z-index: 0; }

/* ---------------------------------------------------------------- sections */

.section { padding-top: clamp(64px, 9vw, 112px); padding-bottom: clamp(16px, 3vw, 32px); }
.eyebrow { margin: 0 0 8px; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dune-shadow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow { color: var(--dune); } }
:root[data-theme="dark"] .eyebrow { color: var(--dune); }
h2 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.1; letter-spacing: -0.025em; margin: 0; font-weight: 800; }
h3 { font-size: 20px; margin: 0 0 8px; letter-spacing: -0.01em; }
.section-lede { font-size: 19px; color: var(--muted); margin: 16px 0 0; max-width: 460px; }

.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps p, .card p, .rules li, .faq p { color: var(--muted); margin: 0; }
.step-num {
  display: inline-grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px;
  border-radius: 50%; background: var(--sky); color: var(--cream); font-weight: 800;
}

.band { background: var(--band); margin-top: clamp(64px, 9vw, 112px); padding-bottom: clamp(64px, 9vw, 112px); }
.split { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .split { grid-template-columns: 5fr 6fr; gap: 64px; } }
.rules { list-style: none; margin: 0; padding: 0; }
.rules li { padding: 14px 0; border-top: 1px solid var(--rule); }
.rules li:first-child { border-top: 0; padding-top: 4px; }
.rules strong { color: var(--text); }

.cards { display: grid; gap: 16px; margin-top: 40px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; }

.faq { margin-top: 32px; border-top: 1px solid var(--rule); max-width: 780px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative;
  font-weight: 600; font-size: 18px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 0 20px; max-width: 680px; }

.closer { background: var(--sky); color: var(--cream); margin-top: clamp(64px, 9vw, 112px); --focus: var(--cream); }
.closer-inner { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 72px; padding-bottom: 96px; gap: 20px; }
.closer img { border-radius: 22.5%; }

.footer { background: var(--ink); color: #D9CCBA; font-size: 14px; padding-bottom: 136px; }
.footer a { color: #D9CCBA; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 24px; }
.footer p { margin: 0; }
.footer nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- the fox
   The approved run cycle, cropped to the union of its alpha bounds
   (40, 53, 1087 x 544 source px) and mirrored to run left to right,
   10 px above the bottom of the window, as the app places it. */

.fox {
  --w: 240px;
  position: fixed; left: 0; bottom: 10px; z-index: 50;
  width: var(--w); height: calc(var(--w) * 544 / 1087);
  pointer-events: none;
  visibility: hidden;
  will-change: transform;
}
.fox.running { visibility: visible; }
.fox-crop { width: 100%; height: 100%; overflow: hidden; position: relative; transform: scaleX(-1); }
.fox-crop img {
  position: absolute;
  width: calc(var(--w) * 1147 / 1087);
  max-width: none;
  left: calc(var(--w) * -40 / 1087);
  top: calc(var(--w) * -53 / 1087);
}
@media (max-width: 767px) { .fox { --w: 120px; } }
