/**
 * Dark, printed-page feel: deep warm ink, a serif display face, hairline rules,
 * one terracotta accent. Motion is slow and small — drifting bubbles behind the
 * page and short reveals as sections arrive.
 */

:root {
  --paper: #0d0e12;
  --paper-lift: #14161b;
  --card: #15171c;
  --ink: #f1ece3;
  --ink-2: #a8a49b;
  --ink-3: #74716b;
  --rule: #292c33;
  --rule-soft: #21242a;
  --accent: #e2683c;
  --accent-ink: #f0a184;
  --accent-soft: rgba(226, 104, 60, 0.1);
  --teal: #4fc0ae;
  --screen: #05070d;
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  background:
    radial-gradient(80% 55% at 78% -8%, rgba(226, 104, 60, 0.09), transparent 62%),
    radial-gradient(64% 45% at 8% 4%, rgba(79, 192, 174, 0.07), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

a {
  color: inherit;
}

/* --------------------------- drifting background -------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.backdrop span {
  position: absolute;
  bottom: -22vh;
  border-radius: 50%;
  border: 1px solid rgba(79, 192, 174, 0.16);
  background: radial-gradient(
    circle at 34% 30%,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(79, 192, 174, 0.05) 45%,
    rgba(226, 104, 60, 0.04) 100%
  );
  animation: rise linear infinite;
  will-change: transform;
}

/* Sizes and lanes live here rather than in style attributes, so the page needs
   no inline styles and the CSP can stay strict. */
.b1 { left: 6%; width: 92px; height: 92px; animation-duration: 31s; --sway: 34px; }
.b2 { left: 18%; width: 44px; height: 44px; animation-duration: 24s; animation-delay: -6s; --sway: -22px; }
.b3 { left: 31%; width: 128px; height: 128px; animation-duration: 42s; animation-delay: -18s; --sway: 40px; }
.b4 { left: 47%; width: 60px; height: 60px; animation-duration: 27s; animation-delay: -11s; --sway: -30px; }
.b5 { left: 63%; width: 104px; height: 104px; animation-duration: 36s; animation-delay: -24s; --sway: 26px; }
.b6 { left: 76%; width: 38px; height: 38px; animation-duration: 22s; animation-delay: -4s; --sway: -18px; }
.b7 { left: 88%; width: 78px; height: 78px; animation-duration: 33s; animation-delay: -15s; --sway: 30px; }

@keyframes rise {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(var(--sway, 26px), -128vh, 0);
  }
}

/* A whisper of tooth on the surface, so large flats do not read as flat digital. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
}

.page {
  position: relative;
  z-index: 2;
}

/* --------------------------------- header --------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px clamp(18px, 5vw, 56px);
  background: rgba(13, 14, 18, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: -0.01em;
}

.wordmark svg {
  width: 24px;
  height: 24px;
}

.masthead-right {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 20px);
}

.quiet-link {
  text-decoration: none;
  font-size: 14px;
  color: var(--ink-2);
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition:
    background-size 0.28s ease,
    color 0.2s ease;
}

.quiet-link:hover {
  color: var(--ink);
  background-size: 100% 1px;
}

/* -------------------------------- account --------------------------------- */

.account {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  font-size: 13.5px;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  object-fit: cover;
  background: var(--paper-lift);
}

.who {
  color: var(--ink-2);
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-x,
.btn-plain {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #0d0e12;
  font: inherit;
  font-size: 13.5px;
  font-weight: 560;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    opacity 0.2s ease,
    background 0.2s ease;
}

.btn-x svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.btn-x:hover,
.btn-plain:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.btn-plain {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--rule);
}

.btn-plain:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.name-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

.name-form input {
  width: 122px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--paper-lift);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
}

.name-form input::placeholder {
  color: var(--ink-3);
}

.name-form input:focus-visible {
  outline: 2px solid rgba(226, 104, 60, 0.5);
  outline-offset: 1px;
}

/* ---------------------------------- shell --------------------------------- */

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(18px, 5vw, 56px);
}

.eyebrow {
  display: block;
  margin-bottom: 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--accent-ink);
}

