/* Gridlight website. The game's own colours and typeface; no scripts, no third-party requests. */
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("lexend-latin.woff2") format("woff2");
}

:root {
  --paper: #eef0ec;
  --ink: #252a33;
  --muted: #5b636e;
  --card: #ffffff;
  --lamp: #f2b01e;
  --teal: #2a9d8f;
  --water: #cfe0e6;
  --wood: #c6d7b6;
  --night: #1b2433;
  --night-text: #f3f5f8;
  --night-muted: #9aa6b8;
  --font: "Lexend", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 56px);
  --wide: 1160px;
  --text: 62ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--lamp); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

/* top bar: the game's chips */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.top nav { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  background: var(--card); border-radius: 999px; font-weight: 500; font-size: 15px; text-decoration: none;
  box-shadow: 0 1px 2px rgba(37, 42, 51, 0.12), 0 4px 14px rgba(37, 42, 51, 0.08);
}
.chip:hover { background: var(--ink); color: var(--card); }
.chip[aria-current="page"] { background: var(--ink); color: var(--card); }

/* hero: the title screen */
.hero { position: relative; overflow: hidden; }
.hero .wrap { position: relative; }
.hero .stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 24px; padding-top: 24px; padding-bottom: 72px; }
.hero h1 { font-size: clamp(56px, 10.5vw, 132px); line-height: 0.95; letter-spacing: -0.035em; font-weight: 600; }
.hero .sub { margin-top: 18px; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.3; font-weight: 500; }
.hero .lead { margin-top: 14px; max-width: 34ch; color: var(--muted); font-size: 18px; }
.river { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 150px; }
.status { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.status small { font-size: 15px; color: var(--muted); }
.soon { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 16px 0 14px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 600; font-size: 15px; }
.soon::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 0 2px var(--ink); }

