/* Chainmaker marketing site — split-flap "airport board" aesthetic.
   Palette mirrors the app (shell/game/assets/theme.ts). */

:root {
  --bg: #0e0e0e;
  --bg-pure: #000000;
  --tile: #272725;
  --tile-outline: #40403f;
  --cyan: #22d3ee;   /* "CHAIN" / brand accent */
  --green: #8ad27c;  /* "MAKER" / target */
  --tan: #beaf88;
  --text: #f2f6fc;
  --text-dim: #9ca3af;
  --radius: 14px;
  --maxw: 1040px;
  --mono: "SF Mono", "Helvetica Neue", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Split-flap wordmark ---------- */
.board { display: inline-flex; gap: 3px; flex-wrap: nowrap; justify-content: center; max-width: 100%; }
.tile {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05em;
  height: 1.4em;
  background: var(--tile);
  border: 1px solid var(--tile-outline);
  border-radius: 0.16em;
  font-family: var(--mono);
  font-weight: 700;
  overflow: hidden;
  text-transform: uppercase;
}
.tile::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--tile-outline);
}
.tile.cyan { color: var(--cyan); }
.tile.green { color: var(--green); }

/* ---------- Nav ---------- */
header.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.5px; font-size: 18px; }
.nav-brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav-brand .c { color: var(--cyan); }
.nav-brand .m { color: var(--green); }
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--text-dim); font-size: 15px; font-weight: 600; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.btn, .nav-links a.btn:hover { color: #0e0e0e; }
.btn .apple { width: 1.1em; height: 1.1em; flex: none; margin-top: -2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green);
  color: #0e0e0e;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 13px 22px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
}
.btn:hover { text-decoration: none; opacity: 0.9; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--tile-outline); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 88px 0 56px; background: radial-gradient(900px 500px at 50% -10%, rgba(34,211,238,0.08), transparent 70%); }
.hero .board { font-size: clamp(34px, 8vw, 72px); margin-bottom: 22px; }
.hero .tagline { font-size: clamp(18px, 3vw, 24px); color: var(--text); font-weight: 600; margin: 0 auto 10px; max-width: 660px; }
.hero .sub { color: var(--text-dim); max-width: 560px; margin: 0 auto 28px; font-size: 17px; }
.hero .cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
section h2 { font-size: clamp(24px, 4vw, 34px); text-align: center; margin: 0 0 8px; }
section .lead { text-align: center; color: var(--text-dim); max-width: 620px; margin: 0 auto 40px; }

/* How it works — the chain example */
.chain { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chain .link { font-family: var(--mono); font-size: clamp(18px, 4.5vw, 30px); font-weight: 800; letter-spacing: 1px; }
.chain .arrow { color: var(--text-dim); font-size: 18px; }
.chain .head { color: var(--cyan); }
.chain .tail { color: var(--tan); }
.chain .joint { color: var(--green); }
.chain .goal .head { color: var(--green); }
.chain .goal .tail { color: var(--cyan); }

/* Features grid */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.feature {
  background: var(--tile);
  border: 1px solid var(--tile-outline);
  border-radius: var(--radius);
  padding: 22px;
}
.feature .ico { font-size: 28px; }
.feature h3 { margin: 12px 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--text-dim); font-size: 15px; }

/* Screenshots */
.shots { display: flex; flex-wrap: wrap; justify-content: center; gap: 32px; padding: 8px 4px 16px; }
.phone {
  flex: 0 0 auto;
  width: 240px;
  aspect-ratio: 9 / 19.5;
  border-radius: 28px;
  border: 8px solid #1a1a1a;
  background: #000;
  scroll-snap-align: center;
  object-fit: cover;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.phone.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-dim);
  border-style: dashed;
  border-color: var(--tile-outline);
  font-size: 13px;
  padding: 16px;
}
.phone.placeholder code { color: var(--cyan); font-size: 11px; display: block; margin-top: 8px; word-break: break-all; }

/* CTA band */
.band { text-align: center; background: var(--bg-pure); border-top: 1px solid rgba(255,255,255,0.06); border-bottom: 1px solid rgba(255,255,255,0.06); }

#screenshots { background: var(--tile); border-top: 1px solid rgba(255,255,255,0.06); border-bottom: 1px solid rgba(255,255,255,0.06); }

.video-demo {
  display: block;
  max-width: 320px;
  width: 100%;
  height: auto;
  border-radius: 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

/* ---------- Legal / content pages ---------- */
.doc { padding: 56px 0 80px; max-width: 760px; }
.doc h1 { font-size: 34px; margin-bottom: 4px; }
.doc .updated { color: var(--text-dim); font-style: italic; margin-bottom: 28px; }
.doc h2 { font-size: 20px; margin: 30px 0 10px; }
.doc p, .doc li { color: #cdd3dc; font-size: 16px; }
.doc ul { padding-left: 20px; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 32px 0;
  color: var(--text-dim);
  font-size: 14px;
}
.foot-inner { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--text-dim); }
.foot-links a:hover { color: var(--text); text-decoration: none; }

/* ---------- Mobile nav (hamburger) ---------- */
.nav-toggle { display: none; }
.nav-burger { display: none; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; padding: 8px; cursor: pointer; }
.nav-burger span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 640px) {
  .nav-burger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links a { padding: 13px 24px; font-size: 16px; }
  .nav-links a.btn { margin: 8px 24px; justify-content: center; }
  .hero .board { font-size: clamp(18px, 7.2vw, 72px); }
}
