/* doodlelabs.dev — follows doodlelabs.com: black canvas, #181818 cards, one gold accent,
   Inter for words, Roboto Mono for labels and buttons. */

:root {
  --black: #000;
  --ink: #181818;
  --ink-2: #1f1f1f;
  --line: #262626;
  --line-soft: #141414;
  --text: #fff;
  --muted: #a4a4a4;
  --dim: #8a8a8a;
  --gold: #edb84f;
  --gold-hover: #ffcf70;
  --ember: #ff6a2b;

  --sans: Inter, Arial, sans-serif;
  --mono: 'Roboto Mono', ui-monospace, Menlo, monospace;

  --header-h: 64px;
  --rail: min(1200px, calc(100vw - 64px));
  --mesh-h: min(90vw, 46vh);   /* hero mesh height when it stacks above the copy */
  --r-sm: 4px;
  --r-btn: 6px;
  --r-card: 20px;

  color-scheme: dark;
}

@media (max-width: 720px) {
  :root { --header-h: 60px; --rail: calc(100vw - 32px); }
}

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

html { background: var(--black); scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font: 400 16px/1.5 var(--sans);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 3px; }

.wrap { width: var(--rail); margin-inline: auto; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--gold); color: #000; padding: 10px 14px; border-radius: var(--r-btn); font-weight: 600;
}
.skip:focus { top: 12px; }

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

.muted { color: var(--muted); }

/* ---- Labels and buttons ------------------------------------------------- */

.eyebrow {
  display: flex; align-items: center; gap: 7px;
  font: 400 10px/15px var(--mono);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.eyebrow .sq { flex: none; width: 15px; height: 15px; border-radius: var(--r-sm); background: currentColor; }
.eyebrow .sq.gold { background: var(--gold); }
.eyebrow.small { color: var(--muted); gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-gold {
  gap: 10px; min-height: 38px; padding: 0 16px;
  background: var(--gold); color: #000;
  border-radius: var(--r-btn);
  font: 600 13px/1 var(--sans);
}
.btn-gold:hover { background: var(--gold-hover); }

.btn-outline {
  gap: 24px; height: 53px; padding: 0 30px 0 34px;
  border: 1px solid currentColor; border-radius: 10px;
  font: 500 15px/1 var(--mono);
  text-transform: uppercase;
}
.btn-outline:hover { background: #fff; color: #000; border-color: #fff; }

/* ---- Header ------------------------------------------------------------- */

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  background: var(--black);
}
.header-row { position: relative; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-header .header-row { width: auto; margin-inline: clamp(16px, 2vw, 40px); }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { width: 94px; height: auto; }
.site-header .brand img { width: 72px; }
.brand-tag {
  font: 500 10px/1 var(--mono); letter-spacing: .08em;
  padding: 4px 6px; border: 1px solid #444; border-radius: var(--r-sm); color: var(--muted);
}
.nav {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; gap: clamp(22px, 2.4vw, 44px);
  font-size: 14px;
}
.nav a:hover { color: var(--gold); }

@media (max-width: 720px) {
  .nav { display: none; }
  .btn-gold { padding: 0 12px; min-height: 34px; }
}

/* ---- Hero --------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: clamp(560px, 76vh, 700px);
  padding-top: var(--header-h);
  display: flex; align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero::after {
  /* the hit: a quick gold bloom on the dragon's neck when the blade lands (centre set by mesh.js) */
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(circle 340px at var(--bloom-x, 70%) var(--bloom-y, 48%),
    rgba(237, 184, 79, .28), rgba(237, 184, 79, .1) 40%, transparent 70%);
  opacity: 0; transition: opacity .5s ease-out;
}
html.flash .hero::after { opacity: 1; transition: none; }

.mesh {
  position: absolute; z-index: 0;
  top: var(--header-h); right: 0;
  width: 72%; height: calc(100% - var(--header-h));
}
.hero-fade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, #000 0%, #000 26%, rgba(0, 0, 0, .7) 40%, rgba(0, 0, 0, 0) 62%),
    linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0) 22%);
  transition: opacity .8s;
}
.hero.dragon-awake .hero-fade { opacity: .35; }

.hero-copy {
  position: relative; z-index: 3;
  padding: 96px 0 clamp(48px, 6vw, 88px);
  pointer-events: none;
}
.hero-copy a, .hero-copy button { pointer-events: auto; }
.hero-copy .eyebrow { margin-bottom: 28px; }
.hero h1 {
  max-width: 13ch;
  font: 400 clamp(42px, 3.02vw, 58px)/1.08 var(--sans);
  letter-spacing: -0.03em;
}
.lede {
  max-width: min(30rem, 42vw); margin-top: 28px;   /* stops short of the dragon's snout on laptops */
  font-size: 16px; line-height: 1.5; letter-spacing: -0.02em;
}
.hero-actions { margin-top: 40px; }