/* ---------------------------------- hero ---------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: clamp(30px, 5vw, 70px);
  align-items: center;
  padding: clamp(44px, 9vh, 104px) 0 clamp(40px, 7vh, 80px);
}

.hero h1 {
  font-size: clamp(38px, 6.2vw, 70px);
}

.hero h1 em {
  font-style: italic;
  color: var(--accent-ink);
}

.lede {
  margin: 22px 0 0;
  max-width: 44ch;
  font-size: clamp(15.5px, 1.5vw, 17.5px);
  color: var(--ink-2);
}

/* segmented mode picker */

.picker {
  margin: 30px 0 26px;
}

.picker-label {
  display: block;
  margin-bottom: 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.segments {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-lift);
  gap: 2px;
}

.segment {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 9px 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 14px;
  font-weight: 520;
  transition:
    color 0.2s ease,
    background 0.25s ease;
}

.segment:hover {
  color: var(--ink);
}

.segment.is-on {
  background: var(--ink);
  color: #0d0e12;
}

.segment-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-3);
  min-height: 1.4em;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 27px;
  border-radius: 999px;
  background: var(--accent);
  color: #150803;
  text-decoration: none;
  font-size: 15.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px -14px rgba(226, 104, 60, 0.8);
  transition:
    transform 0.18s ease,
    box-shadow 0.22s ease,
    background 0.2s ease;
}

.cta:hover {
  transform: translateY(-2px);
  background: #ef7448;
  box-shadow: 0 18px 38px -14px rgba(226, 104, 60, 0.9);
}

.cta:active {
  transform: translateY(0) scale(0.99);
}

.cta svg {
  width: 15px;
  height: 15px;
  transition: transform 0.22s ease;
}

.cta:hover svg {
  transform: translateX(3px);
}

.assure {
  margin: 22px 0 0;
  max-width: 42ch;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

/* the screen the game runs in */

.screen {
  margin: 0;
}

.screen-frame {
  padding: 9px;
  border-radius: 22px;
  border: 1px solid var(--rule);
  background: var(--paper-lift);
  box-shadow:
    0 40px 80px -50px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.screen-frame svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 15px;
  background: var(--screen);
}

.screen figcaption {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
}

/* animated bits inside the mock */

.mock-tip {
  animation: tip 2.4s ease-in-out infinite;
  transform-origin: center;
}

@keyframes tip {
  50% {
    r: 13;
    opacity: 0.85;
  }
}

.mock-slash {
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: slash 4.5s ease-in-out infinite;
}

@keyframes slash {
  10% {
    stroke-dashoffset: 0;
  }
  45% {
    stroke-dashoffset: 0;
    opacity: 1;
  }
  60% {
    opacity: 0;
  }
  61% {
    stroke-dashoffset: 260;
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.mock-float {
  animation: mockfloat 6s ease-in-out infinite;
}

.mock-float-2 {
  animation: mockfloat 7.5s ease-in-out infinite reverse;
}

@keyframes mockfloat {
  50% {
    transform: translateY(-9px);
  }
}

.mock-fuse {
  animation: fuse 1.1s ease-in-out infinite;
  transform-origin: center;
}

@keyframes fuse {
  50% {
    opacity: 0.45;
  }
}

/* -------------------------------- sections -------------------------------- */

.band {
  padding: clamp(46px, 8vh, 92px) 0;
  border-top: 1px solid var(--rule);
}

.band h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  max-width: 22ch;
}

.band-intro {
  margin: 14px 0 0;
  max-width: 52ch;
  color: var(--ink-2);
  font-size: 15px;
}

/* numbered how-to list */

.steps {
  list-style: none;
  margin: 38px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(28px, 5vw, 72px);
}

.steps li {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 4px 14px;
  padding: 22px 0;
  border-top: 1px solid var(--rule-soft);
}

.steps li:first-child,
.steps li:nth-child(2) {
  border-top: 0;
  padding-top: 0;
}

.step-num {
  grid-row: span 2;
  font-family: var(--serif);
  font-size: 27px;
  color: var(--accent-ink);
  line-height: 1;
  padding-top: 2px;
}

.steps h3 {
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 620;
  letter-spacing: 0;
}

.steps p {
  margin: 5px 0 0;
  font-size: 14px;
  color: var(--ink-2);
}

.aside {
  margin: 30px 0 0;
  padding: 16px 20px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  color: #f3c9b6;
  max-width: 74ch;
}

/* object rundown */

.things {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 36px;
  border-top: 1px solid var(--rule);
}

.thing {
  padding: 24px clamp(12px, 2vw, 22px) 6px;
  border-right: 1px solid var(--rule-soft);
}

.thing:last-child {
  border-right: 0;
}

.thing svg {
  width: 62px;
  height: 62px;
  margin-bottom: 12px;
}

.thing h3 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 620;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.thing p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.thing-rule {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  background: var(--paper-lift);
}

.thing-danger .thing-rule {
  border-color: rgba(226, 104, 60, 0.42);
  color: var(--accent-ink);
  background: var(--accent-soft);
}

/* closing */

.closing {
  padding: clamp(52px, 9vh, 104px) 0;
  border-top: 1px solid var(--rule);
  text-align: center;
}

.closing h2 {
  margin: 0 auto;
  max-width: 26ch;
  font-size: clamp(28px, 4vw, 46px);
}

.closing h2 em {
  font-style: italic;
  color: var(--accent-ink);
}

.closing p {
  margin: 16px auto 30px;
  max-width: 44ch;
  color: var(--ink-2);
  font-size: 15px;
}

.best-note {
  margin: 26px 0 0;
  font-size: 13px;
  color: var(--ink-3);
}

/* --------------------------------- footer --------------------------------- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 30px 0 52px;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px 40px;
}

.foot p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
  max-width: 46ch;
}

.foot strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.foot a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.foot a:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.foot-legal {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-3);
}

/* ------------------------------ legal pages ------------------------------- */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 7vh, 76px) clamp(18px, 5vw, 56px) clamp(50px, 8vh, 96px);
}

