/* ZTL — Zeo Thinking Labs
   Layout: one black field and a 1200px column. The hero sets the statement
   beside the dot knot; each section is a label rail beside its content,
   divided by hairlines. Single committed dark world: true black, greys only. */

@font-face { font-family: "IBM Plex Mono"; src: url(../fonts/IBMPlexMono-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(../fonts/IBMPlexMono-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url(../fonts/Inter-400-600.woff2) format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }

:root {
  --black: #000000;
  --white: #f0f0f0;   /* primary text */
  --grey-1: #a3a3a3;  /* reading text */
  --grey-2: #7a7a7a;  /* labels, meta: 4.9:1 on black, above the 4.5:1 minimum for small text */
  --grey-3: #2a2a2a;  /* strong rules */
  --grey-4: #151515;  /* hairlines, raised surfaces on hover */
  --tile: #0a0a0a;    /* tile surface, just off black */
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bar-h: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--black); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
::selection { background: var(--white); color: var(--black); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--white); outline-offset: 4px; }
section:focus { outline: none; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.skip {
  position: fixed; left: 12px; top: 12px; z-index: 60;
  padding: 10px 14px; background: var(--white); color: var(--black);
  font: 500 13px/1 var(--mono); transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ---------- Top bar: logo + hamburger; the menu stays closed until asked for ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(0, 0, 0, .86);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: opacity .5s var(--ease), border-color .3s, background-color .3s;
}
.bar.scrolled, .bar.open { border-bottom-color: var(--grey-4); }
.bar.open { background: var(--black); }
.bar-inner { height: var(--bar-h); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; }
.brand-knot { width: 44px; height: 25px; display: block; }

.burger { position: relative; width: 44px; height: 44px; margin-right: -10px; }
.burger span {
  position: absolute; left: 11px; right: 11px; top: 50%; height: 1.5px; margin-top: -.75px;
  background: var(--grey-1); transition: transform .45s var(--ease), background-color .2s;
}
.burger span:nth-child(1) { transform: translateY(-4px); }
.burger span:nth-child(2) { transform: translateY(4px); }
.burger:hover span, .bar.open .burger span { background: var(--white); }
.bar.open .burger span:nth-child(1) { transform: rotate(45deg); }
.bar.open .burger span:nth-child(2) { transform: rotate(-45deg); }

.menu {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--black); border-bottom: 1px solid var(--grey-4);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility .35s;
}
.bar.open .menu { opacity: 1; visibility: visible; transform: none; }
.menu-inner { display: flex; flex-direction: column; align-items: flex-end; padding-block: 18px 26px; }
.menu-links { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.menu-links a { font: 500 clamp(20px, 2.2vw, 24px)/1.35 var(--mono); letter-spacing: -.01em; color: var(--grey-1); transition: color .2s; }
.menu-links a:hover { color: var(--white); }
.menu-display { justify-content: flex-end; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--grey-4); font: 400 12px/1.4 var(--mono); }

/* logo can be hidden everywhere it appears */
[data-logo] { transition: opacity .5s var(--ease), visibility .5s; }
html.logo-off [data-logo] { opacity: 0; visibility: hidden; }

/* ---------- Hero ---------- */
.hero { padding-block: calc(var(--bar-h) + clamp(48px, 11vh, 130px)) clamp(64px, 12vh, 140px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero-text { min-width: 0; transition: opacity .9s var(--ease), transform .9s var(--ease); }
.eyebrow { font: 400 12px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--grey-2); margin: 0 0 28px; }
.statement {
  font: 500 clamp(34px, 5vw, 66px)/1.06 var(--mono);
  letter-spacing: -.035em; margin: 0; max-width: 14ch; text-wrap: balance;
}
.cursor {
  display: inline-block; width: .52em; height: .86em; margin-left: .14em;
  background: var(--white); vertical-align: -.06em;
  animation: blink 0.8s steps(1) infinite; /* 0.4 s on, 0.4 s off */
}
@keyframes blink { 50% { opacity: 0; } }
html.motion-off .cursor { animation: none; }
.lede { margin: 28px 0 0; max-width: 46ch; color: var(--grey-1); font-size: clamp(16px, 1.5vw, 18px); }
.jump { margin: 36px 0 0; display: flex; flex-wrap: wrap; gap: 14px 28px; font: 400 13px/1 var(--mono); }
.jump a { color: var(--grey-1); border-bottom: 1px solid var(--grey-3); padding-bottom: 7px; transition: color .2s, border-color .2s; }
.jump a:hover { color: var(--white); border-color: var(--white); }
.knot-slot { position: relative; width: 100%; max-width: 100%; aspect-ratio: 1000 / 570; }
.knot-slot canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- Sections ---------- */
.sec { border-top: 1px solid var(--grey-4); padding-block: clamp(72px, 11vw, 128px); scroll-margin-top: var(--bar-h); }
.sec-grid { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); }
.sec-head { align-self: start; position: sticky; top: calc(var(--bar-h) + 32px); }
.sec-head h2 { font: 500 clamp(26px, 3vw, 34px)/1.1 var(--mono); letter-spacing: -.02em; margin: 0; }
.sec-head .note { color: var(--grey-2); font-size: 14px; margin: 14px 0 0; max-width: 26ch; }
.sec-body { min-width: 0; }

.links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 24px 0 0; font: 400 13px/1.2 var(--mono); }
.links a { color: var(--grey-1); border-bottom: 1px solid transparent; padding-bottom: 3px; transition: color .2s, border-color .2s; }
.links a:hover { color: var(--white); border-color: var(--grey-2); }

