/* ==========================================================================
   Smart Walking Stick, main stylesheet
   Tokens and components defined in design-system/MASTER.md
   ========================================================================== */

/* ---------- Design tokens ---------- */

:root {
  /* Colour */
  --color-bg: #FAF7F2;
  --color-bg-alt: #F3EDE2;
  --color-surface: #FFFFFF;
  --color-ink: #2B2924;
  --color-ink-soft: #5C574D;
  --color-ink-faint: #6E675C;
  --color-primary: #33608C;
  --color-primary-deep: #274A6D;
  --color-accent: #C2643C;
  --color-accent-text: #9C4A26;
  --color-line: #E7E0D4;
  --color-footer-bg: #2B2924;
  --color-focus: #33608C;
  --color-error: #B3261E;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --text-display: clamp(2.4rem, 5vw, 3.6rem);
  --text-h1: clamp(2rem, 4vw, 2.6rem);
  --text-h2: clamp(1.5rem, 3vw, 1.9rem);
  --text-h3: 1.2rem;
  --text-body-lg: 1.15rem;
  --text-body: 1.0625rem;
  --text-small: 0.9rem;
  --text-label: 0.8rem;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 999px;

  /* Elevation */
  --shadow-1: 0 1px 3px rgba(43, 41, 36, 0.06), 0 1px 2px rgba(43, 41, 36, 0.04);
  --shadow-2: 0 4px 14px rgba(43, 41, 36, 0.08);
  --shadow-3: 0 12px 32px rgba(43, 41, 36, 0.12);
}

/* ---------- Reset and base ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.7;
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-ink);
  text-wrap: balance;
}

p, li {
  max-width: 70ch;
}

a {
  color: var(--color-primary);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-primary-deep);
}

strong {
  font-weight: 600;
}

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

::selection {
  background: var(--color-primary);
  color: #fff;
}

/* ---------- Layout primitives ---------- */

.container {
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: var(--space-5);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-6);
  }
}

.section {
  padding-block: var(--space-8);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-9);
  }
}

.section-alt {
  background: var(--color-bg-alt);
  border-block: 1px solid var(--color-line);
}

.prose {
  max-width: 42rem;
}

.prose p {
  margin-bottom: 1em;
}

.prose ul,
.prose ol {
  margin: 0 0 1em 1.3em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose h2 {
  font-size: var(--text-h2);
  margin: 2.2em 0 0.6em;
}

.prose h3 {
  font-size: var(--text-h3);
  margin: 1.8em 0 0.5em;
}

.prose > :first-child {
  margin-top: 0;
}

/* Eyebrow label above section headings */
.eyebrow {
  display: block;
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  margin-bottom: var(--space-3);
}

.section-head {
  max-width: 42rem;
  margin-bottom: var(--space-7);
}

.section-head h2 {
  font-size: var(--text-h2);
  margin-bottom: var(--space-3);
}

.section-head p {
  color: var(--color-ink-soft);
}

.lede {
  font-size: var(--text-body-lg);
  color: var(--color-ink-soft);
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 200;
  background: var(--color-primary-deep);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 200ms ease-out;
}

.skip-link:focus-visible {
  top: var(--space-4);
  color: #fff;
}

/* ---------- Header and navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-line);
  transition: box-shadow 200ms ease-out;
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand span {
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  min-width: 44px;
  padding: 0.4rem 0.9rem;
  font: 600 var(--text-small) var(--font-body);
  color: var(--color-ink);
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--color-primary-deep);
}

.site-nav a[aria-current="page"] {
  color: var(--color-ink);
  font-weight: 600;
  border-bottom-color: var(--color-accent);
}

.site-nav a.nav-donate {
  color: #fff;
  border-bottom: none;
  padding: 0.5rem 1.4rem;
  margin-left: var(--space-1);
}

.site-nav a.nav-donate:hover {
  color: #fff;
}

@media (max-width: 767px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-line);
    box-shadow: var(--shadow-2);
    padding: var(--space-3) var(--space-5) var(--space-5);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-line);
  }

  .site-nav a[aria-current="page"] {
    border-bottom-color: var(--color-accent);
  }

  .site-nav a.nav-donate {
    justify-content: center;
    margin: var(--space-4) 0 0;
    padding: 0.7rem 1.6rem;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.7rem 1.6rem;
  font: 600 0.98rem var(--font-body);
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background-color 200ms ease-out, color 200ms ease-out,
    border-color 200ms ease-out, box-shadow 200ms ease-out, transform 200ms ease-out;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-deep);
  color: #fff;
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover {
  color: var(--color-primary-deep);
  border-color: var(--color-primary-deep);
  background: rgba(51, 96, 140, 0.06);
}

.btn-quiet {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  font: 600 0.95rem var(--font-body);
  color: var(--color-primary);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.btn-quiet:hover {
  color: var(--color-primary-deep);
}

.btn-quiet .icon {
  transition: transform 200ms ease-out;
}

.btn-quiet:hover .icon {
  transform: translateX(3px);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.donate-note {
  font-size: var(--text-small);
  color: var(--color-ink-faint);
}

/* ---------- Pills and badges ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35rem 0.9rem;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--color-ink);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-full);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.badge-future,
.badge-now {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  border: 1.5px solid currentColor;
  background: transparent;
}

.badge-future {
  color: var(--color-accent-text);
}

.badge-now {
  color: var(--color-primary);
}

/* ---------- Icons ---------- */

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.icon-lg {
  width: 26px;
  height: 26px;
}

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-line);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

