/* =============================================================
   TOKENS
   ============================================================= */
:root {
  --ink: #000000;
  --veil: #0a0a0c;
  --slab: #16161a;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.14);

  --light: #ffffff;
  --smoke: #a1a1a6;
  --tertiary: #6e6e73;

  /* Apple HIG dark mode status colours */
  --yellow:  #FFD60A;
  --orange:  #FF9F0A;
  --red:     #FF453A;
  --green:   #30D158;
  --blue:    #0A84FF;
  --cyan:    #32D7FF;
  --purple:  #BF5AF2;

  --accent: var(--cyan); /* live-mutated by scene switcher */

  --max: 1180px;
  --pad: clamp(20px, 5vw, 56px);

  --t-fast: 180ms cubic-bezier(.4,0,.2,1);
  --t-med:  340ms cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--ink);
  color: var(--light);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity var(--t-fast);
}
a:hover { opacity: 0.7; }

/* =============================================================
   SHARED PRIMITIVES
   ============================================================= */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

section {
  padding: clamp(72px, 12vw, 140px) 0;
  border-top: 1px solid var(--line);
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--smoke);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
  max-width: 22ch;
}

.section-lede {
  font-size: clamp(15px, 1.4vw, 17px);
  color: var(--smoke);
  max-width: 60ch;
  margin-bottom: 48px;
}

/* =============================================================
   HERO
   ============================================================= */
.hero {
  position: relative;
  padding-top: clamp(24px, 4vw, 40px);
  padding-bottom: clamp(40px, 8vw, 80px);
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    var(--ink);
  transition: background var(--t-med);
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.mark {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.15em;
  width: 36px; height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid; place-items: center;
}

.topbar-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--smoke);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  display: inline-block;
}

.hero-grid {
  max-width: var(--max);
  margin: clamp(48px, 10vw, 100px) auto 0;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 6vw, 64px);
  align-items: center;
}

@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.hero-title {
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.hero-title .accent {
  color: var(--accent);
  transition: color var(--t-med);
}

.hero-lede {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--smoke);
  max-width: 50ch;
  margin-bottom: 40px;
}

.hero-image img {
  border-radius: 28px;
  box-shadow:
    0 30px 80px -20px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04);
  max-width: 340px;
  margin: 0 auto;
}

/* SIGNATURE — Scene switcher */
.scene-switch {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  margin-top: 8px;
}

.scene-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tertiary);
  margin-bottom: 14px;
}

.scene-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.scene-btn {
  background: var(--slab);
  color: var(--smoke);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
}
.scene-btn:hover {
  color: var(--light);
  border-color: var(--line-strong);
}
.scene-btn.is-active {
  background: color-mix(in srgb, var(--accent) 18%, var(--slab));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.scene-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--tertiary);
  transition: color var(--t-med);
}

/* =============================================================
   AT A GLANCE
   ============================================================= */
.glance { background: var(--veil); }

.stats {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 48px;
}

@media (min-width: 600px) {
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 880px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}

.stats li {
  background: var(--veil);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-n {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-l {
  font-size: 13px;
  color: var(--smoke);
  line-height: 1.45;
}

.manifesto {
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.5;
  color: var(--light);
  max-width: 70ch;
}
.manifesto strong { color: var(--accent); font-weight: 500; transition: color var(--t-med); }

/* =============================================================
   TOUR
   ============================================================= */
.rooms-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 56px;
}
@media (min-width: 600px) { .rooms-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 880px) { .rooms-grid { grid-template-columns: repeat(3, 1fr); } }

.rooms-grid figure {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rooms-grid img {
  border-radius: 18px;
  width: 100%;
  aspect-ratio: 932 / 1786;
  object-fit: cover;
  object-position: top center;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.04);
}

.rooms-grid figcaption {
  font-size: 13px;
  color: var(--smoke);
  line-height: 1.5;
}
.rooms-grid figcaption strong {
  display: block;
  color: var(--light);
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
}

.principle {
  border-top: 1px solid var(--line);
  padding: 20px 0;
  cursor: pointer;
}
.principle:last-of-type { border-bottom: 1px solid var(--line); }
.principle summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 500;
  color: var(--light);
  position: relative;
  padding-right: 36px;
}
.principle summary::-webkit-details-marker { display: none; }
.principle summary::after {
  content: "+";
  position: absolute;
  right: 8px;
  top: -2px;
  color: var(--tertiary);
  font-size: 22px;
  font-weight: 300;
  transition: transform var(--t-fast);
}
.principle[open] summary::after { content: "−"; }

.p-mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--accent);
  transition: color var(--t-med);
  min-width: 16px;
}

.principle p {
  padding-top: 16px;
  max-width: 65ch;
  color: var(--smoke);
  font-size: 15px;
}

/* =============================================================
   KEYPAD
   ============================================================= */
.keypad { background: var(--veil); }

.keypad-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}
@media (min-width: 880px) {
  .keypad-layout { grid-template-columns: 320px 1fr; gap: 56px; }
}

