/* Hex King website: hexking.app (landing) and hexking.app/get (download).
   No external requests: system fonts, local images, no trackers. */

:root {
  --ink: #2a1d14;
  --ink-soft: #5a4433;
  --cream: #f6e7bf;
  --cream-hi: #fff6dc;
  --gold: #ebb94a;
  --gold-hi: #ffe08a;
  --gold-deep: #b97a17;
  --red: #d8372f;
  --royal: #2c3f9e;
  --white: #fffaf0;

  --sky-top: #63c1ff;
  --sky-bot: #cfeeff;
  --cloud: #ffffff;
  --cloud-shade: #d9ecfb;
  --land: #63b33d;
  --land-deep: #3e8a28;
  --sea: #1f72b4;
  --sea-deep: #134f86;
  --stone: #efe3c7;
  --stone-deep: #e1cfa4;
  --on-dark: #fff8e6;
  --star-opacity: 0;
  --hex-line: rgba(255, 255, 255, .35);

  --display: "Rockwell Extra Bold", "Rockwell", "Roboto Slab", "Zilla Slab", "Georgia", "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Menlo", "Consolas", "DejaVu Sans Mono", "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;

  --radius: 0px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
  color-scheme: light;
}

/* Night: the game has a day and a night; so does the site. */
:root[data-theme="night"] {
  --sky-top: #070d26;
  --sky-bot: #1d2a57;
  --cloud: #3a4672;
  --cloud-shade: #2a3459;
  --land: #24562c;
  --land-deep: #173d1e;
  --sea: #0e3157;
  --sea-deep: #08203b;
  --stone: #2b2419;
  --stone-deep: #221c13;
  --star-opacity: 1;
  --hex-line: rgba(255, 224, 138, .16);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) {
    --sky-top: #070d26;
    --sky-bot: #1d2a57;
    --cloud: #3a4672;
    --cloud-shade: #2a3459;
    --land: #24562c;
    --land-deep: #173d1e;
    --sea: #0e3157;
    --sea-deep: #08203b;
    --stone: #2b2419;
    --stone-deep: #221c13;
    --star-opacity: 1;
    --hex-line: rgba(255, 224, 138, .16);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--sky-bot);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color .8s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Sky, stars and clouds ---------- */
.sky {
  position: relative;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bot) 100%);
  transition: background .8s ease;
  isolation: isolate;
}
.sky::before { /* stars */
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--star-opacity);
  transition: opacity .8s ease;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 28% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.8px 1.8px at 44% 22%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 63% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 78% 28%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 90% 9%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 6% 44%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 55% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 85% 52%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 35% 58%, #fff 50%, transparent 51%);
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { filter: brightness(.7); } to { filter: brightness(1.3); } }

#hexfield { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

