/* Desk Beast — landing page
   Palette is built around the character renders' off-white backdrop (~#F0F0F0)
   so the creature sits directly on the page instead of inside a box. */

:root {
  --paper: #f0f0f0;
  --paper-2: #e6e8e6;
  --ink: #0f2e2f;
  --ink-soft: #3f5a5b;
  --teal: #3bb8b8;
  --teal-deep: #0f3b3c;
  --teal-text: #137272; /* AA on paper */
  --coral: #ff6b3d;
  --coral-soft: #ffd9cc;
  --radius: 22px;
  --wrap: 1180px;
  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Figtree", "Avenir Next", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.02; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 10px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 6px; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--teal-text);
  margin-bottom: 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 52px; padding: 0 1.6rem; border-radius: 999px;
  font-weight: 700; font-size: 1rem; text-decoration: none;
  border: 2px solid transparent;
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background-color .2s;
}
.btn-primary { background: var(--coral); color: var(--ink); box-shadow: 0 4px 0 var(--ink); border-color: var(--ink); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-ghost { color: var(--ink); border-color: transparent; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; padding-inline: .8rem; }
.btn-ghost:hover { text-decoration-color: var(--coral); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: var(--paper); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem;
  text-decoration: none; letter-spacing: -0.02em;
}
.brand-mark {
  width: 26px; height: 24px; background: var(--teal);
  border-radius: 55% 55% 45% 45% / 60% 60% 40% 40%;
  box-shadow: inset -4px -4px 0 rgba(15, 46, 47, .18);
  position: relative;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; top: 8px; width: 5px; height: 6px; border-radius: 50%; background: var(--ink);
}
.brand-mark::before { left: 7px; }
.brand-mark::after { right: 7px; }

.nav-links { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2rem; }
.nav-links a { text-decoration: none; font-weight: 600; font-size: .98rem; }
.nav-links a:not(.nav-cta):hover { color: var(--teal-text); }
.nav-cta { background: var(--ink); color: var(--paper); padding: .6rem 1.1rem; border-radius: 999px; }
.nav-cta:hover { background: var(--teal-deep); }

.nav-toggle {
  display: none; width: 46px; height: 46px; border: 0; border-radius: 12px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 22px; height: 2.5px; background: currentColor; border-radius: 2px;
  margin-inline: auto; position: relative; transition: transform .25s var(--ease-out), opacity .2s;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 2rem;
  min-height: calc(100svh - 72px - 64px);
  padding-block: 2rem 3rem;
}
.hero-copy { max-width: 34rem; }
.hero h1 {
  font-size: clamp(2.9rem, 6.4vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hero h1 em {
  font-style: normal;
  color: var(--teal-text);
  display: inline;
  background: linear-gradient(transparent 68%, var(--coral-soft) 68%, var(--coral-soft) 92%, transparent 92%);
}
.hero-sub { margin-top: 1.5rem; font-size: 1.2rem; color: var(--ink-soft); max-width: 30rem; }
.hero-sub strong { color: var(--ink); }
.hero-actions { margin-top: 2.2rem; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }

.hero-stage { position: relative; margin: 0; justify-self: center; width: min(100%, 600px); }
.hero-halo {
  position: absolute; inset: 9% 9% 4%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, rgba(59, 184, 184, .28), rgba(59, 184, 184, 0) 65%);
  filter: blur(8px);
}
.hero-img {
  position: relative; width: 100%;
  -webkit-mask-image: radial-gradient(closest-side, #000 74%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 74%, transparent 100%);
  animation: bob 4.5s ease-in-out infinite;
  transform-origin: 50% 90%;
}
@keyframes bob {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-10px) scale(1.012, .99); }
}

.hud {
  position: absolute;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 700;
  font-size: .9rem;
  padding: .7rem .95rem;
  animation: pop-in .7s var(--ease-out) both;
}
.hud-level { left: 0; bottom: 14%; display: grid; grid-template-columns: auto 1fr; gap: .3rem .7rem; align-items: center; width: 220px; animation-delay: .5s; }
.hud-label { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.hud-bar { height: 10px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.hud-fill { display: block; height: 100%; width: 64%; background: var(--teal); border-radius: inherit; animation: fill 1.4s .9s var(--ease-out) both; }
.hud-xp { grid-column: 1 / -1; font-size: .78rem; color: var(--ink-soft); font-weight: 600; }
.hud-streak { right: 2%; top: 16%; background: var(--coral); animation-delay: .75s; transform: rotate(3deg); }
.flame { margin-right: .15rem; }

@keyframes pop-in {
  from { opacity: 0; transform: translateY(14px) scale(.92); }
  to { opacity: 1; }
}
@keyframes fill { from { width: 0; } }

.hero-copy > * { animation: rise .8s var(--ease-out) both; }
.hero-copy > :nth-child(2) { animation-delay: .08s; }
.hero-copy > :nth-child(3) { animation-delay: .16s; }
.hero-copy > :nth-child(4) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Ticker ---------- */
.ticker {
  background: var(--ink); color: var(--paper);
  overflow: hidden; height: 64px; display: flex; align-items: center;
  transform: rotate(-1.2deg); margin-inline: -2%;
}
.ticker-track { display: flex; gap: 2.5rem; white-space: nowrap; animation: marquee 40s linear infinite; padding-left: 2.5rem; }
.ticker-track span { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; display: inline-flex; align-items: center; gap: 2.5rem; }
.ticker-track span::after { content: "●"; color: var(--teal); font-size: .6em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section-head { max-width: 44rem; margin-bottom: 3.5rem; }
.section-head h2 { font-size: clamp(2.2rem, 4.6vw, 3.8rem); font-weight: 800; }
.section-sub { margin-top: 1rem; font-size: 1.15rem; color: var(--ink-soft); }

/* ---------- Features ---------- */
.features { padding-block: 7rem 6rem; }
.feature-rows { border-top: 2px solid var(--ink); }
.feature {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding-block: 2.5rem;
  border-bottom: 2px solid var(--ink);
}
.feature-num { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--teal-text); align-self: start; padding-top: .35rem; }
.feature h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 700; margin-bottom: .6rem; }
.feature p { color: var(--ink-soft); max-width: 34rem; }
.feature p strong { color: var(--ink); }

.feature-meta { list-style: none; margin: 0; padding: 0; display: flex; gap: 2rem; justify-self: end; }
.feature-meta li { display: flex; flex-direction: column; font-weight: 600; color: var(--ink-soft); font-size: .9rem; }
.feature-meta strong { font-family: var(--font-display); font-size: 3rem; line-height: 1; color: var(--ink); font-weight: 800; }

.xp-demo {
  justify-self: end; width: min(100%, 300px);
  background: #fff; border: 2px solid var(--ink); border-radius: 18px; padding: 1rem 1.1rem;
  box-shadow: 0 4px 0 var(--ink); font-weight: 600; font-size: .95rem;
}
.xp-line, .xp-total { display: flex; justify-content: space-between; padding: .3rem 0; }
.xp-line b { color: var(--teal-text); }
.xp-line.accent b { color: #b8411a; }
.xp-total { border-top: 2px dashed var(--paper-2); margin-top: .35rem; padding-top: .6rem; font-family: var(--font-display); font-size: 1.15rem; }

.mini-evo { justify-self: end; display: flex; align-items: center; gap: .25rem; }
.mini-evo img {
  width: 104px; height: 104px;
  -webkit-mask-image: radial-gradient(closest-side, #000 70%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 70%, transparent 100%);
}
.mini-evo img:nth-of-type(2) { width: 124px; height: 124px; }
.mini-evo img:nth-of-type(3) { width: 150px; height: 150px; }
.mini-evo span { font-weight: 800; color: var(--coral); font-size: 1.3rem; }

/* ---------- Evolution ---------- */
.evolution {
  background: var(--teal-deep);
  color: var(--paper);
  padding-block: 7rem;
  border-radius: 40px;
  margin-inline: clamp(.5rem, 1.5vw, 1.25rem);
}
.evolution .eyebrow { color: #7fe0de; }
.evolution .section-sub { color: #bcd6d6; }

.evo-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  margin-bottom: 4.5rem;
}
.evo-visual {
  position: relative;
  aspect-ratio: 1;
  width: min(100%, 520px);
  justify-self: center;
  border-radius: 50%;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 0 0 10px rgba(59, 184, 184, .25), 0 0 80px rgba(59, 184, 184, .35);
}
.evo-visual img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: opacity .25s ease, transform .4s var(--ease-out); }
.evo-visual img.is-swapping { opacity: 0; transform: scale(.94); }

.evo-stage-num { font-weight: 700; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: #7fe0de; }
.evo-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 7vw, 5.5rem); line-height: 1; letter-spacing: -0.035em; margin-top: .4rem; }
.evo-range { font-weight: 700; color: #ff9572; font-size: 1.15rem; margin-top: .5rem; }
.evo-desc { margin-top: 1rem; color: #cfe3e3; font-size: 1.1rem; max-width: 26rem; min-height: 3.6em; }

.evo-slider-label { display: block; margin-top: 2rem; font-weight: 700; }
.evo-slider-label output { font-family: var(--font-display); font-size: 1.3rem; margin-left: .25rem; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; background: transparent; margin-top: .4rem; cursor: pointer;
  --pct: 0%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 14px; border-radius: 99px;
  background: linear-gradient(to right, var(--teal) var(--pct), rgba(255,255,255,.15) var(--pct));
}
input[type="range"]::-moz-range-track { height: 14px; border-radius: 99px; background: rgba(255,255,255,.15); }
input[type="range"]::-moz-range-progress { height: 14px; border-radius: 99px; background: var(--teal); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 32px; height: 32px; margin-top: -9px;
  border-radius: 50%; background: var(--coral); border: 3px solid var(--paper);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%; background: var(--coral); border: 3px solid var(--paper);
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--coral); outline-offset: 3px; }
input[type="range"]:focus-visible::-moz-range-thumb { outline: 3px solid var(--coral); outline-offset: 3px; }

.evo-ticks { display: flex; justify-content: space-between; font-size: .8rem; color: #9fc0c0; font-weight: 600; }

.stage-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.25rem;
  text-align: center;
}
.stage-btn {
  display: block; width: 100%; padding: 0; border: 0; cursor: pointer;
  aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: var(--paper);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out);
  box-shadow: 0 0 0 0 var(--coral);
}
.stage-btn img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); }
.stage-btn:hover { transform: translateY(-6px) rotate(-2deg); }
.stage-btn[aria-current="true"] { box-shadow: 0 0 0 5px var(--coral); }
.stage h3 { margin-top: 1rem; font-size: 1.35rem; font-weight: 700; }
.stage p { color: #bcd6d6; font-weight: 600; font-size: .95rem; margin-top: .2rem; }

/* ---------- CTA ---------- */
.cta { padding-block: 7rem 6rem; }
.cta-inner {
  background: var(--coral);
  border: 2px solid var(--ink);
  border-radius: 40px;
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center; gap: 2rem;
  padding: 3rem 3.5rem;
  overflow: hidden;
}
.cta-img {
  width: 100%; max-width: 400px; justify-self: center;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper);
}
.cta h2 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 800; letter-spacing: -0.035em; }
.cta-copy p { margin-top: 1rem; font-size: 1.15rem; max-width: 28rem; }

