:root {
  color-scheme: dark;
  --bg: #070a13;
  --surface: #101829;
  --surface-deep: #0b1020;
  --line: rgba(184, 206, 240, .2);
  --text: #f7f9ff;
  --muted: #b8c4d8;
  --ice: #8de5ff;
  --ice-deep: #0d5c86;
  --bolt: #ffda48;
  --bolt-deep: #7f4b00;
  --cinder: #ff986a;
  --cinder-deep: #7d2d22;
  --mind: #cfb8ff;
  --mind-deep: #49318a;
  --focus: #ffffff;
  --content: 1180px;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}

img, video { max-width: 100%; }
a { color: inherit; }
button, summary { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  min-height: 76px;
  padding: 0 max(24px, calc((100vw - var(--content)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: linear-gradient(180deg, rgba(3, 7, 16, .86), transparent);
}
.brand {
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .07em;
  font-size: .92rem;
}
.brand span { color: var(--bolt); }
.site-header nav { display: flex; align-items: center; gap: 26px; }
.site-header nav a {
  color: #eef3ff;
  text-decoration: none;
  font-size: .92rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}
.site-header nav a:hover { text-decoration: underline; text-underline-offset: 5px; }

.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: #10172c;
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: 0;
  display: block;
}
.hero-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  image-rendering: auto;
}
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 5, 12, .2) 50%, rgba(2, 5, 12, .94) 100%),
    linear-gradient(90deg, rgba(2, 5, 12, .26), transparent 28%, transparent 72%, rgba(2, 5, 12, .26));
}
.hero-panel {
  position: absolute;
  z-index: 2;
  left: max(24px, calc((100vw - var(--content)) / 2));
  bottom: clamp(46px, 8vh, 86px);
  max-width: 720px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.hero-panel h1 {
  margin: 0;
  max-width: 260px;
  color: #f3f6ff;
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.35;
  letter-spacing: 0;
}
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.scroll-cue {
  position: absolute;
  z-index: 2;
  right: max(24px, calc((100vw - var(--content)) / 2));
  bottom: clamp(50px, 8.4vh, 90px);
  color: #dce6f8;
  text-decoration: none;
  font-size: .86rem;
}
.scroll-cue span { color: var(--bolt); margin-left: 6px; }

.button {
  display: inline-flex;
  min-height: 46px;
  padding: 11px 18px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .18s ease-out, background-color .18s ease-out, color .18s ease-out;
}
.button:hover { transform: translateY(-2px); }
.button-primary, a.button-primary:link, a.button-primary:visited { background: var(--text); color: #08101d; }
.button-quiet, a.button-quiet:link, a.button-quiet:visited { background: rgba(4, 8, 18, .78); color: var(--text); border: 1px solid rgba(255, 255, 255, .4); }

.section {
  width: min(var(--content), calc(100% - 40px));
  margin-inline: auto;
}
.section-heading { max-width: 760px; }
.kicker, .element-label {
  margin: 0 0 12px;
  color: var(--ice);
  font: 800 .8rem/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3 {
  margin: 0;
  line-height: 1;
  letter-spacing: -.035em;
  text-wrap: balance;
}
h1, .section-heading h2 { font-size: clamp(3rem, 7vw, 5.6rem); }
h3 { font-size: clamp(1.9rem, 3.4vw, 3rem); }
p { text-wrap: pretty; }

.install { padding: clamp(84px, 12vw, 156px) 0 110px; }
.install-heading > p:last-child {
  max-width: 640px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.16rem;
}
.install-grid {
  margin-top: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: clamp(42px, 7vw, 90px);
  align-items: start;
}
.install-steps ol { list-style: none; padding: 0; margin: 0; }
.install-steps li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.install-steps li > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #16253d;
  color: var(--ice);
  font-weight: 900;
}
.install-steps li p { margin: 5px 0 0; color: #dbe4f4; }
.install-steps a { text-underline-offset: 4px; }
code {
  font: .92em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}
.settings-visual { margin: 0; }
.settings-frame {
  min-height: 270px;
  display: grid;
  place-items: center;
  padding: clamp(20px, 5vw, 52px) 20px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 30%, rgba(141, 229, 255, .14), transparent 52%),
    #0d1320;
  border: 1px solid var(--line);
}
.settings-shell {
  width: 100%;
  min-height: 118px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: #202020;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .38);
}
.settings-copy { min-width: 0; }
.settings-copy strong {
  display: block;
  margin-bottom: 8px;
  color: #f6f6f6;
  font-size: 1.15rem;
}
.settings-copy code { color: #b9b9bd; }
.open-folder {
  flex: 0 0 auto;
  color: #a8a8ad;
  font-size: 1.03rem;
  white-space: nowrap;
}
.settings-visual figcaption {
  margin-top: 14px;
  color: var(--muted);
  font-size: .88rem;
}
.desktop-links { margin-top: 36px; }
.desktop-links h2 { font-size: 1.55rem; letter-spacing: -.02em; }
.desktop-links p { max-width: 600px; color: var(--muted); }
.pet-install, a.pet-install:link, a.pet-install:visited { color: #07101c; }
.frost-install { background: var(--ice); }
.bolt-install { background: var(--bolt); }
.cinder-install { background: var(--cinder); }
.mantra-install { background: var(--mind); }
.script-install {
  margin-top: 54px;
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.script-install summary { cursor: pointer; font-weight: 850; }
.script-columns {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.script-columns h2 { font-size: 1rem; letter-spacing: 0; }
pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 16px;
  border-radius: 10px;
  background: #030711;
  color: #dce8fa;
}

.roster { padding: 112px 0 132px; }
.roster-heading > p:last-child {
  max-width: 700px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}
.roster-grid {
  margin-top: 54px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.roster-card {
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.roster-card h3 {
  font-size: clamp(1.55rem, 2.4vw, 2.3rem);
  letter-spacing: -.025em;
}
.roster-card > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}
.roster-portrait {
  position: relative;
  min-height: 220px;
  margin: -4px -4px 18px;
  display: grid;
  place-items: center;
}
.roster-motion,
.roster-still {
  width: min(82%, 190px);
  aspect-ratio: 192 / 208;
  object-fit: contain;
  image-rendering: pixelated;
}
.roster-still {
  display: none;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 800% 1100%;
}
.frost-roster { background: linear-gradient(160deg, rgba(13, 92, 134, .46), #0c1729 65%); }
.bolt-roster { background: linear-gradient(160deg, rgba(127, 75, 0, .46), #161326 65%); }
.cinder-roster { background: linear-gradient(160deg, rgba(125, 45, 34, .58), #191318 65%); }
.mantra-roster { background: linear-gradient(160deg, rgba(73, 49, 138, .62), #121426 65%); }
.bolt-roster .element-label { color: var(--bolt); }
.cinder-roster .element-label { color: var(--cinder); }
.mantra-roster .element-label { color: var(--mind); }

.evolution {
  padding: 104px 0 124px;
  background: #0b1020;
  border-block: 1px solid var(--line);
}
.evolution-intro {
  display: grid;
  grid-template-columns: 1fr minmax(300px, .72fr);
  gap: 70px;
  align-items: end;
}
.concept-note {
  margin: 0;
  padding: 18px;
  border-radius: 12px;
  background: #151c2d;
  color: #d6e0f1;
}
.concept-note strong { color: var(--bolt); }
.evolution-grid {
  margin-top: 58px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.evolution-card {
  position: relative;
  min-width: 0;
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.frost-card { background: linear-gradient(145deg, #102943, #0c1729 64%); }
.bolt-card { background: linear-gradient(145deg, #352406, #161326 64%); transform: translateY(42px); }
.card-copy { position: relative; z-index: 2; max-width: 520px; }
.card-copy > p:last-child { color: var(--muted); max-width: 58ch; }
.bolt-card .element-label { color: var(--bolt); }
.evolution-stage {
  position: relative;
  height: clamp(330px, 42vw, 480px);
  margin: 18px -12px 8px;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.pet-form {
  position: absolute;
  z-index: 3;
  width: min(68%, 310px);
  max-height: 84%;
  object-fit: contain;
  image-rendering: pixelated;
}
.normal-still {
  display: none;
  aspect-ratio: 192 / 208;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 800% 1100%;
}
.evolved-form { display: none; }
.evolution-card[data-form="evolved"] .normal-form { display: none; }
.evolution-card[data-form="evolved"] .evolved-form { display: block; }

.showcase-controls {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.form-toggle {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(1, 5, 12, .65);
  border: 1px solid var(--line);
}
.form-toggle button {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  color: #dce5f4;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}
.form-toggle button[aria-pressed="true"] { background: var(--text); color: #07101c; }

.proposal-link {
  margin-top: 94px;
  padding: 30px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border-top: 1px solid var(--line);
}
.proposal-link h3 { font-size: clamp(1.8rem, 4vw, 3.2rem); }
.proposal-link p { max-width: 650px; color: var(--muted); }

.quality {
  padding: 126px 0;
  display: grid;
  grid-template-columns: minmax(340px, .74fr) minmax(0, 1.26fr);
  gap: clamp(48px, 8vw, 100px);
  align-items: center;
}
.quality-copy > p:not(.kicker) { max-width: 58ch; color: var(--muted); font-size: 1.06rem; }
.quality-facts {
  list-style: none;
  padding: 24px 0 0;
  margin: 30px 0 0;
  display: flex;
  gap: 26px;
  border-top: 1px solid var(--line);
}
.quality-facts li { min-width: 86px; }
.quality-facts strong { display: block; font-size: 2rem; }
.quality-facts span { color: var(--muted); font-size: .78rem; }
.motion-frame { overflow: hidden; border-radius: var(--radius); background: var(--surface-deep); }
.motion-frame video { display: block; width: 100%; }

footer {
  width: min(var(--content), calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  color: #93a2ba;
  font-size: .82rem;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}
.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;
}

@media (max-width: 920px) {
  .hero-panel { align-items: flex-start; flex-direction: column; gap: 12px; }
  .scroll-cue { display: none; }
  .install-grid, .evolution-intro, .quality { grid-template-columns: 1fr; }
  .settings-visual { order: -1; }
  .evolution-intro { gap: 28px; }
  .quality { gap: 42px; }
  .roster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-aspect-ratio: 4 / 3) {
  .hero {
    min-height: 100svh;
    background: #0f172c;
  }
  .hero-poster {
    height: 100%;
    object-fit: contain;
    object-position: center top;
  }
  .hero-shade {
    background: linear-gradient(180deg, transparent 28%, rgba(3, 7, 15, .45) 50%, #070a13 82%);
  }
}

@media (max-width: 700px) {
  .site-header { min-height: 64px; padding-inline: 18px; }
  .site-header nav a:not(:last-child) { display: none; }
  .hero-panel {
    left: 20px;
    right: 20px;
    bottom: 34px;
  }
  .hero-panel h1 { max-width: none; }
  .hero-actions { width: 100%; }
  .hero-actions .button { flex: 1 1 180px; }
  .install { padding-top: 82px; }
  .install-grid { margin-top: 40px; }
  .settings-frame { min-height: 200px; }
  .settings-shell { align-items: flex-start; flex-direction: column; }
  .script-columns, .evolution-grid { grid-template-columns: 1fr; }
  .bolt-card { transform: none; }
  .evolution-stage { height: 360px; }
  .proposal-link { margin-top: 58px; align-items: flex-start; flex-direction: column; }
  .quality-facts { gap: 14px; justify-content: space-between; }
  footer { flex-direction: column; }
}

@media (max-width: 430px) {
  .section { width: min(var(--content), calc(100% - 28px)); }
  .brand { font-size: .8rem; }
  .site-header nav a { font-size: .82rem; }
  .button-row .button { width: 100%; }
  .evolution-card { padding: 22px 18px; }
  .evolution-stage { height: 320px; margin-inline: -6px; }
  .showcase-controls { align-items: stretch; flex-direction: column; }
  .form-toggle { display: flex; }
  .form-toggle button { flex: 1; }
  .quality-facts { flex-wrap: wrap; }
  .roster-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animated-normal { display: none; }
  .normal-still { display: block; }
  .frost-still { background-image: url("pets/frostbyte/spritesheet.webp"); }
  .bolt-still { background-image: url("pets/bolt/spritesheet.webp"); }
  .roster-motion { display: none; }
  .roster-still { display: block; }
  .frost-roster-still { background-image: url("pets/frostbyte/spritesheet.webp"); }
  .bolt-roster-still { background-image: url("pets/bolt/spritesheet.webp"); }
  .cinder-roster-still { background-image: url("pets/cinder/spritesheet.webp"); }
  .mantra-roster-still { background-image: url("pets/mantra/spritesheet.webp"); }
  .button { transition: none; }
  .button:hover { transform: none; }
}