.clouds { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.cloud {
  position: absolute;
  width: var(--w, 180px); height: calc(var(--w, 180px) * .32);
  background: var(--cloud);
  border-radius: 999px;
  box-shadow: inset 0 -10px 0 var(--cloud-shade);
  opacity: .92;
  animation: drift var(--t, 70s) linear infinite;
  animation-delay: var(--d, 0s);
  transition: background .8s ease, box-shadow .8s ease;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: inherit; border-radius: 50%;
}
.cloud::before { width: 46%; height: 140%; left: 14%; bottom: 30%; }
.cloud::after { width: 34%; height: 110%; right: 16%; bottom: 36%; }
@keyframes drift {
  from { transform: translateX(-30vw); }
  to { transform: translateX(130vw); }
}

/* The fog of war parts when the page opens. */
.fog { position: absolute; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.fog span {
  position: absolute; top: -10%; bottom: -10%; width: 70%;
  background:
    radial-gradient(closest-side, var(--cloud) 72%, transparent 100%) 0 0 / 260px 220px,
    var(--cloud);
  filter: blur(2px);
  animation: fog-open 1.6s cubic-bezier(.7, 0, .2, 1) .25s forwards;
}
.fog span:first-child { left: -8%; border-radius: 0 50% 50% 0; }
.fog span:last-child { right: -8%; border-radius: 50% 0 0 50%; animation-name: fog-open-r; }
@keyframes fog-open { to { transform: translateX(-110%); opacity: 0; } }
@keyframes fog-open-r { to { transform: translateX(110%); opacity: 0; } }

/* ---------- Game-style frames ---------- */
.panel {
  position: relative;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: inset 0 -5px 0 rgba(42, 29, 20, .12), 0 10px 0 rgba(0, 0, 0, .12);
}
.panel::before, .btn::before { /* the corner studs from the game's frames */
  content: "";
  position: absolute; inset: -6px;
  pointer-events: none;
  --s: 9px;
  background:
    linear-gradient(var(--cream-hi), var(--cream-hi)) 3px 3px / 3px 3px no-repeat,
    linear-gradient(var(--cream-hi), var(--cream-hi)) calc(100% - 3px) 3px / 3px 3px no-repeat,
    linear-gradient(var(--cream-hi), var(--cream-hi)) 3px calc(100% - 3px) / 3px 3px no-repeat,
    linear-gradient(var(--cream-hi), var(--cream-hi)) calc(100% - 3px) calc(100% - 3px) / 3px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 0 / var(--s) var(--s) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 0 / var(--s) var(--s) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 100% / var(--s) var(--s) no-repeat,
    linear-gradient(var(--ink), var(--ink)) 100% 100% / var(--s) var(--s) no-repeat;
}

.chip {
  display: inline-flex; align-items: center; gap: .45em;
  font-family: var(--mono); font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  padding: .3em .7em;
  background: var(--cream-hi);
  border: 2px solid var(--ink);
  color: var(--ink);
  white-space: nowrap;
}
.chip svg { width: 1.1em; height: 1.1em; }

/* Buttons: the game's gold buttons with a pressed state. */
.btn {
  --face: var(--gold);
  position: relative;
  display: inline-flex; align-items: center; gap: .75rem;
  padding: .7rem 1.2rem .8rem;
  font-family: var(--mono); font-weight: 700; font-size: 1rem;
  color: var(--ink); text-decoration: none;
  background: var(--face);
  border: 3px solid var(--ink);
  box-shadow: inset 0 -6px 0 rgba(42, 29, 20, .22), inset 0 3px 0 rgba(255, 255, 255, .35), 0 6px 0 var(--ink);
  cursor: pointer;
  transform: translateY(0);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.06) saturate(1.05); transform: translateY(-2px); box-shadow: inset 0 -6px 0 rgba(42, 29, 20, .22), inset 0 3px 0 rgba(255, 255, 255, .35), 0 8px 0 var(--ink); }
.btn:active { transform: translateY(5px); box-shadow: inset 0 -3px 0 rgba(42, 29, 20, .22), inset 0 3px 0 rgba(255, 255, 255, .35), 0 1px 0 var(--ink); }
.btn.cream { --face: var(--cream); }
.btn.small { padding: .45rem .8rem .55rem; font-size: .88rem; gap: .45rem; }
.btn.small::before { --s: 7px; inset: -5px; }

.store {
  min-width: 248px;
  padding: .65rem 1.2rem .8rem .9rem;
  overflow: hidden;
}
.store .glyph {
  flex: none;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  background: var(--ink); color: var(--gold-hi);
}
.store .glyph svg { width: 26px; height: 26px; }
.store .lines { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.store small { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.store strong { font-family: var(--display); font-size: 1.45rem; font-weight: 900; letter-spacing: .01em; }
.store em { font-style: normal; font-size: .72rem; opacity: .75; }
.store::after { /* shine sweep */
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 40px; left: -60px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: skewX(-20deg);
  animation: shine 5s ease-in-out infinite;
}
.store + .store::after { animation-delay: 1.2s; }
@keyframes shine { 0%, 70% { left: -60px; } 100% { left: 110%; } }

/* Gold lettering like the HEX KING plate. */
.gold-text {
  font-family: var(--display);
  font-weight: 900;
  color: var(--gold);
  background: linear-gradient(180deg, #fff3b8 0%, #ffd766 30%, #eaa92c 58%, #b8730f 100%);
  background-size: 100% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #3a2410) drop-shadow(0 -2px 0 #3a2410) drop-shadow(2px 0 0 #3a2410) drop-shadow(-2px 0 0 #3a2410) drop-shadow(0 10px 14px rgba(0, 0, 0, .25));
}
.shimmer { position: relative; display: inline-block; }
.shimmer::after { /* glint that crosses the letters */
  content: attr(data-text);
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, .95) 50%, transparent 60%) -150% 0 / 250% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: glint 4.5s ease-in-out 1.6s infinite;
  pointer-events: none;
}
@keyframes glint { 0% { background-position: -150% 0; } 35%, 100% { background-position: 250% 0; } }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 10px 0;
  transition: background .3s ease, box-shadow .3s ease, backdrop-filter .3s;
}
.topbar.scrolled {
  background: color-mix(in srgb, var(--sky-top) 78%, transparent);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 3px 0 rgba(42, 29, 20, .25);
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 44px; height: 44px; border-radius: 11px; border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.brand:hover img { transform: rotate(-8deg) scale(1.08); }
.brand span { font-size: 1.45rem; letter-spacing: .02em; }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  font-family: var(--mono); font-weight: 700; font-size: .88rem;
  text-decoration: none; padding: 6px 10px;
  color: var(--ink);
  border: 2px solid transparent;
  transition: border-color .15s, background .15s;
}
:root[data-theme="night"] .nav-links a, :root[data-theme="night"] .brand span.plain { color: var(--on-dark); }
.nav-links a:hover { border-color: var(--ink); background: var(--cream-hi); color: var(--ink); }

.theme-toggle {
  position: relative;
  width: 64px; height: 34px; flex: none;
  border: 3px solid var(--ink);
  background: linear-gradient(180deg, #7fd0ff, #c7ecff);
  cursor: pointer; padding: 0;
  box-shadow: 0 4px 0 var(--ink);
  transition: background .5s ease;
}
.theme-toggle .orb {
  position: absolute; top: 3px; left: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6b0, #ffc93a 60%, #f29c1f);
  box-shadow: 0 0 0 3px rgba(255, 214, 90, .45);
  transition: transform .5s cubic-bezier(.5, 1.6, .4, 1), background .5s, box-shadow .5s;
}
.theme-toggle .orb::after { /* the moon's shadow bite */
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  top: -3px; left: 9px; background: #1b2550; transform: scale(0); transition: transform .5s ease;
}
:root[data-theme="night"] .theme-toggle { background: linear-gradient(180deg, #0b1230, #283668); }
:root[data-theme="night"] .theme-toggle .orb { transform: translateX(28px); background: radial-gradient(circle at 40% 40%, #fffbe8, #e7e0c2); box-shadow: 0 0 10px 2px rgba(255, 250, 220, .5); }
:root[data-theme="night"] .theme-toggle .orb::after { transform: scale(1); background: #283668; }

/* ---------- Hero ---------- */
.hero { padding: 104px 0 150px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.eyebrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.hero h1 { margin: 0; line-height: .95; }
.hero h1 .pre { display: block; font-family: var(--mono); font-size: clamp(1.1rem, 2.2vw, 1.5rem); font-weight: 700; color: var(--ink); letter-spacing: .1em; text-transform: uppercase; margin-bottom: .35rem; }
:root[data-theme="night"] .hero h1 .pre, :root[data-theme="night"] .hero .lede { color: var(--on-dark); }
.hero h1 .big { font-size: clamp(3.4rem, 9vw, 7rem); letter-spacing: -.01em; }
.hero .lede { font-size: clamp(1.05rem, 1.8vw, 1.3rem); max-width: 34ch; margin: 22px 0 28px; color: var(--ink); font-weight: 500; }
.store-row { display: flex; flex-wrap: wrap; gap: 18px 16px; }
.trust { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.stage { position: relative; aspect-ratio: 1 / 1.02; max-width: 560px; justify-self: center; width: 100%; perspective: 1200px; }
.hexart {
  position: absolute; inset: 4% 8% 10% 2%;
  clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%);
  background: linear-gradient(160deg, #ffe68a, #c4841b 60%, #6b3f0c);
  padding: 10px;
  filter: drop-shadow(0 18px 0 rgba(42, 29, 20, .25));
  animation: bob 6s ease-in-out infinite;
  transform-style: preserve-3d;
}
.hexart img { width: 100%; height: 100%; object-fit: cover; clip-path: inherit; }
.hexart-inner { position: absolute; inset: 9px; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); background: #222; }
.hexart-inner img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform .4s ease; }
.ring { position: absolute; inset: -2% 2% 4% -4%; animation: spin 60s linear infinite; opacity: .9; }
.ring.two { inset: 8% 14% 16% 8%; animation-duration: 40s; animation-direction: reverse; opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.phone { /* a phone that is just the screenshot: rounded corners, a thin outline, no bezel */
  position: relative;
  width: 100%;
  border-radius: 9% / 4.2%;
  overflow: hidden;
  background: transparent;
  --rim: 4px;
  box-shadow: 0 0 0 var(--rim) #1d1712, 0 0 0 calc(var(--rim) + 1.5px) #4a4038, 0 0 0 calc(var(--rim) + 4px) var(--ink), 0 24px 40px -12px rgba(0, 0, 0, .45);
}
.phone img { display: block; width: 100%; height: auto; aspect-ratio: 560 / 1214; object-fit: cover; }
.phone::after { /* the camera: one dot at the top middle of the screen */
  content: ""; position: absolute; left: 50%; top: 2.9%;
  width: 7%; height: auto; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: #000;
}
.stage .phone {
  --rim: 3.5px;
  position: absolute; width: 36%; right: 0; bottom: 0;
  transform: rotateY(-14deg) rotateX(4deg) rotateZ(4deg);
  transition: transform .25s ease-out;
  animation: bob 6s ease-in-out -3s infinite;
}
.sparkle {
  position: absolute; width: 22px; height: 22px; pointer-events: none;
  background: radial-gradient(circle, #fff 0 18%, transparent 20%),
              conic-gradient(from 0deg, transparent 0 40deg, #fff6c0 45deg, transparent 50deg 130deg, #fff6c0 135deg, transparent 140deg 220deg, #fff6c0 225deg, transparent 230deg 310deg, #fff6c0 315deg, transparent 320deg);
  border-radius: 50%;
  animation: sparkle 2.4s ease-in-out infinite;
  filter: drop-shadow(0 0 6px #ffe48a);
}
@keyframes sparkle { 0%, 100% { transform: scale(0) rotate(0); opacity: 0; } 40% { transform: scale(1) rotate(45deg); opacity: 1; } 70% { transform: scale(.4) rotate(90deg); opacity: .6; } }

/* ---------- Bands (land, sea, stone) with hex-tile edges ---------- */
.band { position: relative; padding: 110px 0 120px; }
.band::before { /* a row of hex tops as the edge */
  content: ""; position: absolute; left: 0; right: 0; top: -15px; height: 16px;
  background: inherit;
  background: var(--band);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='54' height='16'%3E%3Cpath d='M0 16L27 0L54 16Z'/%3E%3C/svg%3E") 0 100% / 54px 16px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='54' height='16'%3E%3Cpath d='M0 16L27 0L54 16Z'/%3E%3C/svg%3E") 0 100% / 54px 16px repeat-x;
  transition: background .8s;
}
.band.land { --band: var(--land); background: var(--land); color: var(--on-dark); transition: background .8s; }
.band.sea { --band: var(--sea); background: radial-gradient(1200px 500px at 70% 30%, color-mix(in srgb, var(--sea) 70%, #4fb3ff), var(--sea) 70%), var(--sea); color: var(--on-dark); transition: background .8s; }
.band.stone { --band: var(--stone); background: var(--stone); color: var(--ink); transition: background .8s; }
:root[data-theme="night"] .band.stone { color: var(--cream); }
.band.deep { --band: var(--land-deep); background: var(--land-deep); color: var(--on-dark); }
.band.land::after { /* grass tufts texture */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image:
    radial-gradient(3px 6px at 20% 30%, #b7f08a 50%, transparent 52%),
    radial-gradient(3px 6px at 22% 31%, #b7f08a 50%, transparent 52%),
    radial-gradient(3px 6px at 70% 60%, #b7f08a 50%, transparent 52%),
    radial-gradient(3px 6px at 72% 61%, #b7f08a 50%, transparent 52%),
    radial-gradient(3px 6px at 45% 85%, #b7f08a 50%, transparent 52%);
  background-size: 180px 140px;
}
.band > .wrap { position: relative; z-index: 1; }

.kicker { font-family: var(--mono); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; font-size: .82rem; opacity: .85; margin: 0 0 10px; }
.title { font-family: var(--display); font-weight: 900; font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.02; margin: 0 0 16px; letter-spacing: -.01em; }
.title .gold-text { display: inline-block; }
.sub { font-size: 1.12rem; max-width: 58ch; margin: 0; opacity: .92; }
.center { text-align: center; }
.center .sub { margin: 0 auto; }

/* Banner ribbon */
.band.land { padding-top: 170px; overflow-x: clip; }
.ribbon {
  position: absolute; z-index: 2;
  top: -40px; left: -3%; right: -3%;
  background: var(--red);
  border-block: 4px solid var(--ink);
  box-shadow: 0 8px 0 rgba(0, 0, 0, .18);
  transform: rotate(-1.6deg);
  overflow: hidden;
}
.ribbon .track {
  display: flex; width: max-content;
  animation: marquee 32s linear infinite;
}
.ribbon span {
  font-family: var(--display); font-weight: 900; font-size: clamp(1.4rem, 3vw, 2.1rem);
  color: var(--gold-hi); padding: 10px 22px; white-space: nowrap;
  text-shadow: 0 3px 0 #5a120e;
  display: inline-flex; align-items: center; gap: 44px;
}
.ribbon span::after {
  content: ""; width: 18px; height: 20px;
  background: var(--gold-hi);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 28px; margin-top: 64px; }
.feature {
  color: var(--ink);
  padding: 58px 24px 26px;
  margin-top: 28px;
  transition: transform .3s cubic-bezier(.3, 1.5, .5, 1);
}
.feature:hover { transform: translateY(-8px) rotate(-.6deg); }
.feature:nth-child(even):hover { transform: translateY(-8px) rotate(.6deg); }
.feature .badge {
  position: absolute; top: -40px; left: 22px;
  width: 78px; height: 86px;
  display: grid; place-items: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--ink);
  transition: transform .6s cubic-bezier(.3, 1.4, .5, 1);
}
.feature .badge i {
  position: absolute; inset: 4px;
  clip-path: inherit;
  background: var(--tone, var(--gold));
}
.feature .badge svg { position: relative; width: 40px; height: 40px; }
.feature:hover .badge { transform: rotateY(360deg); }
.feature h3 { font-family: var(--display); font-weight: 900; font-size: 1.5rem; margin: 0 0 8px; }
.feature p { margin: 0; color: var(--ink-soft); }

/* ---------- Explore (interactive mini map) ---------- */
.explore { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: center; }
.steps { list-style: none; padding: 0; margin: 26px 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; }
.steps b {
  flex: none; width: 36px; height: 40px; display: grid; place-items: center;
  font-family: var(--mono); color: var(--ink);
  background: var(--gold);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.mapbox { padding: 14px; }
.mapbox .mapbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.mapbox .mapbar .spacer { flex: 1; }
.mapwrap { position: relative; background: radial-gradient(ellipse at center, #3a8fd0, #1d5f99); border: 3px solid var(--ink); overflow: hidden; touch-action: manipulation; }
.mapwrap canvas { display: block; width: 100%; height: auto; cursor: pointer; }
.go-btn {
  position: absolute; transform: translate(-50%, -135%) scale(0);
  font-family: var(--mono); font-weight: 900; font-size: .95rem;
  padding: 4px 12px 6px;
  background: var(--gold); color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.go-btn.show { transform: translate(-50%, -135%) scale(1); }
.go-btn::after { content: ""; position: absolute; left: 50%; bottom: -11px; width: 12px; height: 8px; transform: translateX(-50%); background: var(--ink); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.toast {
  position: absolute; left: 50%; top: 14px; transform: translate(-50%, calc(-100% - 40px));
  font-family: var(--mono); font-weight: 700; font-size: .9rem;
  padding: 8px 14px; max-width: 90%; text-align: center;
  background: var(--cream-hi); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
  transition: transform .35s cubic-bezier(.3, 1.5, .5, 1);
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.map-foot { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-top: 14px; }
.map-hint { font-family: var(--mono); font-size: .78rem; margin: 0 2px; color: var(--ink-soft); }
.map-foot .btn { flex: none; }

/* ---------- Screens carousel ---------- */
.carousel { position: relative; margin-top: 54px; }
.reel {
  display: flex; gap: 28px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 30px calc(50% - 130px) 50px;
  scrollbar-width: none;
}
.reel::-webkit-scrollbar { display: none; }
.shot {
  flex: none; width: 260px; scroll-snap-align: center;
  margin: 0; border: 0; padding: 0; background: none; cursor: zoom-in; text-align: center;
  transform: scale(.86) rotate(var(--r, 0deg));
  opacity: .7;
  transition: transform .45s cubic-bezier(.3, 1.3, .5, 1), opacity .45s;
}
.shot:nth-child(odd) { --r: -2deg; }
.shot:nth-child(even) { --r: 2deg; }
.shot.active { transform: scale(1) rotate(0); opacity: 1; }
.shot .label { display: inline-block; margin-top: 18px; }
.reel-nav { display: flex; justify-content: center; gap: 14px; align-items: center; }
.dots { display: flex; gap: 8px; }
.dots button {
  width: 14px; height: 16px; padding: 0; border: 0; cursor: pointer;
  background: var(--ink); opacity: .3;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  transition: opacity .2s, transform .2s;
}
:root[data-theme="night"] .dots button { background: var(--cream); }
.dots button[aria-current="true"] { opacity: 1; transform: scale(1.3); background: var(--gold-deep); }

dialog.lightbox {
  border: 0; padding: 0; background: transparent; max-width: none; max-height: none;
}
dialog.lightbox::backdrop { background: rgba(10, 8, 20, .82); backdrop-filter: blur(4px); }
dialog.lightbox[open] { display: grid; place-items: center; width: 100vw; height: 100vh; }
dialog.lightbox .phone { width: min(86vw, calc(86vh * 0.43)); animation: pop .35s cubic-bezier(.3, 1.5, .5, 1); }
dialog.lightbox .close { position: fixed; top: 16px; right: 16px; }
@keyframes pop { from { transform: scale(.7) rotate(-4deg); opacity: 0; } }

/* ---------- Promise tiles (the Kingdom sheet look) ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 50px; }
.tile {
  --bg: #f3d78f;
  background: var(--bg);
  text-align: center;
  padding: 26px 16px 22px;
  color: var(--ink);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.tile::before { --cream-hi: var(--bg); }
.tile:hover { transform: translateY(-6px) scale(1.03); }
.tile svg { width: 46px; height: 46px; margin: 0 auto 10px; }
.tile strong { display: block; font-family: var(--mono); font-size: 1.1rem; }
.tile span { font-family: var(--mono); font-size: .85rem; color: var(--ink-soft); }
.tile.green { --bg: #b9d98e; }
.tile.red { --bg: #e7a98c; }
.tile.blue { --bg: #b8d0e6; }
.tile.violet { --bg: #d8c3e0; }

/* ---------- Final call ---------- */
.final { position: relative; overflow: hidden; padding: 130px 0 140px; color: var(--on-dark); isolation: isolate; }
.final .bg { position: absolute; inset: -40px; z-index: -2; background: url("wide-town.webp") center 40% / cover; filter: blur(3px) saturate(1.15); transform: scale(1.05); }
.final::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at center, rgba(15, 12, 30, .35), rgba(15, 12, 30, .82)); }
.final .wrap { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; }
.qr { padding: 14px; width: 190px; text-align: center; }
.qr img { width: 100%; background: #fff; image-rendering: pixelated; }
.qr span { display: block; font-family: var(--mono); font-size: .78rem; font-weight: 700; margin-top: 8px; color: var(--ink); }

/* ---------- Footer ---------- */
footer { background: #1a120c; color: #e9dcc0; padding: 48px 0 40px; font-size: .92rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; font-family: var(--mono); }
footer a { text-decoration: none; opacity: .85; }
footer a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
footer .mini { display: flex; align-items: center; gap: 12px; }
footer .mini img { width: 40px; height: 40px; border-radius: 10px; }
footer small { display: block; opacity: .6; font-family: var(--mono); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(40px) scale(.98); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .9, .3, 1); transition-delay: var(--delay, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- /get page ---------- */
.get-main { min-height: calc(100vh - 64px); padding: 20px 0 80px; overflow: hidden; }
.get-card .chip { white-space: normal; text-align: center; justify-content: center; }
.get-card { max-width: 560px; margin: 24px auto 0; padding: 40px 30px 34px; text-align: center; }
.get-card .app-icon {
  width: 148px; height: 148px; margin: -110px auto 18px;
  border-radius: 32px; border: 4px solid var(--ink);
  box-shadow: 0 10px 0 var(--ink), 0 24px 40px -10px rgba(0, 0, 0, .4);
  animation: bob 4s ease-in-out infinite;
  position: relative; overflow: hidden;
}
.get-card .app-icon img { width: 100%; height: 100%; }
.get-card .app-icon::after { content: ""; position: absolute; top: -50%; left: -80%; width: 50%; height: 200%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); transform: rotate(25deg); animation: icon-shine 4s ease-in-out 1s infinite; }
@keyframes icon-shine { 0%, 60% { left: -80%; } 100% { left: 140%; } }
.get-card h1 { margin: 0 0 6px; font-size: clamp(2.6rem, 8vw, 3.6rem); line-height: 1; }
.get-card .tag { font-family: var(--mono); font-weight: 700; color: var(--ink-soft); margin: 0 0 22px; }
.get-buttons { display: flex; flex-direction: column; align-items: stretch; gap: 22px; max-width: 340px; margin: 26px auto 8px; }
.get-buttons .store { justify-content: flex-start; }
.get-buttons .pick { position: relative; }
.get-buttons .pick .for-you {
  position: absolute; top: -13px; right: -8px; z-index: 2;
  font-family: var(--mono); font-size: .68rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; background: var(--red); color: #fff; border: 2px solid var(--ink);
  transform: rotate(4deg);
  animation: wiggle 2.2s ease-in-out infinite;
}
@keyframes wiggle { 0%, 100% { transform: rotate(4deg); } 50% { transform: rotate(-3deg) scale(1.06); } }
.howto { text-align: left; margin: 26px auto 0; max-width: 380px; padding: 16px 18px 14px; background: var(--cream-hi); border: 2px dashed var(--ink-soft); }
.howto h2 { font-family: var(--mono); font-size: .9rem; margin: 0 0 8px; letter-spacing: .06em; text-transform: uppercase; }
.howto ol { margin: 0; padding-left: 1.3em; font-size: .95rem; }
.howto li { margin: 4px 0; }
.get-qr { display: flex; align-items: center; gap: 18px; justify-content: center; margin-top: 26px; text-align: left; }
.get-qr img { width: 112px; height: 112px; background: #fff; border: 3px solid var(--ink); padding: 4px; image-rendering: pixelated; }
.get-qr p { margin: 0; max-width: 22ch; font-family: var(--mono); font-size: .88rem; font-weight: 700; }
.fan { position: relative; height: 380px; max-width: 560px; margin: 70px auto 0; }
.fan .phone { --rim: 3px; position: absolute; width: 168px; left: 50%; bottom: 0; transform-origin: 50% 120%; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.fan .phone:nth-child(1) { transform: translateX(-50%) rotate(-16deg) translateX(-30px); }
.fan .phone:nth-child(2) { transform: translateX(-50%) translateY(-24px); z-index: 2; }
.fan .phone:nth-child(3) { transform: translateX(-50%) rotate(16deg) translateX(30px); }
.fan:hover .phone:nth-child(1) { transform: translateX(-50%) rotate(-24deg) translateX(-60px); }
.fan:hover .phone:nth-child(2) { transform: translateX(-50%) translateY(-40px) scale(1.04); }
.fan:hover .phone:nth-child(3) { transform: translateX(-50%) rotate(24deg) translateX(60px); }
.back-home { display: inline-block; margin-top: 20px; font-family: var(--mono); font-weight: 700; font-size: .9rem; }
:root[data-theme="night"] .back-home { color: var(--on-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .wrap, .explore, .final .wrap { grid-template-columns: 1fr; }
  .hero { padding-top: 92px; }
  .hero .copy { text-align: center; }
  .hero .lede { margin-inline: auto; }
  .eyebrow, .store-row, .trust { justify-content: center; }
  .stage { max-width: 440px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .final .wrap { text-align: center; justify-items: center; }
  .nav-links { display: none; }
}
@media (max-width: 620px) {
  .features { grid-template-columns: 1fr; gap: 44px; }
  .band { padding: 84px 0 96px; }
  .store { min-width: 0; width: 100%; max-width: 340px; }
  .store-row { flex-direction: column; align-items: center; }
  .final .qr { display: none; }
  .tiles { gap: 16px; }
  .tile { padding: 18px 10px 16px; }
  .brand span { font-size: 1.2rem; }
  .topbar .btn.small { display: none; }
  .fan { height: 300px; }
  .fan .phone { width: 128px; }
  .get-qr { display: none; }
  .reel { gap: 16px; padding: 24px calc(50% - 100px) 40px; }
  .shot { width: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
  .fog { display: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- hexking.app/join/<code> (owner, 2026-10-12: invites) ---------- */
.join-card { padding-top: 34px; }
.join-card [hidden] { display: none !important; }
.eyebrow-line { font-family: var(--mono); font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 6px; }
.join-card h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); overflow-wrap: anywhere; }
.join-card[data-state="loading"] h1, .join-card[data-state="loading"] .eyebrow-line { opacity: .55; }
.kings { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 4px 0 14px; }
.king { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; background: var(--cream-hi); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); animation: pop-in .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.king .flag { width: 16px; height: 20px; background: var(--banner); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); border: 0; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.king b { font-family: var(--display); font-size: 1rem; }
.king small { font-family: var(--mono); font-size: .72rem; color: var(--ink-soft); }
.seats { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--mono); font-size: .8rem; font-weight: 700; margin-bottom: 18px; }
.seat-bar { width: 120px; height: 12px; background: var(--cream-hi); border: 2px solid var(--ink); overflow: hidden; }
.seat-bar i { display: block; height: 100%; width: 0; background: var(--land); transition: width 1s cubic-bezier(.3, 1.2, .5, 1) .3s; }
.join-card[data-state="full"] .seat-bar i { background: var(--red); }
.code-box { display: grid; justify-items: center; gap: 10px; margin: 6px auto 4px; padding: 16px 14px 18px; max-width: 380px; background: var(--ink); border: 3px solid var(--ink); box-shadow: inset 0 0 0 3px var(--gold-deep); }
.code-label { font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-hi); }
.code-tiles { display: flex; gap: 6px; align-items: center; }
.tile-ch { display: grid; place-items: center; width: 42px; height: 52px; font-family: var(--mono); font-size: 1.7rem; font-weight: 900; color: var(--ink); background: var(--cream); border: 2px solid var(--gold-hi); box-shadow: inset 0 -5px 0 rgba(42, 29, 20, .18); animation: flip-in .5s cubic-bezier(.3, 1.4, .5, 1) both; }
.code-tiles .dash { width: 12px; height: 4px; background: var(--gold-hi); }
.copy-btn .ico { width: 18px; height: 18px; }
.copy-btn.done { --face: var(--land); color: var(--white); }
.code-form { margin: 8px auto 4px; max-width: 360px; text-align: left; }
.code-form label { display: block; font-family: var(--mono); font-weight: 700; font-size: .85rem; margin-bottom: 8px; text-align: center; }
.code-row { display: flex; gap: 12px; }
.code-row input { flex: 1; min-width: 0; padding: 10px 12px; font-family: var(--mono); font-size: 1.4rem; font-weight: 900; letter-spacing: .14em; text-align: center; text-transform: uppercase; color: var(--ink); background: var(--cream-hi); border: 3px solid var(--ink); box-shadow: inset 0 4px 0 rgba(42, 29, 20, .12); }
.code-row input:focus { outline: 3px solid var(--gold-hi); outline-offset: 2px; }
.join-note { margin: 12px auto 0; max-width: 380px; font-family: var(--mono); font-size: .86rem; font-weight: 700; }
.join-note.warn { color: var(--red); }
.join-steps { counter-reset: s; list-style: none; margin: 22px auto 0; padding: 0; max-width: 380px; text-align: left; display: grid; gap: 10px; }
.join-steps li { counter-increment: s; position: relative; padding: 2px 0 2px 44px; font-size: .95rem; }
.join-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 33px; display: grid; place-items: center; font-family: var(--display); font-weight: 900; color: var(--ink); background: var(--gold); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.already { margin: 18px 0 0; font-family: var(--mono); font-size: .8rem; color: var(--ink-soft); }
.toast-pop { position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 140%); padding: 10px 16px; font-family: var(--mono); font-weight: 700; font-size: .9rem; color: var(--ink); background: var(--gold-hi); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); opacity: 0; visibility: hidden; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), opacity .2s ease, visibility 0s linear .35s; pointer-events: none; max-width: calc(100% - 32px); }
.toast-pop.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), opacity .2s ease; }
:root[data-theme="night"] .join-card .tag, :root[data-theme="night"] .eyebrow-line { color: var(--ink-soft); }
@keyframes pop-in { from { opacity: 0; transform: scale(.6) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes flip-in { from { opacity: 0; transform: rotateX(90deg) translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 420px) {
  .tile-ch { width: 36px; height: 46px; font-size: 1.45rem; }
  .code-tiles { gap: 4px; }
}