/* Tools */
.tools-list { display: flex; flex-direction: column; gap: 44px; }
.repo { border-top: 1px solid var(--grey-3); padding-top: 24px; }
.repo-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; }
.repo h3 { font: 500 20px/1.2 var(--mono); margin: 0; }
.repo h3 a, .side h4 a { border-bottom: 1px solid transparent; transition: border-color .2s; }
.repo h3 a:hover, .side h4 a:hover { border-color: var(--white); }
.meta { font: 400 12px/1.4 var(--mono); color: var(--grey-2); margin: 0; }
.repo-desc { color: var(--grey-1); margin: 12px 0 0; max-width: 62ch; }

/* Research */
.exp-title { font: 500 22px/1.2 var(--mono); margin: 0; }
.exp-intro { color: var(--grey-1); max-width: 62ch; margin: 14px 0 0; }
.versus { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 44px; border-top: 1px solid var(--grey-3); }
.versus::before {
  content: "vs"; position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  padding: 0 12px; background: var(--black); color: var(--grey-2); font: 400 12px/1 var(--mono); letter-spacing: .1em;
}
.side { min-width: 0; padding: 32px 36px 0 0; }
.side + .side { padding: 32px 0 0 36px; border-left: 1px solid var(--grey-3); }
.who { font: 400 12px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: var(--grey-2); margin: 0 0 18px; }
.side h4 { font: 500 24px/1.2 var(--mono); margin: 0; }
.sub { color: var(--grey-2); font: 400 13px/1.4 var(--mono); margin: 6px 0 0; }
.desc { color: var(--grey-1); margin: 16px 0 0; }
.facts { margin: 22px 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 20px; font: 400 13px/1.5 var(--mono); }
.facts dt { color: var(--grey-2); }
.facts dd { margin: 0; color: var(--white); }

