/* Retry Pigeon — one-page site. Palette and type follow brand/brand-guide.md. */

:root {
  --orange: #FF7A1A;
  --orange-ink: #C2410C;     /* orange dark enough for small text on cream */
  --red: #E5484D;
  --teal: #22B39A;
  --violet: #7C5CE0;

  --bg: #FFF3DC;
  --bg-alt: #FFE9C4;
  --surface: #FFFBF3;
  --text: #23262F;
  --muted: #5B6070;
  --line: #23262F;
  --disc: #FFE2B0;
  --shadow: 6px 6px 0 var(--line);

  --font-display: "Bricolage Grotesque", "Arial Black", "Segoe UI Black", Impact, sans-serif;
  --font-body: Inter, system-ui, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;

  --radius: 18px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --orange-ink: #FF9A4D;
    --bg: #15171C;
    --bg-alt: #1B1E25;
    --surface: #1F222A;
    --text: #F4EEE3;
    --muted: #A9ADBA;
    --line: #0B0C0F;
    --disc: #2A2D36;
    --shadow: 6px 6px 0 #000;
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: inherit; }

.container { width: min(1120px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.narrow { width: min(780px, 100% - 2 * var(--gutter)); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--orange); color: #1b1b1b; padding: 10px 14px; border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid color-mix(in srgb, var(--text) 12%, transparent);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.15rem var(--font-display); letter-spacing: .02em; }
.brand b { color: var(--orange); }
.brand img { width: 40px; height: 40px; }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 8px 12px; border-radius: 999px;
}
.site-nav a:hover { background: color-mix(in srgb, var(--orange) 18%, transparent); }

.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  border: 2px solid var(--text); background: var(--surface); cursor: pointer; position: relative;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 10px; right: 10px; height: 2.5px; background: var(--text); border-radius: 2px; content: "";
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bar { top: 50%; transform: translateY(-50%); }
.nav-toggle-bar::before { left: 0; right: 0; top: -7px; }
.nav-toggle-bar::after { left: 0; right: 0; top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 14px;
  font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer;
  border: 2.5px solid var(--line);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary { background: var(--orange); color: #1b1b1b; box-shadow: 4px 4px 0 var(--line); }
.btn-primary:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--line); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--text); }
.btn-ghost:hover { background: color-mix(in srgb, var(--orange) 15%, var(--surface)); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-wide { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: clamp(32px, 6vw, 72px) 0 0; overflow-x: clip; /* the spinning arrow's corners must not widen the page */ }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.kicker { font: 500 .95rem var(--font-mono); color: var(--muted); }
.ticker { color: var(--orange-ink); font-weight: 700; }
.accent { color: var(--orange); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.lead strong { color: var(--text); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }

.status-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 2.5px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); max-width: 34em;
}
.status-card p { margin: 0; }
.status-title { font-weight: 600; }
.status-text { font-size: .95rem; color: var(--muted); }
.status-dot {
  flex: none; width: 14px; height: 14px; margin-top: 6px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange) 60%, transparent);
  animation: pulse 2s infinite;
}