/* ---------- Home hero ---------- */

.home-hero {
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-line);
  padding-block: var(--space-8) var(--space-8);
  overflow: hidden;
}

.home-hero-grid {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}

@media (min-width: 900px) {
  .home-hero {
    padding-block: var(--space-9);
  }

  .home-hero-grid {
    grid-template-columns: 7fr 5fr;
    gap: var(--space-8);
  }
}

.home-hero h1 {
  font-size: var(--text-display);
  margin-bottom: var(--space-5);
}

.home-hero .lede {
  margin-bottom: var(--space-6);
}

.home-hero .pill-row {
  margin-bottom: var(--space-6);
}

.hero-figure {
  position: relative;
  max-width: 360px;
  margin-inline: auto;
}

.hero-figure figure {
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: var(--space-3);
  transform: rotate(1.5deg);
}

.hero-figure img {
  border-radius: var(--radius-md);
  width: 100%;
}

.hero-figure figcaption {
  font-size: var(--text-small);
  color: var(--color-ink-faint);
  text-align: center;
  padding-top: var(--space-3);
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-line);
  padding-block: var(--space-8);
}

.page-hero h1 {
  font-size: var(--text-h1);
  max-width: 22ch;
  margin-bottom: var(--space-4);
}

.page-hero .lede {
  max-width: 42rem;
}

/* ---------- Bento grid ---------- */

.bento {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .bento {
    grid-template-columns: repeat(4, 1fr);
  }

  .bento-wide {
    grid-column: span 2;
  }

  .bento-tall {
    grid-row: span 2;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .bento-wide {
    grid-column: span 2;
  }
}

.bento-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
}

.bento-tile h3 {
  font-size: var(--text-h3);
  margin-bottom: var(--space-2);
}

.bento-tile p {
  font-size: var(--text-small);
  color: var(--color-ink-soft);
}

.bento-tile-photo {
  padding: 0;
  overflow: hidden;
}

.bento-tile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.bento-tile-photo .bento-photo-caption {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-small);
  color: var(--color-ink-soft);
  background: var(--color-surface);
  border-top: 1px solid var(--color-line);
}

.bento-stat {
  justify-content: center;
  text-align: center;
  background: var(--color-primary-deep);
  border-color: var(--color-primary-deep);
}

.bento-stat .stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.1;
}

.bento-stat .stat-label {
  font-size: var(--text-small);
  color: #DCE6F0;
  margin-top: var(--space-2);
}

/* Cue list inside bento (audio / haptic / laser rows) */
.cue-list {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cue-list li {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  max-width: none;
}

.cue-list .icon-tile {
  margin-bottom: 0;
  width: 42px;
  height: 42px;
}

.cue-list strong {
  display: block;
}

.cue-list span {
  font-size: var(--text-small);
  color: var(--color-ink-soft);
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: var(--space-6);
}

.card h3 {
  font-size: var(--text-h3);
  margin-bottom: var(--space-2);
}

.card p {
  font-size: var(--text-small);
  color: var(--color-ink-soft);
}

.card .badge-future,
.card .badge-now {
  margin-bottom: var(--space-3);
}

a.card {
  display: block;
  text-decoration: none;
  transition: transform 200ms ease-out, box-shadow 200ms ease-out, border-color 200ms ease-out;
}

a.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: #C5CFDA;
}

