/* Crafted Chaos Labs. Plain CSS, mobile first. Colours taken from the intro: near-black, steel, the cyan ring. */
:root {
  --bg: #05090b;
  --panel: #0c1418;
  --line: #1c2a30;
  --text: #e6ecee;
  --muted: #9aa9ae;
  --accent: #39c6d3;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }

/* ── Intro: full screen, the logo circle always whole ───────────────────────
   The circle in the video is about 98% of the frame's height and 56% of its width, so the video is sized to
   the largest 16:9 box whose height fits the screen and whose middle 58% fits its width. On a wide screen it
   fills the height; on a phone the circle fills the width, centred, with the dark edges running off the sides. */
.intro {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #020405; /* the colour of the video's own edges, so a wide screen shows no seam */
}
.intro-video, .intro-end {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(177.78vh, 172vw);
  width: min(177.78svh, 172vw);
  height: auto;
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  object-fit: cover;
  display: block;
  /* the edges melt into the background (left/right on wide screens, top/bottom on phones); the circle sits in the
     middle 53% of the width and 98% of the height, so only its dark outer rim meets the top/bottom fade */
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 4%, #000 96%, transparent 100%);
  mask-composite: intersect;
}
.intro-end { opacity: 0; transition: opacity .4s var(--ease); }

/* The tagline appears under the logo once the intro has ended (or straight away with reduced motion). */
.tagline {
  position: absolute;
  left: 50%;
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 64px));
  transform: translate(-50%, 8px);
  width: calc(100% - 40px);
  margin: 0;
  text-align: center;
  color: var(--text);
  font-size: clamp(18px, 4.6vw, 26px);
  font-weight: 700;
  letter-spacing: .02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .8);
  opacity: 0;
  transition: opacity .8s var(--ease) .2s, transform .8s var(--ease) .2s;
}
.js .intro.ended .tagline, html:not(.js) .tagline { opacity: 1; transform: translate(-50%, 0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.intro.ended .intro-end { opacity: 1; }
.intro.ended .intro-video { visibility: hidden; }

/* Skip and the speaker sit over the intro, out of the logo's way, clear of the notch and home bar. */
.skip, .sound {
  position: fixed;
  z-index: 10;
  background: rgba(5, 9, 11, .6);
  border: 1px solid var(--line);
  color: var(--text);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity .3s var(--ease);
}
.skip {
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.sound {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: max(16px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.sound[hidden], .skip[hidden] { display: none; }
.sound svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound .speaker { fill: currentColor; stroke: none; }
.sound .waves { display: none; }
.sound[aria-pressed="true"] .waves { display: inline; }
.sound[aria-pressed="true"] .mute { display: none; }
.skip:focus-visible, .sound:focus-visible, .mail:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── Content: fades in when the intro ends (or is skipped). Without JavaScript it is simply there. ── */
.js .content { opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js.revealed .content { opacity: 1; transform: none; }
.content { max-width: 960px; margin: 0 auto; padding: 0 20px 40px; }
.section { padding: 56px 0 8px; }
.section:focus { outline: none; }
h2 {
  margin: 0 0 18px;
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}
h3 { margin: 0 0 6px; font-size: 22px; line-height: 1.25; }
p { margin: 0 0 12px; color: var(--muted); }
#about p { color: var(--text); max-width: 40em; }
#about p:first-of-type { font-size: 1.1em; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}
.card p:last-child { margin-bottom: 0; }
.card-more { background: transparent; border-style: dashed; }
.tag {
  display: inline-block;
  margin: 0 0 10px;
  padding: 2px 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tag-beta { color: #f2b950; border-color: #f2b950; }

/* Waitlist */
.waitlist { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.waitlist-title { margin: 0; color: var(--text); font-weight: 600; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.field em { font-style: normal; opacity: .7; }
.field input, .field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #071014;
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px stops iPhone zooming into the field */
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile:empty { display: none; }
.button {
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #031013;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.button:disabled { opacity: .6; cursor: wait; }
.button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.status { margin: 0; min-height: 1.4em; font-size: 15px; }
.status.ok { color: #6fe0a0; }
.status.error { color: #ff8f7a; }
.waitlist.done .field, .waitlist.done .button, .waitlist.done .turnstile { display: none; }
.fine { margin: 0; font-size: 13px; color: #6f7e83; }
.fine a { color: inherit; }

.mail { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  margin-top: 56px;
  padding: 24px 0 calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: #8a989d;
  font-size: 15px;
}
.footer .dot { color: #45555a; }

@media (min-width: 720px) {
  body { font-size: 18px; }
  .content { padding: 0 32px 56px; }
  .section { padding-top: 80px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
}

/* Reduced motion: no video, no fades (intro.js shows the final logo frame instead). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro-video { display: none; }
  .intro-end { opacity: 1; transition: none; }
  .tagline { opacity: 1; transform: translate(-50%, 0); transition: none; }
  .js .content { opacity: 1; transform: none; transition: none; }
}