/* Activity: one dot per day, weeks as columns (drawn at build time, see scripts/activity.mjs) */
.activity { margin: 22px 0 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.activity svg { display: block; max-width: 100%; height: auto; fill: var(--white); }
.activity figcaption { font: 400 12px/1.4 var(--mono); color: var(--grey-2); }

/* Setup: a row of tiles, logo over name; each tile links to the tool */
.setup { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.setup > li { display: flex; min-width: 0; }  /* each tile fills its grid cell, so tiles in a row match */
.tile {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  aspect-ratio: 1 / 1.05; padding: 14px 6px; border: 1px solid var(--grey-4); border-radius: 14px;
  background: var(--tile); color: var(--grey-1); text-align: center;
  transition: border-color .2s, background-color .2s, color .2s;
}
.tile:hover, .tile:focus-visible { border-color: var(--grey-3); background: var(--grey-4); color: var(--white); }
.tile:focus-visible { outline-offset: 3px; }
.tile svg { width: 40px; height: 28px; fill: currentColor; flex: none; }
.tile-name { font: 400 13px/1.25 var(--sans); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.setup-note { color: var(--grey-2); font: 400 12px/1.5 var(--mono); margin: 20px 0 0; }

/* Philosophy */
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.principle { border-top: 1px solid var(--grey-3); padding-top: 20px; }
.principle h3 { font: 500 17px/1.3 var(--mono); margin: 0; }
.principle p { color: var(--grey-1); margin: 10px 0 0; font-size: 15px; }

/* Contribute */
.contribute-text { color: var(--grey-1); margin: 0; max-width: 56ch; font-size: clamp(16px, 1.6vw, 19px); }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--grey-4); padding-block: 36px calc(36px + env(safe-area-inset-bottom, 0px)); }
.foot-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; font: 400 12px/1.4 var(--mono); color: var(--grey-2); }
.foot-grid p { margin: 0; }
.display { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.display-label { color: var(--grey-2); text-transform: uppercase; letter-spacing: .2em; }
.display button { color: var(--grey-1); transition: color .2s; }
.display button:hover { color: var(--white); }
.display .state { color: var(--white); }
.display button[aria-pressed="false"] .state { color: var(--grey-2); }

/* ---------- Boot sequence ---------- */
.boot { position: fixed; inset: 0; z-index: 50; background: var(--black); display: none; opacity: 1; transition: opacity .35s ease; }
html.booting .boot, .boot.on { display: block; }
html.booting .knot-slot canvas { opacity: 0; } /* the boot overlay draws the knot until it lands here */
.boot.out { opacity: 0; }
.boot-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.boot-log {
  position: absolute; margin: 0;
  left: max(20px, env(safe-area-inset-left, 0px));
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + 64px);
  font: 400 12px/1.75 var(--mono); color: var(--grey-1);
  white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch;
  transition: opacity .4s ease;
}
.boot-log.fade { opacity: 0; }
.boot-skip {
  position: absolute; margin: 0;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--grey-2);
}
html.booting body { overflow: hidden; }
html.booting .bar { opacity: 0; }
html.booting .hero-text { opacity: 0; transform: translateY(14px); }

/* ---------- Narrow screens ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .knot-slot { order: -1; max-width: 560px; }
  .sec-grid { grid-template-columns: minmax(0, 1fr); }
  .sec-head { position: static; }
  .principles { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 720px) {
  .versus { grid-template-columns: minmax(0, 1fr); }
  .versus::before { display: none; }
  .side, .side + .side { padding: 28px 0 0; border-left: 0; }
  .side + .side { margin-top: 36px; border-top: 1px solid var(--grey-3); }
}
@media (max-width: 700px) {
  .setup { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; } /* every row as tall as the tallest */
  .tile { aspect-ratio: auto; min-height: 92px; gap: 10px; border-radius: 12px; }
  .tile-name { font-size: 12px; }
}
@media (max-width: 380px) {
  .tile { padding: 12px 2px; }
  .tile-name { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  /* Stop movement, but keep the cursor blinking: a blink isn't motion (system text cursors
     keep blinking under this setting too). The Motion switch still stops it. */
  *:not(.cursor), *::before, *::after { animation: none !important; }
}