a.card .card-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--color-primary);
}

a.card:hover .card-more {
  color: var(--color-primary-deep);
}

/* ---------- Figures ---------- */

figure.photo {
  margin: var(--space-6) 0;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: var(--space-3);
}

figure.photo img {
  width: 100%;
  border-radius: var(--radius-sm);
}

figure.photo figcaption {
  font-size: var(--text-small);
  color: var(--color-ink-faint);
  text-align: center;
  padding-top: var(--space-3);
}

figure.photo.portrait {
  max-width: 400px;
}

/* Split layout: prose beside a figure */
.split {
  display: grid;
  gap: var(--space-7);
  align-items: start;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 7fr 5fr;
    gap: var(--space-8);
  }

  .split figure.photo {
    margin-top: 0;
  }
}

/* ---------- Pull quote ---------- */

.pullquote {
  margin: var(--space-7) 0;
  padding: var(--space-5) var(--space-6);
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-1);
}

.pullquote p {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--color-ink);
  margin: 0;
}

.pullquote footer {
  margin-top: var(--space-3);
  font-size: var(--text-small);
  color: var(--color-ink-faint);
}

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  max-width: 42rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-line);
}

.timeline li {
  position: relative;
  padding: 0 0 var(--space-6) var(--space-7);
  max-width: none;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-accent);
}

.timeline li.is-future::before {
  background: var(--color-bg);
  box-shadow: 0 0 0 2px var(--color-accent-text);
}

.timeline .when {
  display: block;
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  margin-bottom: var(--space-1);
}

.timeline h3 {
  font-size: var(--text-h3);
  margin-bottom: var(--space-1);
}

.timeline p {
  font-size: var(--text-small);
  color: var(--color-ink-soft);
}

/* ---------- Cueing demo ---------- */

.cue-demo {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  padding: var(--space-5);
  overflow: hidden;
}

@media (min-width: 768px) {
  .cue-demo {
    padding: var(--space-6);
  }
}

.cue-stage {
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
}

.cue-stage svg {
  display: block;
  width: 100%;
  height: auto;
}

.cue-steps {
  list-style: none;
  margin: var(--space-5) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .cue-steps {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cue-steps li {
  padding: var(--space-4);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: var(--text-small);
  color: var(--color-ink-soft);
  transition: background-color 400ms ease-out, border-color 400ms ease-out;
  max-width: none;
}

.cue-steps .step-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: var(--space-1);
}

.cue-steps .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-line);
  color: var(--color-ink-soft);
  flex-shrink: 0;
}

.cue-demo[data-phase="0"] .cue-steps li[data-phase="0"],
.cue-demo[data-phase="1"] .cue-steps li[data-phase="1"],
.cue-demo[data-phase="2"] .cue-steps li[data-phase="2"],
.cue-demo[data-phase="3"] .cue-steps li[data-phase="3"] {
  background: var(--color-surface);
  border-color: var(--color-primary);
}

.cue-demo[data-phase="0"] .cue-steps li[data-phase="0"] .step-num,
.cue-demo[data-phase="1"] .cue-steps li[data-phase="1"] .step-num,
.cue-demo[data-phase="2"] .cue-steps li[data-phase="2"] .step-num,
.cue-demo[data-phase="3"] .cue-steps li[data-phase="3"] .step-num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.cue-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.cue-controls .cue-note {
  font-size: var(--text-small);
  color: var(--color-ink-faint);
}

.cue-toggle .icon-pause {
  display: none;
}

.cue-demo.is-playing .cue-toggle .icon-play {
  display: none;
}

.cue-demo.is-playing .cue-toggle .icon-pause {
  display: block;
}

/* --- SVG scene element states --- */

.cue-scene .walker-body {
  stroke: var(--color-ink);
}

.cue-scene .leg {
  transform-box: fill-box;
  transform-origin: top center;
}

.cue-scene .leg-a {
  transform: rotate(-9deg);
}

.cue-scene .leg-b {
  transform: rotate(9deg);
}

.cue-demo.is-playing[data-phase="0"] .leg-a,
.cue-demo.is-playing[data-phase="3"] .leg-a {
  animation: leg-swing 0.75s ease-in-out infinite alternate;
}

