/* ───────── Tokens ───────── */
:root {
  --bg: #d4f25a;
  --accent: #d4f25a;
  --ink: #111111;
  --ink-soft: rgba(17, 17, 17, 0.62);
  --paper: #f6f3ea;
  --dark: #121212;
  --on-dark: #f4f1e8;
  --line: rgba(17, 17, 17, 0.14);
  --radius: 28px;
  --nav-h: 60px;
  --gutter: clamp(16px, 4vw, 48px);
  --font: "Inter Tight", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
html[data-critter="pip"]    { --bg: #d4f25a; --accent: #d4f25a; }
html[data-critter="glitch"] { --bg: #b9b4ff; --accent: #b9b4ff; }
html[data-critter="mochi"]  { --bg: #ffb8cf; --accent: #ffb8cf; }
html[data-critter="byte"]   { --bg: #ff9a52; --accent: #ff9a52; }

*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.6s var(--ease);
}
body.locked { overflow: hidden; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: 0.02em; line-height: 0.92; }
p { margin: 0; }
canvas { display: block; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 999; background: var(--ink); color: var(--bg); padding: 8px 12px; }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.label { display: inline-flex; align-items: center; gap: 10px; }
.dot, .dot-live { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot-live { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

/* Logo: the j and i tittles are eyes that follow the pointer (--look-x / --look-y set in app.js) */
.logo { font-weight: 800; font-size: 30px; letter-spacing: 0.01em; line-height: 1; text-decoration: none; display: inline-flex; align-items: baseline; gap: 0.2em; white-space: nowrap; }
.logo small { font-family: var(--mono); font-weight: 500; font-size: 0.38em; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.7; }
.logo__eye { position: relative; display: inline-block; }
.logo__eye i {
  position: absolute; left: 50%; top: -0.02em; width: 0.34em; height: 0.34em; border-radius: 50%;
  background: #fff; transform: translateX(-50%); box-shadow: inset 0 0 0 0.04em var(--ink);
}
.logo__eye--j i { left: 62%; }
.logo__eye i::after {
  content: ""; position: absolute; width: 52%; height: 52%; border-radius: 50%; background: #111;
  left: calc(24% + var(--look-x, 0.4) * 22%); top: calc(24% + var(--look-y, 0.15) * 22%);
  transition: left 0.15s linear, top 0.15s linear;
}
.footer .logo__eye i { box-shadow: none; }

.underline { position: relative; display: inline-block; }
.underline::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.06em; height: 0.07em;
  background: currentColor; border-radius: 99px; transform-origin: left;
  animation: draw 1.2s 0.6s var(--ease) both;
}
@keyframes draw { from { transform: scaleX(0); } }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600;
  padding: 12px 20px; border-radius: 999px; border: 1.5px solid var(--ink); white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.25s, color 0.25s;
}
.btn:hover { transform: translateY(-2px); }
.btn--dark { background: var(--ink); color: var(--bg); }
.btn--accent { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn--lg { padding: 16px 26px; font-size: 17px; }
.btn--xl { padding: 22px 36px; font-size: 22px; }

/* ───────── Intro ───────── */
.intro {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; flex-direction: column; padding: 20px var(--gutter);
  transition: clip-path 1s var(--ease), background-color 0.6s var(--ease);
  clip-path: circle(150% at 50% 50%);
}
.intro.is-gone { clip-path: circle(0% at 50% 60%); pointer-events: none; }
.intro__top { display: flex; justify-content: space-between; align-items: center; }
.intro__status { display: inline-flex; gap: 8px; align-items: center; }
.intro__center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; }
.intro__title { font-size: clamp(44px, 8vw, 104px); margin-top: 8px; }
.intro__title em { font-style: normal; position: relative; }
.critter--intro { width: min(320px, 62vw); height: auto; aspect-ratio: 1; margin: 4px 0 -6px; }
.intro__name { font-size: 18px; letter-spacing: 0.3em; font-weight: 500; }
.intro__role { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.picker {
  margin-top: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  background: var(--ink); padding: 8px; border-radius: 999px;
}
.picker__chips { display: flex; gap: 6px; }
.chip {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0;
  background: rgba(255, 255, 255, 0.1); transition: transform 0.2s var(--ease), border-color 0.2s;
}
.chip canvas { width: 100%; height: 100%; }
.chip:hover { transform: scale(1.08); }
.chip[aria-checked="true"] { border-color: var(--bg); }
.picker__go {
  border: 0; background: var(--bg); color: var(--ink); font: 600 16px var(--font); padding: 14px 22px;
  border-radius: 999px; cursor: pointer; transition: transform 0.2s var(--ease);
}
.picker__go:hover { transform: scale(1.04); }
.intro__skip { margin-top: 18px; background: none; border: 0; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.intro__hint { position: absolute; right: var(--gutter); bottom: 20px; color: var(--ink-soft); }

/* ───────── Nav ───────── */
.nav {
  position: sticky; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: center;
  height: var(--nav-h); padding: 0 var(--gutter); background: transparent;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: color 0.3s var(--ease);
}
/* toggled in app.js while the nav sits over the dark contact/footer */
.nav--on-dark { color: var(--on-dark); }
.nav--on-dark .logo__eye i { box-shadow: none; }
.nav__links { display: flex; align-items: center; gap: 26px; font-weight: 500; }
.critter--nav { width: 32px; height: 32px; cursor: pointer; }

/* ───────── Hero ───────── */
.hero { position: relative; min-height: calc(100svh - var(--nav-h)); padding: 6vh var(--gutter) 6vh; display: flex; flex-direction: column; justify-content: space-between; }
.hero__eyebrow { min-height: 1.2em; }
.hero__title { font-size: clamp(44px, 14vw, 220px); position: relative; z-index: 2; margin: 4vh 0; }
.hero__title .line { display: block; animation: rise 1s var(--ease) both; }
.hero__title .line:nth-child(2) { animation-delay: 0.12s; }
@keyframes rise { from { transform: translateY(40%); opacity: 0; } }
.hero__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; position: relative; z-index: 2; }
.hero__lede { max-width: 520px; font-size: 19px; }
.critter--hero { flex: none; width: min(340px, 28vw); height: auto; aspect-ratio: 1; margin-right: 40px; }

/* ───────── Message ───────── */
/* extra bottom padding sits under .contact's rounded corners so they show paper, not the critter --bg */
.message { background: var(--paper); padding: 18vh var(--gutter) calc(18vh + var(--radius)); text-align: center; }
.big { font-size: clamp(52px, 9vw, 140px); }
.rotator { display: inline-block; position: relative; margin-bottom: 0.12em; }
.rotator span { display: inline-block; animation: swap 0.6s var(--ease) both; text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.08em; }
@keyframes swap { from { transform: translateY(60%); opacity: 0; filter: blur(6px); } }

/* ───────── Contact ───────── */
.contact { position: relative; margin-top: calc(-1 * var(--radius)); background: var(--dark); color: var(--on-dark); padding: 16vh var(--gutter) 12vh; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 36px; border-radius: var(--radius) var(--radius) 0 0; }
.critter--contact { width: 200px; height: 200px; }
.contact__note { display: inline-flex; align-items: center; gap: 10px; opacity: 0.7; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.contact__title { font-size: clamp(48px, 9vw, 140px); }

.footer { background: var(--dark); color: var(--on-dark); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 28px var(--gutter); border-top: 1px solid rgba(255, 255, 255, 0.1); }

/* ───────── Reveal ───────── */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ───────── Responsive ───────── */
@media (max-width: 900px) {
  .hero__bottom { flex-direction: column; align-items: flex-start; }
  .critter--hero { width: 200px; margin: 0; align-self: flex-end; order: -1; }
  .hero { justify-content: flex-start; gap: 12px; }
  .hero__title { margin: 0 0 3vh; }
  .intro__hint { display: none; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .nav .btn { padding: 10px 14px; font-size: 14px; }
  .btn--lg { padding: 14px 20px; font-size: 16px; }
  .btn--xl { padding: 18px 26px; font-size: 18px; }
  .chip { width: 38px; height: 38px; }
  .picker { border-radius: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