.keypad-fig img {
  border-radius: 22px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}

.scenes {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}
.scenes th {
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tertiary);
  font-weight: 500;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line);
}
.scenes td {
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--smoke);
}
.scenes td:first-child { color: var(--light); font-weight: 500; }
.off-row td:first-child { color: var(--red); }
.off-row { border-top: 4px solid var(--ink); }

.scenes td span[class^="dot-"] {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 8px;
}
.dot-y { background: var(--yellow); }
.dot-c { background: var(--cyan); }
.dot-o { background: var(--orange); }
.dot-p { background: var(--purple); }
.dot-r { background: var(--red); }

.keypad-tech {
  font-size: 14px;
  color: var(--smoke);
  max-width: 65ch;
}
.keypad-tech code, code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92em;
  background: var(--slab);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--cyan);
}

.code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--slab);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 28px;
  overflow-x: auto;
  color: rgba(255,255,255,0.78);
  white-space: pre;
}
.c-kw { color: var(--cyan); }
.c-str { color: var(--green); }
.c-num { color: var(--orange); }
.c-comment { color: var(--tertiary); font-style: italic; }

/* =============================================================
   ENERGY
   ============================================================= */
.energy-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}
@media (min-width: 880px) {
  .energy-layout { grid-template-columns: 320px 1fr; gap: 56px; }
}

.energy-fig img {
  border-radius: 22px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}

.energy-list {
  list-style: none;
  display: grid;
  gap: 28px;
}
.energy-list h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--light);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.energy-list p {
  font-size: 15px;
  color: var(--smoke);
  line-height: 1.55;
  max-width: 60ch;
}

.badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  background: color-mix(in srgb, var(--green) 14%, transparent);
  color: var(--green);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* =============================================================
   CROSSED METER — TIMELINE
   ============================================================= */
.meter { background: var(--veil); }

.timeline {
  list-style: none;
  position: relative;
  padding-left: 32px;
  border-left: 1px solid var(--line);
  margin-bottom: 48px;
}

.timeline li {
  position: relative;
  padding: 4px 0 36px;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 3px var(--veil);
}
.timeline li.resolved::before { background: var(--green); }

.t-date {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--yellow);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.timeline li.resolved .t-date { color: var(--green); }

.timeline h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--light);
  margin-bottom: 6px;
}
.timeline p {
  font-size: 14.5px;
  color: var(--smoke);
  line-height: 1.6;
  max-width: 60ch;
}
.timeline strong { color: var(--light); }

.outcome {
  background: color-mix(in srgb, var(--green) 8%, var(--slab));
  border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
  border-radius: 16px;
  padding: 28px 32px;
}
.outcome-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 12px;
}
.outcome-body {
  font-size: 16px;
  line-height: 1.55;
  color: var(--light);
  max-width: 65ch;
}

/* =============================================================
   AUTOMATION
   ============================================================= */
.autom-item {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}
.autom-item:last-of-type { border-bottom: 1px solid var(--line); }
.autom-item summary {
  list-style: none;
  cursor: pointer;
  font-size: clamp(16px, 1.5vw, 18px);
  font-weight: 500;
  color: var(--light);
  padding-right: 36px;
  position: relative;
}
.autom-item summary::-webkit-details-marker { display: none; }
.autom-item summary::after {
  content: "+";
  position: absolute;
  right: 8px;
  top: -2px;
  color: var(--tertiary);
  font-size: 22px;
  font-weight: 300;
}
.autom-item[open] summary::after { content: "−"; }
.autom-item p {
  padding-top: 14px;
  color: var(--smoke);
  font-size: 15px;
  max-width: 65ch;
}

/* =============================================================
   STACK
   ============================================================= */
.stack { background: var(--veil); }

.stack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 600px) { .stack-grid { grid-template-columns: 1fr 1fr; } }

.stack-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  transition: color var(--t-med);
}
.stack-grid div p:last-child {
  font-size: 14.5px;
  color: var(--smoke);
  line-height: 1.65;
}

/* =============================================================
   CONTACT
   ============================================================= */
.contact {
  background: var(--ink);
  border-top: 1px solid var(--line);
  padding: clamp(72px, 12vw, 140px) 0 clamp(48px, 6vw, 72px);
}

.contact-name {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 12px;
}

.contact-meta {
  color: var(--smoke);
  font-size: clamp(14px, 1.4vw, 17px);
  max-width: 65ch;
  margin-bottom: 48px;
  line-height: 1.55;
}

.contact-links {
  list-style: none;
  display: grid;
  gap: 16px;
  margin-bottom: 64px;
}
.contact-links li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  font-size: 15px;
}
.c-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tertiary);
}
.contact-links a { color: var(--light); }
.contact-links a:hover { color: var(--accent); opacity: 1; transition: color var(--t-fast); }
.muted { color: var(--tertiary); }

.colophon {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--tertiary);
}

/* =============================================================
   REDUCED MOTION
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}

/* =============================================================
   FOCUS VISIBLE
   ============================================================= */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