/* the waitlist: one field, one button; works without scripts */
.join { margin-top: 22px; max-width: 470px; }
.join > label { display: block; font-weight: 600; margin-bottom: 8px; }
.join .field { display: flex; gap: 8px; padding: 6px; background: var(--card); border-radius: 999px; box-shadow: 0 1px 2px rgba(37, 42, 51, 0.12), 0 4px 14px rgba(37, 42, 51, 0.08); }
.join .field:focus-within { outline: 3px solid var(--teal); outline-offset: 2px; }
.join input[type="email"] { flex: 1; min-width: 0; border: 0; background: none; padding: 0 0 0 18px; font: inherit; color: var(--ink); min-height: 44px; }
.join input[type="email"]:focus { outline: none; }
.join input::placeholder { color: #6c737d; opacity: 1; }
.join button { border: 0; cursor: pointer; white-space: nowrap; min-height: 44px; padding: 0 20px; border-radius: 999px; background: var(--ink); color: var(--card); font: inherit; font-weight: 600; }
.join button:hover { background: #1f776d; }
.join small { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }
.join .trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.night .join > label { color: var(--night-text); }
.night .join small { color: var(--night-muted); margin-top: 10px; }
.night .join button { background: var(--lamp); color: var(--ink); }
.night .join button:hover { background: #ffd05a; }
@media (max-width: 420px) {
  .join .field { flex-direction: column; border-radius: 26px; padding: 8px; }
  .join input[type="email"] { padding: 0 14px; }
}

/* the little grid that builds itself, once */
.grid-art { width: 100%; max-width: 620px; justify-self: end; overflow: visible; }
.grid-art .wire { fill: none; stroke: var(--ink); stroke-width: 9; stroke-linecap: round; }
.grid-art .flow { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0.1 22; }
.grid-art .plate { stroke: var(--ink); stroke-width: 5; fill: #fff; }
.grid-art .town { fill: var(--lamp); }
.grid-art .glyph { fill: var(--ink); }
.grid-art .glow { fill: var(--lamp); opacity: 0.22; }
@media (prefers-reduced-motion: no-preference) {
  .grid-art .wire { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.75s cubic-bezier(0.4, 0, 0.2, 1) forwards; animation-delay: var(--d, 0s); }
  .grid-art .flow { opacity: 0; animation: appear 0.5s forwards, flow 2.4s linear infinite; animation-delay: calc(var(--d, 0s) + 0.75s), 0s; }
  .grid-art .town { fill: #fff; animation: light 0.45s ease-out forwards; animation-delay: var(--d, 0s); }
  .grid-art .glow { opacity: 0; animation: glow 0.6s ease-out forwards; animation-delay: var(--d, 0s); }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes appear { to { opacity: 1; } }
  @keyframes flow { to { stroke-dashoffset: -22.1; } }
  @keyframes light { to { fill: var(--lamp); } }
  @keyframes glow { to { opacity: 0.22; } }
}

/* screenshots sit in an iPhone held sideways: titanium rim, black bezel, Dynamic Island on the left, buttons on the long edges.
   Every size is a share of the phone's width (cqw), so the phone keeps its proportions at any size. */
.phone { container-type: inline-size; isolation: isolate; padding: 1.3% 0.7%; }
.phone .body {
  position: relative; background: #000; padding: 0.95cqw; border-radius: 7.1cqw;
  box-shadow: 0 0 0 0.1cqw #1d1e21, 0 0 0 0.4cqw #9a9ca2, 0 0 0 0.5cqw #5d5f65, 0 2.4cqw 6cqw rgba(37, 42, 51, 0.28);
}
.phone .body img, .phone .body video { display: block; width: 100%; height: auto; border-radius: 6.2cqw; }
/* a short clip of the game plays in each phone; with reduced motion the still shows instead */
.phone .body img { display: none; }
@media (prefers-reduced-motion: reduce) { .phone .body video { display: none; } .phone .body img { display: block; } }
.lead-shot { max-width: 820px; margin: 0 auto; }
.phone .body::before { /* Dynamic Island */
  content: ""; position: absolute; z-index: 1; left: 2.1cqw; top: 50%; width: 3.6cqw; height: 12.6cqw; margin-top: -6.3cqw; border-radius: 1.8cqw; background: #000;
}
.phone .body::after { /* side button and camera control on top, action and volume buttons below */
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: -0.85cqw; bottom: -0.85cqw;
  background:
    linear-gradient(90deg, transparent 23%, #7c7e84 23%, #7c7e84 33.5%, transparent 33.5%, transparent 61%, #7c7e84 61%, #7c7e84 67%, transparent 67%) top / 100% 0.7cqw no-repeat,
    linear-gradient(90deg, transparent 17%, #7c7e84 17%, #7c7e84 20.5%, transparent 20.5%, transparent 25%, #7c7e84 25%, #7c7e84 31.5%, transparent 31.5%, transparent 34%, #7c7e84 34%, #7c7e84 40.5%, transparent 40.5%) bottom / 100% 0.7cqw no-repeat;
  border-radius: 0.5cqw;
}
figcaption { margin-top: 14px; color: var(--muted); font-size: 15px; max-width: var(--text); }

section { padding: clamp(48px, 7vw, 88px) 0; }
.hero + section { padding-top: clamp(40px, 6vw, 72px); }
h2 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; max-width: 20ch; }
.prose { max-width: var(--text); }
.prose p { margin-top: 18px; }
.prose p.big { font-size: clamp(19px, 2vw, 22px); line-height: 1.5; }

.split { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 6fr); }
.split.flip .prose { order: 2; }

/* the stories: stops on one line */
.line { position: relative; margin-top: 44px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.line::before { content: ""; position: absolute; left: 12px; right: 0; top: 9px; height: 8px; background: var(--ink); border-radius: 4px; }
.stop { position: relative; padding-top: 44px; }
.stop::before { content: ""; position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--lamp); border: 5px solid var(--ink); }
.stop.open::before { background: var(--card); }
.stop h3 { font-size: 20px; line-height: 1.2; font-weight: 600; }
.stop .count { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; }
.stop p { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--muted); }

/* what is in the game */
.facts { margin-top: 36px; columns: 2; column-gap: clamp(28px, 5vw, 64px); }
.facts li { break-inside: avoid; position: relative; padding: 0 0 18px 28px; max-width: 54ch; }
.facts li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--ink); background: var(--lamp); }

/* the page ends at night, like the game */
.night { background: var(--night); color: var(--night-text); position: relative; overflow: hidden; }
.night .wrap { position: relative; }
.night h2 { max-width: 16ch; }
.night p { color: var(--night-muted); margin-top: 18px; max-width: 52ch; }
.night .stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 24px; }
/* the same valley after dark, the last village connected */
.night .grid-art .wire { stroke: #0d131e; stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
.night .grid-art .flow { stroke: #f7d98a; opacity: 1; animation-name: flow; animation-duration: 2.4s; animation-timing-function: linear; animation-iteration-count: infinite; animation-delay: 0s; }
.night .grid-art .plate { stroke: #0d131e; fill: #dfe6ef; }
.night .grid-art .town { fill: var(--lamp); animation: none; }
.night .grid-art .glyph { fill: #0d131e; }
.night .grid-art .glow { opacity: 0.3; animation: none; filter: blur(6px); }
.night .grid-art path[stroke] { stroke: #0d131e; }
.foot { background: var(--night); color: var(--night-muted); font-size: 15px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; padding-top: 22px; padding-bottom: 30px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.foot ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { color: var(--night-text); }

/* text pages: privacy, support */
.page { padding: clamp(28px, 6vw, 64px) 0 clamp(64px, 9vw, 104px); }
.page h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1.05; letter-spacing: -0.025em; font-weight: 600; max-width: 16ch; }
.page .doc { max-width: var(--text); margin-top: 28px; }
.page .doc > * + * { margin-top: 18px; }
.page .doc h2 { font-size: 24px; letter-spacing: -0.01em; margin-top: 44px; max-width: none; }
.page .doc ul { display: grid; gap: 12px; }
.page .doc ul li { position: relative; padding-left: 28px; }
.page .doc ul li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--ink); background: var(--lamp); }
.page .big { font-size: clamp(20px, 2.4vw, 24px); line-height: 1.4; font-weight: 500; }
.page .updated { color: var(--muted); font-size: 15px; margin-top: 36px; }
.contact { display: inline-flex; align-items: center; min-height: 52px; padding: 0 24px; background: var(--ink); color: var(--card); border-radius: 999px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.contact:hover { background: #1f776d; }
.faq dt { font-weight: 600; font-size: 19px; margin-top: 28px; }
.faq dd { margin-top: 6px; }
.page-foot { background: var(--paper); color: var(--muted); font-size: 15px; }
.page-foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; padding-top: 22px; padding-bottom: 30px; border-top: 2px solid rgba(37, 42, 51, 0.1); }
.page-foot ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.page-foot a { color: var(--ink); }

@media (max-width: 860px) {
  .hero .stage { grid-template-columns: minmax(0, 1fr); padding-bottom: 56px; }
  .night .stage { grid-template-columns: minmax(0, 1fr); }
  .grid-art { justify-self: center; max-width: 440px; }
  .split, .split.flip { grid-template-columns: minmax(0, 1fr); }
  .split.flip .prose { order: 0; }
  .facts { columns: 1; }
  /* the line turns to run down the page */
  .line { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .line::before { left: 9px; right: auto; top: 12px; bottom: 30px; width: 8px; height: auto; }
  .stop { padding: 0 0 28px 48px; }
  .stop p { max-width: 46ch; }
}
@media (max-width: 420px) {
  body { font-size: 16px; }
  .chip { padding: 0 13px; font-size: 14px; }
  .brand span { display: none; }
}
