:root {
  color-scheme: light;
  --ink: #17120d;
  --paper: #f5ead0;
  --cream: #fff7dc;
  --red: #c9271f;
  --red-dark: #8d1712;
  --blue: #1d5269;
  --yellow: #f3c72c;
  --mint: #78c7a1;
  --line: 4px solid var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  background:
    linear-gradient(90deg, rgba(23, 18, 13, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 18, 13, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 22px 22px;
  color: var(--ink);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 12px clamp(16px, 4vw, 44px);
  border-bottom: var(--line);
  background: rgba(255, 247, 220, 0.94);
  backdrop-filter: blur(8px);
}

.brand,
.contract,
.button {
  border: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 900;
}

.brand {
  padding: 8px 11px;
  background: var(--red);
  color: var(--cream);
}

nav {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 4vw, 42px);
  font-weight: 900;
  text-transform: uppercase;
}

.contract {
  padding: 8px 10px;
  background: var(--yellow);
  font-size: 0.78rem;
}

.hero,
.lore-grid,
.signal,
.reasons {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  align-items: center;
  gap: clamp(28px, 6vw, 76px);
  padding: clamp(42px, 7vw, 86px) 0 34px;
}

.kicker,
.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(4rem, 8.2vw, 8rem);
  line-height: 0.82;
  text-transform: uppercase;
}

h1 span {
  display: block;
}

h2 {
  margin: 0 0 22px;
  font-size: clamp(2.35rem, 5.6vw, 5.3rem);
  line-height: 0.9;
  text-transform: uppercase;
}

h3 {
  margin: 12px 0 10px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.lede,
.section-copy p,
.lore-grid p,
blockquote p,
.reasons p,
footer {
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  line-height: 1.55;
}

.lede {
  max-width: 650px;
  margin: 26px 0 34px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 18px;
  text-transform: uppercase;
}

.button.primary {
  background: var(--red);
  color: var(--cream);
}

.button.secondary {
  background: var(--cream);
}

.hero-art {
  margin: 0;
  display: grid;
  place-items: center;
  min-height: 520px;
}

.hero-art img {
  width: min(88vw, 560px);
  max-width: calc(100vw - 72px);
  aspect-ratio: 1;
  object-fit: cover;
  border: var(--line);
  box-shadow: 14px 14px 0 var(--ink);
  background: var(--blue);
}

.pet-frame {
  width: 192px;
  height: 208px;
  background-image: url("./assets/pikacap-spritesheet.webp");
  background-repeat: no-repeat;
  background-size: 1536px 1872px;
  image-rendering: pixelated;
  transform-origin: center;
}

.pet-companion {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 20;
  width: 192px;
  height: 208px;
  pointer-events: none;
  transform: translate3d(var(--pet-x, 28px), var(--pet-y, calc(100vh - 190px)), 0)
    scale(var(--pet-scale, 0.62));
  transform-origin: center bottom;
  transition: filter 160ms ease;
  will-change: transform;
}

.pet-companion.is-reading {
  filter: drop-shadow(0 0 0 var(--yellow)) drop-shadow(0 10px 0 rgba(23, 18, 13, 0.18));
}

.companion-frame {
  transform: none;
}

.lore-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr);
  gap: clamp(28px, 6vw, 70px);
  padding: clamp(58px, 9vw, 108px) 0;
  border-top: var(--line);
}

.terminal {
  align-self: start;
  margin: 0;
  padding: clamp(18px, 3vw, 28px);
  border: var(--line);
  background: var(--ink);
  color: #bff1c8;
  box-shadow: 10px 10px 0 var(--red);
  overflow-x: auto;
  font-size: clamp(0.88rem, 1.5vw, 1.06rem);
  line-height: 1.5;
}

.signal {
  padding: clamp(58px, 9vw, 108px) 0;
  border-top: var(--line);
}

blockquote {
  margin: 0;
  padding: clamp(22px, 4vw, 38px);
  border: var(--line);
  background: var(--cream);
  box-shadow: 10px 10px 0 var(--red);
}

blockquote p {
  margin: 0 0 18px;
  font-size: clamp(1.28rem, 3vw, 2rem);
  font-weight: 900;
}

cite {
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.reasons {
  padding: clamp(58px, 9vw, 108px) 0;
  border-top: var(--line);
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.reason-grid article {
  min-height: 260px;
  padding: 22px;
  border: var(--line);
  background: var(--cream);
}

.reason-grid span {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 42px;
  border: 3px solid var(--ink);
  background: var(--yellow);
  font-weight: 900;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(16px, 4vw, 44px);
  border-top: var(--line);
  background: var(--red-dark);
  color: var(--cream);
  font-weight: 900;
}

@media (max-width: 860px) {
  .topbar {
    display: flex;
    justify-content: space-between;
  }

  nav {
    display: none;
  }

  .contract {
    justify-self: end;
  }

  .hero,
  .lore-grid,
  .reason-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-art {
    min-height: 360px;
    order: -1;
  }

  .hero-art img {
    width: min(76vw, 350px);
    max-width: calc(100vw - 74px);
  }

  .pet-companion {
    --pet-scale: 0.38;
    --pet-x: 18px;
    --pet-y: 86px;
    z-index: 8;
  }

}

@media (max-width: 520px) {
  .topbar {
    gap: 10px;
    padding-inline: 12px;
  }

  .contract {
    max-width: 150px;
    font-size: 0.68rem;
    text-align: center;
  }

  h1 {
    font-size: clamp(3rem, 14vw, 4.6rem);
  }

  .pet-companion {
    --pet-scale: 0.34;
  }

  footer {
    display: block;
  }
}