.appstore-badge {
  margin-top: 2rem;
  display: inline-flex; align-items: center; gap: .65rem;
  background: #000; color: #fff; text-decoration: none;
  padding: .55rem 1.3rem .55rem 1rem; border-radius: 12px;
  border: 1.5px solid #a6a6a6;
  transition: transform .25s var(--ease-out);
}
.appstore-badge:hover { transform: translateY(-2px); }
.badge-text { display: flex; flex-direction: column; line-height: 1.05; font-family: -apple-system, "SF Pro Text", "Helvetica Neue", var(--font-body); }
.badge-text small { font-size: .72rem; font-weight: 500; letter-spacing: .01em; }
.badge-text b { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
.cta-copy .soon {
  margin-top: .8rem; font-size: .85rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 2px solid var(--ink); padding-block: 2rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.footer-brand { font-size: 1.15rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; }
.footer-links a { font-weight: 600; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.copyright { color: var(--ink-soft); font-size: .92rem; }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.stage-list .stage:nth-child(2) { transition-delay: .06s; }
.stage-list .stage:nth-child(3) { transition-delay: .12s; }
.stage-list .stage:nth-child(4) { transition-delay: .18s; }
.stage-list .stage:nth-child(5) { transition-delay: .24s; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; text-align: left; min-height: auto; padding-top: 1rem; gap: 0; }
  .hero-stage { order: -1; width: min(100%, 460px); }
  .hud-level { left: 2%; bottom: 6%; width: 190px; }
  .feature { grid-template-columns: 3rem minmax(0, 1fr); }
  .feature > :last-child { grid-column: 2; justify-self: start; }
  .evo-player { grid-template-columns: 1fr; gap: 2rem; }
  .stage-list { grid-template-columns: repeat(5, minmax(120px, 1fr)); overflow-x: auto; padding: 1rem .25rem 1.5rem; scroll-snap-type: x mandatory; }
  .stage { scroll-snap-align: center; }
  .cta-inner { grid-template-columns: 1fr; text-align: center; padding: 2.5rem 1.5rem; }
  .cta-img { max-width: 260px; }
  .cta-copy p { margin-inline: auto; }
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-links {
    position: absolute; left: 0; right: 0; top: 72px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 2px solid var(--ink);
    padding: .5rem 1.25rem 1.25rem;
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { display: block; padding: .9rem 0; font-size: 1.1rem; }
  .nav-links .nav-cta { text-align: center; margin-top: .5rem; padding: .9rem; }
  .hero h1 { font-size: clamp(2.5rem, 11vw, 3.4rem); }
  .hero-sub { font-size: 1.08rem; }
  .hud { font-size: .8rem; padding: .5rem .7rem; }
  .hud-level { width: 168px; }
  .hud-streak { top: 10%; right: 0; }
  .features { padding-block: 5rem; }
  .evolution { padding-block: 5rem; border-radius: 28px; }
  .feature { grid-template-columns: 1fr; gap: 1rem; padding-block: 2rem; }
  .feature > :last-child { grid-column: 1; }
  .feature-num { padding-top: 0; }
  .feature-meta { gap: 1.5rem; }
  .feature-meta strong { font-size: 2.4rem; }
  .mini-evo img { width: 80px; height: 80px; }
  .mini-evo img:nth-of-type(2) { width: 96px; height: 96px; }
  .mini-evo img:nth-of-type(3) { width: 116px; height: 116px; }
  .cta-inner { border-radius: 28px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
  }
  .ticker-track { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
}

.faq-item { max-width: 52rem; padding: 1.5rem 0; border-bottom: 1px solid var(--ink-soft); }
.faq-item h3 { font-size: 1.5rem; line-height: 1.2; }
.faq-item p { margin-top: .8rem; }
@media (max-width: 700px) { html:not(.js) .nav-links { display: flex; position: static; flex-wrap: wrap; } html:not(.js) .nav-toggle { display: none; } }