.doc h1 {
  font-size: clamp(30px, 4.4vw, 46px);
}

.doc-meta {
  margin: 14px 0 34px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.doc h2 {
  margin: 38px 0 12px;
  font-size: clamp(19px, 2.2vw, 24px);
}

.doc h3 {
  margin: 24px 0 8px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 620;
  letter-spacing: 0;
}

.doc p,
.doc li {
  color: var(--ink-2);
  font-size: 14.5px;
}

.doc ul {
  padding-left: 20px;
}

.doc li {
  margin-bottom: 7px;
}

.doc strong {
  color: var(--ink);
  font-weight: 600;
}

.doc a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(226, 104, 60, 0.35);
}

.doc a:hover {
  border-color: var(--accent);
}

.doc-note {
  margin: 26px 0;
  padding: 16px 20px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  font-size: 13.5px;
  color: #f3c9b6;
}

.doc-note p {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.doc pre {
  overflow-x: auto;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper-lift);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* --------------------------------- reveals -------------------------------- */

/*
 * Reveals are an enhancement, never a gate on content: the hidden state only
 * applies once the init script has confirmed JS and that motion is welcome.
 * Without it (JS off, old browser, reduced motion) everything is simply visible.
 */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.js-reveal [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ------------------------------- responsive ------------------------------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 34px;
  }

  .screen {
    order: -1;
  }

  .steps,
  .things {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .thing:nth-child(2) {
    border-right: 0;
  }

  .thing:nth-child(3),
  .thing:nth-child(4) {
    border-top: 1px solid var(--rule-soft);
  }
}

@media (max-width: 560px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps li:nth-child(2) {
    border-top: 1px solid var(--rule-soft);
    padding-top: 22px;
  }

  .things {
    grid-template-columns: minmax(0, 1fr);
  }

  .thing {
    border-right: 0;
    border-top: 1px solid var(--rule-soft);
  }

  .thing:first-child {
    border-top: 0;
  }

  .segments {
    width: 100%;
    justify-content: space-between;
  }

  .segment {
    flex: 1;
    padding: 9px 8px;
  }

  .who {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .backdrop {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .js-reveal [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