.cue-demo.is-playing[data-phase="0"] .leg-b,
.cue-demo.is-playing[data-phase="3"] .leg-b {
  animation: leg-swing-b 0.75s ease-in-out infinite alternate;
}

@keyframes leg-swing {
  from { transform: rotate(-16deg); }
  to { transform: rotate(16deg); }
}

@keyframes leg-swing-b {
  from { transform: rotate(16deg); }
  to { transform: rotate(-16deg); }
}

/* Ground dashes scroll while walking */
.cue-scene .ground-dashes {
  stroke: var(--color-line);
}

.cue-demo.is-playing[data-phase="0"] .ground-dashes,
.cue-demo.is-playing[data-phase="3"] .ground-dashes {
  animation: ground-move 1.1s linear infinite;
}

@keyframes ground-move {
  from { transform: translateX(0); }
  to { transform: translateX(-60px); }
}

/* Freeze indicator */
.cue-scene .freeze-mark {
  opacity: 0;
  transition: opacity 400ms ease-out;
}

.cue-demo[data-phase="1"] .freeze-mark {
  opacity: 1;
}

.cue-demo.is-playing[data-phase="1"] .walker {
  animation: tremor 0.35s linear infinite;
}

@keyframes tremor {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-1.4px); }
  75% { transform: translateX(1.4px); }
}

/* Cue rings from the handle */
.cue-scene .ring {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}

.cue-demo[data-phase="2"] .ring,
.cue-demo[data-phase="3"] .ring {
  opacity: 0.5;
}

.cue-demo.is-playing[data-phase="2"] .ring,
.cue-demo.is-playing[data-phase="3"] .ring {
  animation: ring-pulse 1.5s ease-out infinite;
}

.cue-demo.is-playing .ring-2 {
  animation-delay: 0.5s !important;
}

.cue-demo.is-playing .ring-3 {
  animation-delay: 1s !important;
}

@keyframes ring-pulse {
  0% { transform: scale(0.4); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Beat dots (metronome) */
.cue-scene .beat {
  opacity: 0.15;
}

.cue-demo[data-phase="2"] .beat,
.cue-demo[data-phase="3"] .beat {
  opacity: 0.3;
}

.cue-demo.is-playing[data-phase="2"] .beat,
.cue-demo.is-playing[data-phase="3"] .beat {
  animation: beat-blink 1.5s ease-in-out infinite;
}

.cue-demo.is-playing .beat-2 {
  animation-delay: 0.5s !important;
}

.cue-demo.is-playing .beat-3 {
  animation-delay: 1s !important;
}

@keyframes beat-blink {
  0%, 100% { opacity: 0.25; }
  15% { opacity: 1; }
}

/* Laser line on the floor */
.cue-scene .laser-beam,
.cue-scene .laser-line {
  opacity: 0;
  transition: opacity 500ms ease-out;
}

.cue-demo[data-phase="2"] .laser-beam,
.cue-demo[data-phase="2"] .laser-line,
.cue-demo[data-phase="3"] .laser-beam,
.cue-demo[data-phase="3"] .laser-line {
  opacity: 1;
}

/* ---------- Contact band ---------- */

.contact-band {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-line);
  padding-block: var(--space-8);
}

.contact-band .inner {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 900px) {
  .contact-band .inner {
    grid-template-columns: 1fr auto;
  }
}

.contact-band h2 {
  font-size: var(--text-h2);
  margin-bottom: var(--space-3);
}

.contact-band p {
  color: var(--color-ink-soft);
}

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

.site-footer {
  background: var(--color-footer-bg);
  color: #DCD6CB;
  padding-block: var(--space-8) var(--space-6);
  font-size: var(--text-small);
}

.footer-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  margin-bottom: var(--space-7);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-8);
  }
}

.site-footer h2 {
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #B8B0A2;
  margin-bottom: var(--space-4);
}

.site-footer .footer-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: #FAF7F2;
  margin-bottom: var(--space-3);
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: var(--space-2);
}

.site-footer a {
  color: #FAF7F2;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(250, 247, 242, 0.15);
  padding-top: var(--space-5);
  color: #B8B0A2;
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Utility ---------- */

.mt-6 { margin-top: var(--space-6); }
.mt-7 { margin-top: var(--space-7); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

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

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
