:root {
  --ink: #0a2438;
  --panel: #0f3559;
  --panel-2: #0c4a5c;
  --fog: #f4f8fb;
  --muted: #a8c0cc;
  --accent: #ffb200;
  --accent-dim: #e89200;
  --teal: #0b7779;
  --teal-bright: #14a3a6;
  --warn: #ffb200;
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 30px 80px rgba(4, 20, 36, 0.55);
  --font-display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fog);
  font-family: var(--font-body);
  background:
    linear-gradient(180deg, rgba(15, 53, 89, 0.92) 0%, rgba(11, 119, 121, 0.55) 100%),
    linear-gradient(160deg, #071929 0%, #0f3559 42%, #0b7779 100%);
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.55;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.04;
  mix-blend-mode: soft-light;
  z-index: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0 0;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.brand img {
  height: 2.5rem;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.95rem;
}

.nav a {
  color: var(--fog);
  text-decoration: none;
  opacity: 0.85;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--accent);
  opacity: 1;
  text-decoration: none;
}

.hero {
  min-height: calc(100vh - 5.5rem);
  display: grid;
  align-content: center;
  padding: 3.5rem 0 4rem;
  position: relative;
}

.hero-visual {
  position: absolute;
  inset: 10% -4% auto auto;
  width: min(46vw, 420px);
  aspect-ratio: 1;
  border-radius: 1.5rem;
  background:
    url("/assets/threes-icon.png") center / cover no-repeat,
    linear-gradient(180deg, #0f3559, #0b7779);
  box-shadow: var(--shadow);
  animation: drift 14s ease-in-out infinite alternate;
  z-index: -1;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  to {
    transform: translate3d(-18px, 24px, 0) rotate(4deg);
  }
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0;
  animation: rise 0.8s ease forwards 0.1s;
}

.hero h1 {
  margin: 0;
  max-width: 11ch;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 8vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  opacity: 0;
  animation: rise 0.9s ease forwards 0.2s;
}

.hero .lede {
  margin: 1.35rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  color: var(--muted);
  opacity: 0;
  animation: rise 0.9s ease forwards 0.35s;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
  opacity: 0;
  animation: rise 0.9s ease forwards 0.5s;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  padding: 0.85rem 1.35rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #1a1200;
}

.btn-primary:hover {
  background: #ffc933;
  color: #1a1200;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--fog);
  background: rgba(255, 255, 255, 0.04);
}

.btn-ghost:hover {
  border-color: rgba(255, 178, 0, 0.55);
  color: var(--accent);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

.section p {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
}

.feature-list {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
  max-width: 42rem;
}

.feature-list li {
  padding-left: 1.1rem;
  border-left: 3px solid var(--teal-bright);
  color: var(--fog);
}

.feature-list strong {
  color: var(--accent);
  font-weight: 700;
}

.page-hero {
  padding: 3rem 0 1.5rem;
}

.page-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
}

.page-hero p {
  margin: 0.85rem 0 0;
  max-width: 40rem;
  color: var(--muted);
}

.game-mark {
  display: block;
  width: min(100%, 220px);
  aspect-ratio: 1;
  margin: 1.5rem 0 0;
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
  object-fit: cover;
  animation: rise 0.9s ease forwards 0.25s;
}

.steps {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 1.25rem;
}

.steps li {
  counter-increment: step;
  background: linear-gradient(180deg, rgba(15, 53, 89, 0.85), rgba(11, 74, 92, 0.9));
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem 1.25rem 1.25rem 4.25rem;
  position: relative;
  box-shadow: var(--shadow);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 1.1rem;
  top: 1.2rem;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--accent);
  font-size: 1.1rem;
}

.steps h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.steps p,
.steps ol {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.steps ol {
  margin-top: 0.5rem;
  padding-left: 1.1rem;
}

.code {
  display: block;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.7rem;
  background: #071929;
  border: 1px solid var(--line);
  color: #d7f3f4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

.note {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 178, 0, 0.35);
  background: rgba(255, 178, 0, 0.1);
  color: #ffe2a0;
  font-size: 0.92rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
  }

  .wrap {
    width: min(100% - 1.5rem, var(--max));
  }

  .site-header {
    flex-wrap: wrap;
    align-items: center;
    row-gap: 0.75rem;
  }

  .hero {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 0 2.75rem;
  }

  .page-hero {
    padding: 1.75rem 0 1.25rem;
  }

  /* Pull the mark out of absolute overlay into normal flow under the copy */
  .hero-visual {
    position: relative;
    inset: auto;
    order: 4;
    width: min(70vw, 260px);
    margin: 1.75rem 0 0;
    opacity: 1;
    z-index: 0;
    animation: none;
  }

  .hero .eyebrow,
  .hero h1,
  .hero .lede {
    position: relative;
    z-index: 1;
    max-width: 100%;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 10vw, 2.85rem);
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .hero .cta-row {
    order: 5;
    margin-top: 1.5rem;
    width: 100%;
  }

  .cta-row .btn {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .brand img {
    height: 2.1rem;
    max-width: min(100%, 200px);
  }

  .game-mark {
    width: min(100%, 180px);
    margin-top: 1.25rem;
  }

  .page-hero h1 {
    font-size: clamp(1.75rem, 8vw, 2.25rem);
    overflow-wrap: anywhere;
  }

  .page-hero p,
  .section p,
  .steps p,
  .steps li,
  .feature-list li {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .code {
    max-width: 100%;
    overflow-x: auto;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
  }

  .steps li {
    padding-left: 1.15rem;
    padding-top: 2.6rem;
  }

  .steps li::before {
    left: 1.15rem;
    top: 1rem;
  }

  .site-footer .wrap {
    flex-direction: column;
  }
}
