/* cubeandtree: one black look by choice.
   Layout: thin bar with search; hero with headline and calls to action on the left and the
   tree/neuron cube on the right (stacked on phones); a strip of three highlights; the atlases
   grid with the live atlas featured across two columns; a full footer. */
:root {
  --bg: #000000;
  --surface: #0b0b0d;
  --fg: #ededed;
  --muted: #8a8a91;
  --faint: #55555c;
  --line: #1f1f23;
  --warm: #ffbf57;   /* tree */
  --cool: #5fb4ff;   /* neuron */
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --font-serif: "Spectral", Georgia, "Times New Roman", serif;
  --atlas-navy: #0a1422;
  --atlas-cyan: #3fcfe6;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg);
}
.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
  outline: 1px solid var(--fg); outline-offset: 4px;
}
main { flex: 1 0 auto; }

/* Bar */
.bar {
  flex-shrink: 0;
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar .wrap { height: 52px; display: flex; align-items: center; gap: 20px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--fg); text-decoration: none;
  font-size: 13px; font-weight: 500; letter-spacing: 0.04em;
}
.mark-wrap { position: relative; width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
.mark { width: 18px; height: 18px; fill: none; stroke: var(--fg); stroke-width: 1.1; stroke-linejoin: round; }
#mark { position: absolute; inset: 0; width: 28px; height: 28px; display: block; }
.brand.live .mark { display: none; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 65% at 72% 45%, rgba(95, 180, 255, 0.10), transparent 70%),
              radial-gradient(40% 50% at 62% 70%, rgba(255, 191, 87, 0.08), transparent 70%);
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 540px);
  align-items: center;
  min-height: min(88vh, 820px);
  padding-block: 40px;
}
.hero-copy {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 22px; min-width: 0;
  text-shadow: 0 0 18px #000, 0 0 6px #000;
}
.hero-copy .btn, h1 span { text-shadow: none; }
.eyebrow { margin: 0; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 span {
  font-style: italic;
  background: linear-gradient(90deg, var(--warm), var(--cool));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin: 0; max-width: 46ch; font-size: 14px; line-height: 1.75; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 20px;
  font: inherit; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; border-radius: 999px; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn-primary { background: var(--fg); color: var(--bg); border: 1px solid var(--fg); }
.btn-primary:hover { background: transparent; color: var(--fg); }
.btn-ghost { color: var(--fg); border: 1px solid #34343a; }
.btn-ghost:hover { border-color: var(--fg); }

.stage {
  position: absolute;
  top: 0; bottom: 0; right: -6%;
  width: min(82%, 1040px);
}
.stage[hidden] { display: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; }
.stage.dragging canvas { cursor: grabbing; }

/* Atlases */
.works { padding-block: 56px 96px; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-family: var(--font-serif); font-weight: 300; font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -0.01em; }
.section-head p { margin: 0; font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.no-results { margin: 0 0 16px; font-size: 13px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .25s, transform .25s, box-shadow .25s;
}
.card[hidden] { display: none; }
a.card { color: inherit; text-decoration: none; }
a.card:hover { transform: translateY(-3px); }
.card-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 160px; }
.card .tag { margin: 0; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.card h3 { margin: 0; font-family: var(--font-serif); font-weight: 300; font-size: 22px; letter-spacing: -0.01em; }
.card p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--muted); }
.card .status { margin-top: auto; padding-top: 12px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }

/* Featured atlas: spans two columns, brain on the left, text on the right */
.card-atlas { border-color: #1b2a40; background: #070d16; }
.card-atlas:hover { border-color: var(--atlas-cyan); box-shadow: 0 0 0 1px rgba(63, 207, 230, 0.22), 0 24px 60px -24px rgba(63, 207, 230, 0.4); }
.card-atlas.featured { grid-column: span 2; flex-direction: row; }
.card-atlas.featured .visual { flex: 1.1 1 0; aspect-ratio: auto; min-height: 300px; border-bottom: 0; border-right: 1px solid #1b2a40; }
.card-atlas.featured .card-body { flex: 1 1 0; padding: 28px 28px 24px; gap: 10px; }
.card-atlas h3 { font-size: 30px; }
.card-atlas .sub { margin-top: -6px; font-family: var(--font-serif); font-style: italic; font-size: 18px; color: #7fe3f2; }
.card-atlas .status { color: var(--atlas-cyan); }
.visual {
  position: relative;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  background: radial-gradient(110% 90% at 55% 45%, #13284a 0%, var(--atlas-navy) 65%);
  border-bottom: 1px solid #1b2a40;
  overflow: hidden;
}
.visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.visual-tag {
  position: absolute; top: 14px; left: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #7fe3f2;
  pointer-events: none;
}
.visual-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--atlas-cyan); box-shadow: 0 0 8px var(--atlas-cyan); }
.visual-axis {
  position: absolute; left: 16px; right: 16px; bottom: 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #7fa6c4;
  pointer-events: none;
}
.visual-axis i { flex: 1; height: 1px; background: linear-gradient(90deg, #d6a3a8, var(--atlas-cyan)); opacity: 0.7; }

/* Helix card: a warmer ground for the DNA, same family as the atlas navy */
.visual-helix { background: radial-gradient(110% 90% at 50% 45%, #1d2236 0%, #0b0d16 68%); }
.visual-helix .visual-axis i { background: linear-gradient(90deg, #74a8dc, #e6bd6c); }

/* Placeholders */
.card-soon { border-style: dashed; border-color: #2a2a30; background: transparent; }
.visual-soon { background: none; display: grid; place-items: center; border-bottom: 1px dashed #2a2a30; color: #4d4d55; }
.visual-soon svg { height: 56%; width: auto; max-width: 70%; }
.card-soon h3 { color: #9a9aa2; font-size: 20px; }

/* About */
.about { padding-block: 72px; }
.about h1 { font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 24px; }
.about p { max-width: 58ch; font-size: 15px; line-height: 1.75; margin: 0 0 16px; }
.about .disclaimer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); max-width: 58ch; }
.about .disclaimer h2 { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg); margin: 0 0 12px; }
.about .disclaimer p { font-size: 12px; line-height: 1.75; color: var(--muted); margin: 0 0 12px; }

/* Footer */
footer { flex-shrink: 0; border-top: 1px solid var(--line); background: var(--bg); }
footer > .wrap { padding-block: 18px; font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }
.site-footer > .footer-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 24px;
  padding-block: 36px 24px;
}
.footer-brand { display: flex; flex-direction: column; gap: 6px; }
.footer-brand b { font-size: 14px; font-weight: 500; letter-spacing: 0.04em; color: var(--fg); }
.footer-brand span { font-size: 12px; color: var(--muted); }
.footer-nav { display: flex; gap: 22px; align-items: flex-start; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-nav a:hover { color: var(--fg); }
.footer-copy { grid-column: 1 / -1; margin: 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 11px; letter-spacing: 0.06em; color: var(--faint); }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-block: min(100vw, 64vh) 40px; }
  .stage { top: 0; bottom: auto; right: -10%; left: -10%; width: auto; height: min(110vw, 72vh); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card-atlas.featured { grid-column: auto; flex-direction: column; }
  .card-atlas.featured .visual { flex: none; aspect-ratio: 16 / 10; min-height: 0; border-right: 0; border-bottom: 1px solid #1b2a40; }
  .card-atlas.featured .card-body { padding: 20px; }
  .works { padding-block: 48px 64px; }
}
@media (max-width: 600px) {
  .bar .wrap { gap: 12px; }
  .brand .label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a.card:hover { transform: none; }
}

/* Content types: a coloured pill on each card, and filter buttons above the grid.
   To add a type, give it a colour here (.type-x, .chip-x) and use data-type="x" on its card. */
.type {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px 4px 8px; border-radius: 999px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1;
  border: 1px solid currentColor; color: var(--muted);
}
.type::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.type-atlas { color: #3fcfe6; background: rgba(63, 207, 230, 0.08); }
.type-game { color: #ff6b9d; background: rgba(255, 107, 157, 0.08); }
.type-article { color: #b07cff; background: rgba(176, 124, 255, 0.08); }
.type-soon { color: #6a6a72; border-style: dashed; }
.type-soon::before { display: none; }
.card .tag { line-height: 1; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 14px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  font: inherit; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
}
.chip:hover { color: var(--fg); border-color: #3a3a41; }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.chip-atlas::before, .chip-game::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.chip-atlas::before { background: #3fcfe6; }
.chip-game::before { background: #ff6b9d; }
.section-head { align-items: center; }
.no-results { padding: 28px 0; }

/* Game card */
.card-game { border-color: #2a1a22; background: #0d0709; }
.card-game:hover { border-color: #ff6b9d; box-shadow: 0 0 0 1px rgba(255, 107, 157, 0.2), 0 24px 60px -24px rgba(255, 107, 157, 0.35); }
.visual-game { background: radial-gradient(110% 90% at 50% 40%, #1d0f16 0%, #0a0507 70%); border-bottom-color: #2a1a22; display: grid; place-items: center; }
.visual-game svg { width: 86%; height: auto; }
.visual-tag-game { color: #ff9fbf; }
.visual-tag-game::before { background: #ff6b9d; box-shadow: 0 0 8px #ff6b9d; }
.card-game .status { color: #ff6b9d; }