.stats {
  display: flex; flex-wrap: wrap; gap: 12px 44px;
  margin: 52px 0 0; padding-top: 20px;
  border-top: 1px solid var(--line);
  max-width: min(30rem, 42vw);
}
.stats div { display: grid; gap: 6px; }
.stats dt { font: 400 10px/1 var(--mono); text-transform: uppercase; color: var(--muted); letter-spacing: -0.01em; }
.stats dd { margin: 0; font: 500 26px/1 var(--sans); letter-spacing: -0.03em; }
.stats [data-tally] dt, .stats [data-tally] dd { color: var(--gold); }

/* Phones and portrait tablets: the mesh sits above the copy at a fixed height, so the
   dragon stays whole and nothing in the copy (like the tally appearing) can resize it. */
@media (max-width: 900px) {
  .hero { min-height: 0; padding-top: calc(var(--header-h) + var(--mesh-h) - 24px); }
  .mesh { width: 100%; height: var(--mesh-h); }
  .hero-fade {
    background: linear-gradient(180deg,
      rgba(0, 0, 0, 0) calc(var(--header-h) + var(--mesh-h) - 110px),
      #000 calc(var(--header-h) + var(--mesh-h) - 16px));
  }
  .hero-copy { padding-top: 0; }
  .lede, .stats { max-width: 30rem; }
  .hero::after {
    background: radial-gradient(circle 220px at var(--bloom-x, 60%) var(--bloom-y, 30%),
      rgba(237, 184, 79, .3), rgba(237, 184, 79, .1) 40%, transparent 70%);
  }
}

/* ---- Mesh, and the dragon in it ----------------------------------------- */

.mesh .link { stroke: #fff; stroke-opacity: .085; stroke-width: 1; transition: stroke-opacity .7s, stroke .7s, stroke-width .7s; }
.mesh .node { fill: #fff; fill-opacity: .3; transform-box: fill-box; transform-origin: center; transition: fill-opacity .7s, fill .7s, transform .7s; }
.mesh .packet { fill: #fff; fill-opacity: .75; }
.mesh .eye { fill: var(--gold); fill-opacity: .85; animation: led 5s ease-in-out infinite; }
.mesh .eye-hit { fill: transparent; pointer-events: all; cursor: crosshair; }
.mesh .eye.poked { animation: poke .35s ease-out; }

@keyframes led { 0%, 86%, 100% { fill-opacity: .85; } 92% { fill-opacity: .25; } }
@keyframes poke { 0% { transform: scale(1); } 40% { transform: scale(2.4); fill: var(--ember); } 100% { transform: scale(1); } }

.mesh.awake .link:not(.dragon) { stroke-opacity: .025; }
.mesh.awake .node:not(.dragon) { fill-opacity: .06; }
.mesh.awake .link.dragon {
  stroke: var(--gold); stroke-opacity: .95; stroke-width: 1.6;
  stroke-dasharray: 1; animation: draw .8s cubic-bezier(.6, 0, .2, 1) both;
}
.mesh.awake .node.dragon { fill: #fff; fill-opacity: 1; transform: scale(1.5); }
.mesh.awake .node.eye {
  fill: var(--ember); fill-opacity: 1; transform: scale(2.4);
  filter: drop-shadow(0 0 4px var(--ember));
  animation: none;
}
.mesh.roar { animation: roar .14s linear 6; }
.mesh.slain .link.dragon { stroke-opacity: 0; transition: stroke-opacity .5s ease-out; }
.mesh .ember { fill: var(--gold); filter: drop-shadow(0 0 3px var(--ember)); }
.mesh .ember.hot { fill: var(--ember); }
.mesh .slash {
  stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 1;
  filter: drop-shadow(0 0 5px var(--gold));
}

@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes roar {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 1px); }
  75% { transform: translate(3px, -1px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mesh *, .mesh { animation: none !important; transition: none !important; }
  .hero::after, .hero-fade, .toast { transition: none !important; }
}

/* ---- Sections ----------------------------------------------------------- */

.section { padding: clamp(64px, 8vw, 120px) 0 0; }
.section:last-of-type { padding-bottom: clamp(64px, 8vw, 120px); }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-bottom: 32px;
}
.section h2 {
  margin-top: 22px;
  font: 500 clamp(32px, calc(1.2vw + 21px), 42px)/1.08 var(--sans);
  letter-spacing: -0.03em;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 34px; padding: 0 14px;
  background: transparent; border: 1px solid #444; border-radius: var(--r-btn);
  font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: -0.01em;
  color: var(--muted); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { color: #fff; border-color: #777; }
.chip[aria-pressed="true"] { background: #fff; color: #000; border-color: #fff; }

/* ---- Tiles -------------------------------------------------------------- */

.tiles {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tiles { grid-template-columns: minmax(0, 1fr); } }

.tile-inner {
  height: 100%; min-height: 320px;
  display: flex; flex-direction: column;
  padding: 26px 26px 22px;
  background: var(--ink);
  border-radius: var(--r-card);
  transition: background .2s;
}
a.tile-inner:hover { background: var(--ink-2); }
a.tile-inner:focus-visible { outline-offset: 3px; border-radius: var(--r-card); }

.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.idx { color: #fff; }

.status {
  display: inline-flex; align-items: center; gap: 7px;
  font: 400 10px/1 var(--mono); text-transform: uppercase; color: var(--muted);
}
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.status-live::before { background: var(--gold); box-shadow: 0 0 0 3px rgba(237, 184, 79, .16); }
.status-building::before, .status-early::before { border: 1px solid var(--muted); }

.tile h3 {
  margin: 44px 0 12px;
  font: 500 clamp(24px, 2.1vw, 30px)/1.12 var(--sans);
  letter-spacing: -0.03em;
}
a.tile-inner:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.tile-blurb { color: var(--muted); font-size: 15px; line-height: 1.5; letter-spacing: -0.015em; }

.tech { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tech li {
  font: 400 10px/1 var(--mono); text-transform: uppercase; color: var(--dim);
  padding: 5px 7px; border: 1px solid var(--line); border-radius: var(--r-sm);
}

.tile-foot {
  margin-top: auto; padding-top: 22px;
  display: flex; align-items: center; gap: 12px;
}
.where {
  flex: 1; min-width: 0;
  font: 400 10px/1 var(--mono); text-transform: uppercase; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.go {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border: 1px solid #444; border-radius: var(--r-btn);
  font-size: 16px;
  transition: background .2s, color .2s, border-color .2s;
}
a.tile-inner:hover .go { background: var(--gold); border-color: var(--gold); color: #000; }

.badge {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 7px; border-radius: var(--r-sm);
  border: 1px solid #555; color: #fff;
  font: 500 10px/1 var(--mono); text-transform: uppercase;
}
.badge-neutral { color: #ddd; }
.lock { width: 10px; height: 12px; color: var(--gold); }

/* The open slot at the end of the grid */
.tile-next .tile-inner {
  background: transparent;
  border: 1px dashed #333;
}
.tile-next h3 { color: var(--muted); }
.tile-next .swap { display: grid; }
.tile-next .swap > * { grid-area: 1 / 1; transition: opacity .35s; }
.tile-next .swap > :last-child { opacity: 0; color: var(--gold); }
.tile-next:hover .swap > :first-child { opacity: 0; }
.tile-next:hover .swap > :last-child { opacity: 1; }

/* ---- Panels ------------------------------------------------------------- */

.panel {
  background: var(--ink);
  border-radius: var(--r-card);
  padding: clamp(28px, 4vw, 56px);
}
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 48px; }
.split.plain { padding-top: 40px; border-top: 1px solid var(--line); }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; gap: 28px; } }

.access-list { display: grid; }
.access-item {
  display: grid; grid-template-columns: 116px 1fr; gap: 20px; align-items: start;
  padding: 18px 0; border-top: 1px solid var(--line);
}
.access-item:first-child { border-top: 0; padding-top: 4px; }
.access-item .badge { justify-self: start; }
.access-item p { color: var(--muted); font-size: 16px; }
.prose { display: grid; gap: 16px; align-content: start; }
.prose p { color: #fff; font-size: 16px; }
@media (max-width: 560px) { .access-item { grid-template-columns: 1fr; gap: 10px; } }

/* ---- Footer ------------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--line-soft); }
.footer-row {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 44px 0;
}
.footer-row .brand img { width: 120px; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; font: 500 14px/1.3 var(--sans); }
.footer-links a:hover { color: var(--gold); }
.footer-base {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 0 28px;
  border-top: 1px solid var(--line-soft);
  color: #ddd; font: 300 13px/1.4 var(--sans);
}
.here-be {
  font: 400 10px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em;
  color: #2c2c2c; transition: color .4s;
}
.here-be:hover { color: var(--gold); }

/* ---- Toast -------------------------------------------------------------- */

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: min(360px, calc(100vw - 32px));
  padding: 22px 22px 18px;
  background: #141414; border: 1px solid #2a2a2a; border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(12px);
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: none; }
.toast-title { margin: 14px 0 8px; font: 500 22px/1.15 var(--sans); letter-spacing: -0.03em; }
.toast-body { color: var(--muted); font-size: 14px; line-height: 1.5; }
.toast-count {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid #262626;
  font: 400 10px/1 var(--mono); text-transform: uppercase; color: var(--gold);
}
.toast-close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border: 0; border-radius: var(--r-btn);
  background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.toast-close:hover { color: #fff; background: #222; }
@media (max-width: 720px) { .toast { right: 16px; bottom: 16px; } }

/* ---- 404 ---------------------------------------------------------------- */

.lost { min-height: 100vh; display: flex; align-items: center; padding-top: var(--header-h); }
.lost h1 { margin: 24px 0 20px; font: 400 clamp(42px, 3.02vw, 58px)/1.08 var(--sans); letter-spacing: -0.03em; }
.lost .lede { margin: 0 0 40px; }