.hero-art { position: relative; aspect-ratio: 1; width: 100%; max-width: 520px; justify-self: center; }
.hero-disc { position: absolute; inset: 3%; border-radius: 50%; background: var(--disc); }
.hero-arrow, .hero-pigeon { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-arrow { animation: spin 14s linear infinite; }
.hero-pigeon { animation: bob 3.2s ease-in-out infinite; transform-origin: 50% 85%; }

.ticker-tape {
  margin-top: clamp(32px, 5vw, 64px);
  background: var(--text); color: var(--bg);
  border-block: 2.5px solid var(--line); overflow: hidden;
  font: 500 .95rem var(--font-mono);
}
.ticker-track { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.ticker-track span { padding: 12px 22px; white-space: nowrap; }
.ticker-track span:nth-child(even) { color: var(--orange); }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-alt { background: var(--bg-alt); border-block: 2px solid color-mix(in srgb, var(--text) 10%, transparent); }
.eyebrow { font: 500 .85rem var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--orange-ink); margin-bottom: .6em; }
.section-lead { font-size: 1.1rem; color: var(--muted); max-width: 40em; margin-bottom: 2em; }

/* Story */
.attempts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.attempt {
  position: relative; background: var(--surface); border: 2.5px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px 56px; box-shadow: var(--shadow);
}
.attempt p { color: var(--muted); font-size: .97rem; }
.attempt-no { font: 500 .85rem var(--font-mono); color: var(--muted); display: block; margin-bottom: 8px; }
.tag { position: absolute; left: 18px; bottom: 16px; font: 500 .8rem var(--font-mono); padding: 4px 10px; border-radius: 999px; border: 2px solid currentColor; }
.tag-fail { color: var(--red); }
.tag-retry { color: var(--teal); }

/* Crumb Run */
.game-grid { display: grid; grid-template-columns: 1fr minmax(0, 480px); gap: clamp(24px, 4vw, 56px); align-items: start; }
.game-help { margin: 0 0 16px; color: var(--muted); font-size: .95rem; }
.game-stats, .game-counters { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 16px; }
.game-stats div, .game-counters div { flex: 1 1 92px; padding: 8px 14px; background: var(--surface); border: 2.5px solid var(--line); border-radius: 12px; }
.game-stats dt, .game-counters dt { font: 500 .72rem var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.game-stats dd, .game-counters dd { margin: 0; font: 800 1.35rem var(--font-display); overflow-wrap: anywhere; }
.game-counters[hidden] { display: none; }
.account { margin-bottom: 16px; }
.account-offline { margin: 0; padding: 12px 14px; border: 2px dashed color-mix(in srgb, var(--text) 35%, transparent); border-radius: 12px; color: var(--muted); font-size: .95rem; }
.auth, .profile { display: grid; gap: 12px; padding: 18px 20px; background: var(--surface); border: 2.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth[hidden], .profile[hidden], .account-offline[hidden] { display: none; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-tab { min-height: 44px; border: 2.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: 700 .95rem var(--font-body); cursor: pointer; }
.auth-tab[aria-pressed="true"] { background: var(--orange); color: #1b1b1b; }
.auth-field { display: grid; gap: 6px; font: 500 .8rem var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.auth-field[hidden], .auth-accept[hidden], .auth-hint[hidden] { display: none; }
.auth-field input { width: 100%; min-width: 0; min-height: 46px; padding: 10px 14px; border: 2.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: 600 1rem var(--font-body); text-transform: none; letter-spacing: normal; }
.auth-field input:focus-visible, .auth-tab:focus-visible, .auth-accept input:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.auth-hint { margin: -6px 0 0; color: var(--muted); font-size: .86rem; }
.auth-warn { margin: 0; color: color-mix(in srgb, var(--red) 78%, var(--text)); font-weight: 600; font-size: .9rem; }
.auth-accept { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; cursor: pointer; }
.auth-accept input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--orange); }
.auth-error { margin: 0; color: color-mix(in srgb, var(--red) 78%, var(--text)); font-weight: 600; font-size: .92rem; }
.auth-error:empty { display: none; }
.profile h3 { margin: 0; }
.profile-track { height: 14px; overflow: hidden; border: 2.5px solid var(--line); border-radius: 999px; background: var(--bg-alt); }
.profile-bar { width: 0; height: 100%; background: var(--orange); transition: width .3s ease; }
.profile-claim { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--teal) 22%, var(--surface)); font-weight: 600; }
.profile-empty { margin: 0; color: var(--muted); }
.profile-claim[hidden], .profile-empty[hidden] { display: none; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-delete, .privacy { margin: 0; padding: 0 14px; border-width: 2px; border-radius: 12px; font-size: .92rem; }
.privacy { margin-top: 12px; }
.profile-delete summary, .privacy summary { padding: 10px 0; }
.profile-delete form { display: grid; gap: 10px; padding-bottom: 14px; }
.privacy p { margin-top: 0; font-size: .88rem; }
.contest { padding: 18px 20px; background: var(--surface); border: 2.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.contest h3 { margin-bottom: .35em; }
.contest a { color: var(--orange-ink); font-weight: 600; }
.contest ol { margin: 0 0 12px; padding-left: 1.3em; display: grid; gap: 6px; }
.contest-status { margin: 0 0 12px; color: var(--muted); }
.contest-small { margin: 0 0 10px; color: var(--muted); font-size: .86rem; }
.contest-warn { margin: 0; color: color-mix(in srgb, var(--red) 78%, var(--text)); font-weight: 600; font-size: .92rem; }
.game-card { min-width: 0; position: sticky; top: 84px; } /* the board stays in view beside the long rules column */
.game-stage {
  position: relative; width: min(100%, 480px, calc(88svh * .75)); aspect-ratio: 3 / 4; margin-inline: auto; overflow: hidden;
  border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: #FFF3DC;
}
#game-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
.game-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: clamp(14px, 4vw, 24px);
  background: color-mix(in srgb, var(--surface) 84%, transparent); text-align: center;
}
.game-overlay[hidden], .game-share[hidden] { display: none; }
.game-overlay h3 { margin: 0; font-size: clamp(1.7rem, 7vw, 2.4rem); }
.game-log {
  margin: 0; padding: 12px 14px; border-radius: 12px; background: #15171C; color: #F4EEE3; text-align: left;
  font: 500 clamp(.74rem, 2.6vw, .88rem)/1.55 var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere;
}
.game-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.game-share { color: var(--orange-ink); font-weight: 600; }

/* Token */
.ca-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 2.5px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); margin-bottom: 28px;
}
.ca-label { margin: 0 0 4px; font: 500 .8rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ca-value { font: 500 1.05rem var(--font-mono); word-break: break-all; }
.ca-links { margin: -14px 0 28px; font-size: .95rem; color: var(--muted); }
.ca-links a { color: var(--orange-ink); font-weight: 600; }
.ca-inline { font: 500 .9em var(--font-mono); word-break: break-all; }
.status-card.is-live .status-dot { background: var(--teal); animation: none; }
.facts { list-style: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.facts li { background: var(--surface); border: 2px solid color-mix(in srgb, var(--text) 18%, transparent); border-radius: 16px; padding: 18px; }
.facts h3 { font-size: 1.05rem; margin-bottom: .4em; }
.facts p { margin: 0; color: var(--muted); font-size: .95rem; }
.disclaimer {
  border: 2.5px dashed var(--red); border-radius: var(--radius); padding: 18px 20px;
  background: color-mix(in srgb, var(--red) 8%, var(--surface)); font-size: .98rem;
}

/* Memes */
.meme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0 0 24px; }
.meme-grid figure { margin: 0; border: 2.5px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.kit-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* How it works */
.how-steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.how-steps li { background: var(--surface); border: 2.5px solid var(--line); border-radius: var(--radius); padding: 20px 18px; box-shadow: var(--shadow); }
.how-steps p { margin: 0; color: var(--muted); font-size: .97rem; }
.how-no { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; border-radius: 50%; border: 2.5px solid var(--line); background: var(--orange); color: #1b1b1b; font: 800 1.15rem var(--font-display); }
.how-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how-card { background: var(--surface); border: 2px solid color-mix(in srgb, var(--text) 18%, transparent); border-radius: 16px; padding: 18px; color: var(--muted); font-size: .97rem; }
.how-card h3 { color: var(--text); }
.how-card p { margin: 0; }
.how-card ul, .how-card ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.how-card a { color: var(--orange-ink); font-weight: 600; }
.how-card .how-note { margin-top: 12px; font-size: .88rem; }

/* Flight plan: pins on a dashed route, zigzag on wide screens (see the 801px query below) */
.route { position: relative; list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.route::before { content: ""; position: absolute; top: 12px; bottom: 12px; left: 22px; border-left: 4px dashed color-mix(in srgb, var(--text) 30%, transparent); }
.stop { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: start; }
.stop-pin { position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: 50%; border: 3px solid var(--line); background: var(--surface); color: var(--text); font: 800 1.15rem var(--font-display); }
.stop-pin img { width: 100%; height: 100%; }
.stop.done .stop-pin { background: var(--teal); color: #10201c; }
.stop.now .stop-pin { background: var(--disc); box-shadow: 0 0 0 5px color-mix(in srgb, var(--orange) 45%, transparent); }
.stop-card { background: var(--surface); border: 2px solid color-mix(in srgb, var(--text) 18%, transparent); border-radius: 16px; padding: 16px 18px; }
.stop.now .stop-card { border: 2.5px solid var(--orange); }
.stop-card h3 { margin-bottom: .3em; }
.stop-card p { margin: 0; color: var(--muted); font-size: .97rem; }
.stop-status { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; border: 2px solid var(--muted); color: var(--muted); font: 500 .78rem var(--font-mono); }
.stop.done .stop-status { border-color: var(--teal); color: var(--teal); }
.stop.now .stop-status { border-color: var(--orange); color: var(--orange-ink); }

@media (min-width: 801px) {
  .route::before { left: 50%; margin-left: -2px; }
  .stop { grid-template-columns: 1fr 48px 1fr; }
  .stop-pin { grid-column: 2; grid-row: 1; }
  .stop-card { grid-column: 1; grid-row: 1; }
  .stop:nth-child(even) .stop-card { grid-column: 3; }
}

/* FAQ */
details { background: var(--surface); border: 2.5px solid var(--line); border-radius: 16px; padding: 0 20px; margin-bottom: 12px; }
summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "↻"; color: var(--orange); font-weight: 700; transition: transform .25s ease; }
details[open] summary::after { transform: rotate(180deg); }
details p { color: var(--muted); padding-bottom: 6px; }

/* Footer */
.site-footer { background: var(--text); color: var(--bg); padding: 40px 0; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px 32px; align-items: center; }
.footer-logo { background: #FFF3DC; border-radius: 12px; padding: 6px 10px; width: 240px; }
.footer-tag { margin: 10px 0 0; font: 500 .9rem var(--font-mono); opacity: .8; }
.footer-links { display: flex; gap: 10px; flex-wrap: wrap; }
.soon { font: 500 .85rem var(--font-mono); border: 2px solid color-mix(in srgb, var(--bg) 40%, transparent); border-radius: 999px; padding: 6px 12px; opacity: .85; color: inherit; text-decoration: none; }
a.soon:hover { opacity: 1; border-color: var(--orange); }
.footer-legal { grid-column: 1 / -1; margin: 0; font-size: .85rem; opacity: .75; }

/* ---------- Animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2.5%) rotate(-2deg); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange) 55%, transparent); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .attempts, .facts, .how-steps { grid-template-columns: repeat(2, 1fr); }
  .how-cards { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: minmax(0, 1fr); }
  .game-card { order: -1; position: static; }
}

/* Seven nav links stop fitting beside the logo below this width. */
@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px;
    background: var(--bg); border-bottom: 2px solid color-mix(in srgb, var(--text) 12%, transparent);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 14px 12px; font-size: 1.05rem; }
}

@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 300px; }
  .meme-grid { grid-template-columns: 1fr; max-width: 440px; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .attempts, .facts, .how-steps { grid-template-columns: 1fr; }
  .cta-row .btn { flex: 1 1 100%; }
  .game-counters div:last-child { flex-basis: 100%; }
}
