/* Stillpoint — design system */

:root {
  --cream: #f6efe2;
  --cream-2: #ede5d0;
  --sage: #8a9a73;
  --sage-deep: #5e6e4a;
  --ochre: #c4a050;
  --terracotta: #b46a4a;
  --ink: #1c1d18;
  --ink-soft: #4a4b44;
  --hairline: rgba(28, 29, 24, 0.10);
  --hairline-strong: rgba(28, 29, 24, 0.24);
  --shadow-soft: 0 32px 64px -32px rgba(28, 29, 24, 0.16);
  --shadow-card: 0 28px 56px -24px rgba(28, 29, 24, 0.28);
  --shadow-hover: 0 48px 80px -24px rgba(28, 29, 24, 0.38);

  --font-display: "Cormorant Garamond", "Iowan Old Style", "Apple Garamond", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html, body {
  background: var(--cream);
  background-image:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(196, 160, 80, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 70% 60% at 85% 90%, rgba(94, 110, 74, 0.05) 0%, transparent 60%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
canvas { display: block; }

::selection { background: var(--ochre); color: var(--cream); }

/* ─── Keyboard focus styles ─── */
:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 5px;
  border-radius: 999px;
}
.scape:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 4px;
  border-radius: 24px;
}
.nav__links a:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ─── WebGL fallback (no-webgl class added by page.js) ─── */
.no-webgl #stage,
.no-webgl .scene-stage {
  background: linear-gradient(to bottom, #f8f3ec 0%, #f0e4c8 48%, #e8d4a8 100%);
}

/* ─── Cursor pulse loader ─── */
.boot {
  position: fixed; inset: 0; background: var(--cream);
  z-index: 1000; display: grid; place-items: center;
  transition: opacity 1s ease 0.2s, visibility 0s linear 1.2s;
}
.boot.hidden { opacity: 0; visibility: hidden; }
.boot__dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--sage-deep);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.8); opacity: 0.4; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* ─── Navigation ─── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 48px;
  z-index: 50;
  mix-blend-mode: difference;
  color: #f6efe2;
}
.nav__brand {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.nav__brand span { color: var(--ochre); }
.nav__links {
  display: flex; gap: 36px;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}
.nav__menu {
  display: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(34,35,31,0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #f6efe2;
  align-items: center; justify-content: center;
  font-size: 15px;
  transition: background 0.3s;
}
.nav.is-open .nav__links {
  display: flex; flex-direction: column;
  position: absolute; top: 64px; right: 18px;
  gap: 14px;
  background: rgba(26, 27, 22, 0.96);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  color: #f6efe2;
  padding: 20px 26px;
  border-radius: 20px;
  font-size: 12px;
  mix-blend-mode: normal;
  box-shadow: 0 16px 48px -8px rgba(0,0,0,0.28);
}
.nav__links a {
  position: relative;
  padding: 4px 0;
  transition: opacity 0.3s ease;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1.5px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.7, 0, 0.2, 1);
}
.nav__links a:hover::after,
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__links a.is-active { opacity: 1; }
.nav__links a { opacity: 0.65; }
.nav__links a:hover { opacity: 1; }

@media (max-width: 820px) {
  .nav {
    padding: 14px 22px;
    mix-blend-mode: normal;
    color: var(--ink);
    background: linear-gradient(to bottom,
      rgba(246, 239, 226, 0.92) 0%,
      rgba(246, 239, 226, 0.7) 70%,
      rgba(246, 239, 226, 0) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .nav__brand { font-size: 20px; }
  .nav__menu { display: flex; }
  .nav__links { display: none; }
  .nav.is-open { color: #f6efe2; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ─── Page scaffolding ─── */
.scene-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.scene-stage canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}

.overlay {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 8vw max(12vh, calc(88px + env(safe-area-inset-bottom, 0px)));
  pointer-events: none;
}
.overlay > * { pointer-events: auto; }
.overlay::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(246, 239, 226, 0) 35%,
    rgba(246, 239, 226, 0.40) 72%,
    rgba(246, 239, 226, 0.68) 100%);
  pointer-events: none;
  z-index: -1;
}
@media (max-width: 720px) {
  .overlay { padding: 0 28px calc(96px + env(safe-area-inset-bottom, 0px)); }
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 24px;
  font-weight: 500;
}
.eyebrow::before {
  content: ""; display: inline-block;
  width: 28px; height: 1px;
  background: var(--ink-soft);
  vertical-align: middle;
  margin-right: 12px;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 14ch;
}
.display em {
  font-style: italic;
  color: var(--ochre);
}

.lede {
  margin-top: 24px;
  font-size: clamp(15px, 1.2vw, 18px);
  max-width: 44ch;
  color: var(--ink-soft);
  line-height: 1.7;
}

.cta-row {
  margin-top: 36px;
  display: flex; gap: 14px; flex-wrap: wrap;
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 500;
  transition: all 0.5s cubic-bezier(0.7, 0, 0.2, 1);
}
@media (max-width: 720px) {
  .btn { padding: 13px 24px; font-size: 11.5px; letter-spacing: 0.10em; gap: 8px; }
  .cta-row { gap: 12px; margin-top: 32px; }
  .display { font-size: clamp(40px, 11.5vw, 72px) !important; }
  .lede { margin-top: 22px; font-size: 14.5px; line-height: 1.70; }
  .eyebrow { margin-bottom: 20px; font-size: 10px; }
}
.btn--primary {
  background: linear-gradient(135deg, #2c2e26 0%, var(--ink) 100%);
  color: var(--cream);
  box-shadow: 0 4px 24px -4px rgba(28,29,24,0.36), 0 1px 0 rgba(255,255,255,0.08) inset;
}
.btn--primary:hover {
  background: linear-gradient(135deg, var(--sage-deep) 0%, #4a5838 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 32px -4px rgba(94,110,74,0.42), 0 1px 0 rgba(255,255,255,0.08) inset;
}
.btn--primary:active { transform: translateY(0); }
.btn--ghost {
  border: 1px solid var(--hairline-strong);
  color: var(--ink);
  background: rgba(246, 239, 226, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  border-color: var(--ink);
  background: rgba(246, 239, 226, 0.75);
  transform: translateY(-2px);
}
.btn--ghost:active { transform: translateY(0); }
.btn .arrow {
  transition: transform 0.4s cubic-bezier(0.7, 0, 0.2, 1);
}
.btn:hover .arrow { transform: translateX(4px); }

/* ─── Page indicator (below brand, left) ─── */
.indicator {
  position: fixed; top: 82px; left: 48px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  z-index: 30;
}
.indicator span { color: var(--ink); }

@media (max-width: 820px) {
  .indicator { display: none; }
}

/* ─── Footer / bottom credit ─── */
.bottom-line {
  position: fixed;
  left: 48px; right: 48px;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  z-index: 40;
  pointer-events: none;
}
/* Scrollable pages: let the credit live in document flow at the end */
body[data-page="soundscapes"] .bottom-line,
body[data-page="about"] .bottom-line {
  position: static;
  margin: 48px 8vw 40px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}
@media (max-width: 720px) {
  body[data-page="soundscapes"] .bottom-line,
  body[data-page="about"] .bottom-line {
    margin: 52px 24px 44px;
  }
}
/* Hide home bottom-line on mobile — too long, overlaps CTAs */
@media (max-width: 720px) {
  body[data-page="home"] .bottom-line { display: none; }
}

/* Breathe + Focus: footer anchored to true bottom of viewport on mobile */
@media (max-width: 820px) {
  body[data-page="breathe"] .bottom-line,
  body[data-page="focus"] .bottom-line {
    bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
  }
}
.bottom-line span { pointer-events: auto; }
.bottom-line .credit { opacity: 0.6; transition: opacity 0.3s; }
.bottom-line .credit:hover { opacity: 1; }

@media (max-width: 720px) {
  .bottom-line {
    left: 24px; right: 24px; font-size: 9px;
    flex-direction: column; align-items: flex-start;
    gap: 5px;
    bottom: max(20px, env(safe-area-inset-bottom, 20px));
  }
  .bottom-line .credit { align-self: flex-end; }
}

/* ─── Soundscapes grid ─── */
.scapes {
  position: relative;
  min-height: 100vh;
  padding: 140px 8vw 160px;
}
.scapes__head {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 24px;
  margin-bottom: 88px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--hairline);
}
.scapes__head h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 84px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
}
.scapes__head h1 em { font-style: italic; color: var(--sage-deep); }
.scapes__hint {
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 36ch;
  line-height: 1.6;
}

.scape-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
@media (min-width: 1140px) {
  .scape-grid { grid-template-columns: repeat(3, 1fr); }
}
.scape--wide { grid-column: 1 / -1; aspect-ratio: 21 / 8; }
.scape--wide .scape__label {
  justify-content: center;
  text-align: center;
}
.scape--wide .scape__label > div {
  display: flex; flex-direction: column; align-items: center;
}
.scape--wide .scape__label h3 { font-size: 30px; }
.scape--wide .scape__label .scape__meta { display: none; }
@media (max-width: 820px) {
  .scape-grid { grid-template-columns: 1fr; gap: 20px; }
  .scape--wide { aspect-ratio: 4 / 3; }
  .scapes { padding: 104px 26px 100px; }
}
@media (max-width: 720px) {
  .scapes { padding: 96px 24px 120px; }
  .scapes__head {
    flex-direction: column; align-items: flex-start;
    margin-bottom: 48px; padding-bottom: 28px; gap: 16px;
  }
  .scapes__head h1 { font-size: clamp(36px, 10.5vw, 56px); }
  .scapes__hint { font-size: 13px; max-width: unset; }
  .scape { aspect-ratio: 3 / 2; }
  .scape__label { left: 20px; bottom: 18px; right: 20px; }
}

.scape {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: var(--cream-2);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: transform 0.7s cubic-bezier(0.7, 0, 0.2, 1), box-shadow 0.7s;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255,255,255,0.20);
}
.scape:hover {
  transform: translateY(-4px) scale(1.006);
  box-shadow: var(--shadow-hover), inset 0 1px 0 rgba(255,255,255,0.24);
}
.scape:active { transform: translateY(-2px) scale(1.002); }
.scape canvas { width: 100%; height: 100%; display: block; }

/* Gradient overlay for text legibility */
.scape::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(10, 11, 8, 0.80) 0%,
    rgba(10, 11, 8, 0.26) 38%,
    rgba(10, 11, 8, 0.06) 60%,
    transparent 76%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

.scape__label {
  position: absolute;
  left: 24px; bottom: 22px; right: 24px;
  display: flex; justify-content: space-between; align-items: flex-end;
  color: #f6efe2;
  pointer-events: none;
  z-index: 2;
}
.scape__label h3 {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  font-style: italic;
  line-height: 1;
}
.scape__label p {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 5px;
  opacity: 0.82;
}
.scape__meta {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: right;
  opacity: 0.65;
}

@media (max-width: 720px) {
  .scape__label h3 { font-size: 28px; }
  .scape__label p { font-size: 10.5px; }
  .scape__meta { font-size: 9px; }
}

.scape__play {
  position: absolute; top: 18px; right: 18px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  display: grid; place-items: center;
  z-index: 3;
  transition: background 0.4s, transform 0.4s, box-shadow 0.4s;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.24), 0 1px 0 rgba(255,255,255,0.6) inset;
}

/* SVG icon — show play, hide pause by default */
.scape__icon { display: block; position: relative; }
.scape__icon .icon--pause { opacity: 0; }
.scape__icon .icon--play  { opacity: 1; }

/* When playing: swap to pause icon */
.scape.is-playing .scape__icon .icon--play  { opacity: 0; }
.scape.is-playing .scape__icon .icon--pause { opacity: 1; }

.scape:hover .scape__play { transform: scale(1.10); box-shadow: 0 6px 28px rgba(0,0,0,0.30), 0 1px 0 rgba(255,255,255,0.6) inset; }
.scape.is-playing .scape__play {
  background: var(--ochre);
  color: #fff;
  box-shadow: 0 4px 24px rgba(196, 160, 80, 0.52), 0 1px 0 rgba(255,255,255,0.2) inset;
}
.scape__pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--ochre);
  opacity: 0;
}
.scape.is-playing .scape__pulse {
  animation: ringPulse 2s ease-out infinite;
}
@keyframes ringPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ─── Mixer dock ─── */
.mixer {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(160%);
  background: rgba(248, 243, 236, 0.96);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 24px;
  padding: 18px 26px;
  display: flex;
  align-items: center;
  gap: 28px;
  box-shadow: 0 24px 60px -12px rgba(28,29,24,0.28),
              0 0 0 1px rgba(255,255,255,0.8) inset,
              0 1px 0 rgba(255,255,255,1) inset;
  z-index: 70;
  transition: transform 0.65s cubic-bezier(0.7, 0, 0.2, 1);
  max-width: calc(100vw - 40px);
  overflow-x: auto;
}
.mixer.is-active { transform: translateX(-50%) translateY(0); }
.mixer__title {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.mixer__lane {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  opacity: 0.45;
  transition: opacity 0.35s;
}
.mixer__lane.is-active { opacity: 1; }
.mixer__name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink);
  min-width: 64px;
}
.mixer__slider {
  -webkit-appearance: none; appearance: none;
  width: 80px; height: 2px;
  background: linear-gradient(to right,
    var(--sage-deep) 0%,
    var(--sage-deep) var(--fill, 60%),
    var(--hairline-strong) var(--fill, 60%),
    var(--hairline-strong) 100%
  );
  outline: none; border-radius: 2px;
}
.mixer__slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%; background: var(--sage-deep);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  transition: transform 0.2s;
}
.mixer__slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.mixer__slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%; background: var(--sage-deep);
  cursor: pointer; border: none;
}
.mixer__slider {
  touch-action: pan-y;
}

@media (max-width: 720px) {
  .mixer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    row-gap: 20px;
    align-items: start;
    bottom: 18px;
    padding: 20px 22px 22px;
    border-radius: 22px;
    overflow-x: hidden;
  }
  .mixer__title { grid-column: 1 / -1; }
  .mixer__lane {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
  }
  .mixer__name { font-size: 13px; min-width: unset; }

  /* 44px tall input = reliable touch target; track rendered via pseudo-element */
  .mixer__slider { width: 100%; height: 44px; background: transparent; }
  .mixer__slider::-webkit-slider-runnable-track {
    height: 4px; border-radius: 2px;
    background: linear-gradient(to right,
      var(--sage-deep) 0%, var(--sage-deep) var(--fill, 60%),
      var(--hairline-strong) var(--fill, 60%), var(--hairline-strong) 100%
    );
  }
  .mixer__slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--sage-deep);
    box-shadow: 0 2px 8px rgba(0,0,0,0.24);
    margin-top: -11px;
  }
  .mixer__slider::-moz-range-track {
    height: 4px; border-radius: 2px;
    background: linear-gradient(to right,
      var(--sage-deep) 0%, var(--sage-deep) var(--fill, 60%),
      var(--hairline-strong) var(--fill, 60%), var(--hairline-strong) 100%
    );
  }
  .mixer__slider::-moz-range-thumb {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--sage-deep); border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.24);
  }
}

/* ─── Focus page ─── */
body[data-page="focus"] { overflow: hidden; }

.focus {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-top: 80px;   /* desktop nav height */
  padding-bottom: 56px; /* desktop footer clearance */
}
.focus .scene-stage {
  position: absolute; inset: 0;
}

/* Timer — always visible, floats over the scene */
.focus__timer-zone {
  position: relative; z-index: 5;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 32px 16px;
  min-height: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 55%, rgba(246,239,226,0.25) 0%, transparent 75%);
}

/* Controls drawer — glass panel anchored to bottom of the layout */
.focus__drawer {
  position: relative; z-index: 5;
  flex: 0 0 auto;
  max-height: 52vh;
  overflow-y: auto;
  text-align: center;
  background: rgba(248, 243, 236, 0.90);
  backdrop-filter: blur(36px) saturate(150%);
  -webkit-backdrop-filter: blur(36px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: 28px;
  margin: 0 32px 28px;
  padding: 28px 36px 32px;
  box-shadow: 0 20px 60px -12px rgba(28,29,24,0.22),
              0 -12px 40px -8px rgba(28,29,24,0.10),
              0 0 0 1px rgba(255,255,255,0.5) inset,
              0 1px 0 rgba(255,255,255,0.9) inset;
}

.focus__eyebrow {
  font-size: 11px; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 16px;
}
.focus__time {
  font-family: var(--font-display);
  font-size: clamp(80px, 14vw, 152px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.focus__phase {
  margin-top: 6px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--sage-deep);
}
.focus__sessions {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage-deep);
  min-height: 14px;
}
.focus__controls {
  display: flex; justify-content: center; gap: 8px;
  flex-wrap: wrap;
}
.focus__controls .btn {
  padding: 11px 22px;
  font-size: 12px;
  letter-spacing: 0.1em;
}
.focus__chip {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  transition: all 0.3s;
}
.focus__chip:hover { border-color: var(--ink); background: rgba(34,35,31,0.04); }
.focus__chip.is-active {
  background: var(--ink); color: var(--cream); border-color: var(--ink);
}
.focus__sound {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  display: flex; justify-content: center; gap: 4px;
  flex-wrap: wrap;
}
.focus__sound button {
  font-size: 10px; padding: 7px 12px;
  border-radius: 999px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.3s, background 0.3s;
  border: 1px solid transparent;
}
.focus__sound button:hover {
  color: var(--ink);
  background: rgba(34,35,31,0.06);
  border-color: var(--hairline);
}
.focus__sound button.is-active {
  color: var(--ochre);
  font-weight: 600;
  background: rgba(195,152,69,0.1);
  border-color: rgba(195,152,69,0.28);
}

@media (max-width: 820px) {
  /* Mobile: normal scrollable layout — no viewport lock */
  body[data-page="focus"] { overflow-y: auto; }

  .focus {
    position: relative;      /* out of fixed — participates in scroll */
    min-height: 100svh;
    min-height: 100vh;
    padding-top: 80px;       /* clear the fixed nav */
    padding-bottom: 64px;    /* clear the fixed footer (now flush to bottom) */
  }

  /* Keep the Three.js scene fixed so it stays as a background */
  .focus .scene-stage {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100svh;
  }

  /* Timer zone: natural height, no flex-grow, compact padding */
  .focus__timer-zone {
    flex: 0 0 auto;
    justify-content: flex-start;
    padding: 20px 24px 16px;
    min-height: auto;
  }

  /* Drawer: full card (not bottom-anchored), no height cap */
  .focus__drawer {
    flex: 0 0 auto;
    max-height: none;
    overflow-y: visible;
    margin: 0 16px;
    padding: 24px 20px 32px;
    border-radius: 24px;              /* full corners — it's a card now */
    border: 1px solid rgba(255,255,255,0.75); /* restore all four sides */
  }

  .focus__time { font-size: clamp(58px, 15vw, 88px); }
  .focus__phase { font-size: 18px; }
  .focus__eyebrow { margin-bottom: 10px; }
  .focus__sound { margin-top: 14px; padding-top: 14px; }
  .focus__sound button { padding: 8px 12px; }
}

/* ─── About page ─── */
.about {
  min-height: 100vh;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 880px) {
  .about { grid-template-columns: 1fr; }
}
.about__art {
  position: relative;
  min-height: 60vh;
  background: var(--cream-2);
  overflow: hidden;
}
.about__art canvas { position: absolute; inset: 0; }
.about__copy {
  padding: 140px 8vw 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (max-width: 880px) {
  .about__copy { padding: 80px 28px 100px; }
  .about__copy h1 { font-size: clamp(36px, 10vw, 56px); margin-bottom: 28px; }
  .about__copy p { font-size: 16px; margin-bottom: 20px; line-height: 1.75; }
  .about__signature { margin-top: 36px; font-size: 20px; }
  .about__signature small { font-size: 9px; }
}
.about__copy h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}
.about__copy h1 em { font-style: italic; color: var(--sage-deep); }
.about__copy p {
  color: var(--ink-soft);
  font-size: 17px;
  margin-bottom: 20px;
  max-width: 50ch;
  line-height: 1.78;
}
.about__copy p strong { color: var(--ink); font-weight: 600; }
.about__signature {
  margin-top: 40px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--ink);
}
.about__signature small {
  display: block;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* ─── Audio enable banner ─── */
.audio-toast {
  position: fixed; top: 88px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--ink); color: var(--cream);
  padding: 12px 22px; border-radius: 999px;
  font-size: 10px; letter-spacing: 0.20em;
  text-transform: uppercase;
  opacity: 0; pointer-events: none;
  transition: all 0.55s cubic-bezier(0.7, 0, 0.2, 1);
  z-index: 80;
  box-shadow: 0 10px 36px -8px rgba(0,0,0,0.32), 0 1px 0 rgba(255,255,255,0.08) inset;
  white-space: nowrap;
}
.audio-toast.is-visible {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ─── Reveal-on-load ─── */
.reveal { opacity: 0; transform: translateY(32px); }
.is-ready .reveal {
  opacity: 1; transform: translateY(0);
  transition: opacity 1.4s cubic-bezier(0.65, 0, 0.2, 1),
              transform 1.4s cubic-bezier(0.65, 0, 0.2, 1);
}
.is-ready .reveal:nth-child(2) { transition-delay: 0.15s; }
.is-ready .reveal:nth-child(3) { transition-delay: 0.30s; }
.is-ready .reveal:nth-child(4) { transition-delay: 0.46s; }
.is-ready .reveal:nth-child(5) { transition-delay: 0.62s; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Daily wisdom card (home) */
.daily {
  margin-top: 36px;
  padding-top: 24px;
  max-width: 540px;
  border-top: 1px solid var(--hairline);
  opacity: 0;
  transition: opacity 0.9s ease;
}
.daily.is-loaded { opacity: 1; }
.daily__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.daily__text {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(17px, 2.1vw, 22px);
  line-height: 1.55;
  color: var(--ink);
  letter-spacing: 0.005em;
}
.daily__author {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ─── Dark theme — warmth preserved, lightness inverted */
[data-theme="dark"] {
  --cream: #181510;
  --cream-2: #110f0a;
  --sage: #8a9a73;
  --sage-deep: #b4c598;
  --ochre: #d4aa5e;
  --terracotta: #c97f5a;
  --ink: #f2eadc;
  --ink-soft: #b4ac9e;
  --hairline: rgba(246, 239, 226, 0.10);
  --hairline-strong: rgba(246, 239, 226, 0.26);
  --shadow-card: 0 28px 56px -24px rgba(0, 0, 0, 0.52);
  --shadow-hover: 0 48px 80px -24px rgba(0, 0, 0, 0.65);
}
[data-theme="dark"] body { color-scheme: dark; }

/* ─── Nav action group (theme toggle + hamburger) */
.nav__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav__theme {
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.25s, transform 0.25s;
  flex-shrink: 0;
}
.nav__theme:hover { opacity: 1; }
.nav__theme:active { transform: scale(0.92); }

/* ─── Breathe page */
.breathe {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 24px 80px;
}
.breathe__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.breathe__panel {
  position: relative;
  text-align: center;
  z-index: 2;
  padding: 24px;
  max-width: 480px;
}
.breathe__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.breathe__phase {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(28px, 5vw, 44px);
  color: var(--ink);
  line-height: 1;
  text-transform: lowercase;
  letter-spacing: 0.01em;
}
.breathe__count {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  margin-top: 8px;
  margin-bottom: 24px;
  min-height: 18px;
}
.breathe__patterns {
  display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: center; margin-bottom: 22px;
}
.breathe__chip {
  background: transparent;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.breathe__chip.is-active {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.breathe__controls {
  display: flex; justify-content: center;
  margin-top: 6px;
}
.breathe__hint {
  margin-top: 22px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
}

@media (max-width: 720px) {
  .breathe { padding: 100px 28px 100px; }
  .breathe__panel { padding: 20px 0; }
  .breathe__eyebrow { margin-bottom: 28px; }
  .breathe__count { margin-bottom: 32px; }
  .breathe__patterns { gap: 10px; margin-bottom: 28px; }
  .breathe__controls { margin-top: 10px; }
  .breathe__hint { margin-top: 28px; font-size: 13.5px; }
}

/* ─── Dark mode: fix hardcoded cream values that don't adapt */
[data-theme="dark"] .overlay::before {
  background: linear-gradient(to bottom,
    rgba(26, 24, 18, 0) 35%,
    rgba(26, 24, 18, 0.55) 72%,
    rgba(26, 24, 18, 0.78) 100%);
}
[data-theme="dark"] .focus__drawer {
  background: rgba(18, 15, 10, 0.96);
  border-color: rgba(246, 239, 226, 0.10);
  box-shadow: 0 20px 60px -12px rgba(0,0,0,0.72),
              0 -12px 40px -8px rgba(0,0,0,0.40),
              0 0 0 1px rgba(246, 239, 226, 0.08) inset,
              0 1px 0 rgba(246, 239, 226, 0.12) inset,
              0 0 80px -20px rgba(212, 170, 94, 0.18);
}
[data-theme="dark"] .focus__timer-zone {
  background: radial-gradient(ellipse 80% 70% at 50% 55%, rgba(18,15,10,0.32) 0%, transparent 75%);
}
[data-theme="dark"] .mixer {
  background: rgba(20, 17, 12, 0.97);
  border-color: rgba(246, 239, 226, 0.12);
  box-shadow: 0 24px 60px -12px rgba(0,0,0,0.62),
              0 0 0 1px rgba(255,255,255,0.07) inset,
              0 1px 0 rgba(255,255,255,0.10) inset;
}
/* Dark mode play button: dark pill with a bright border ring — visible on any scene */
[data-theme="dark"] .scape__play {
  background: rgba(14, 12, 8, 0.78);
  color: #f2eadc;
  border: 2px solid rgba(242, 234, 220, 0.72);
  box-shadow: 0 4px 24px rgba(0,0,0,0.70);
}
[data-theme="dark"] .scape:hover .scape__play {
  border-color: rgba(242, 234, 220, 1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.80), 0 0 12px rgba(242,234,220,0.15);
}
[data-theme="dark"] .scape.is-playing .scape__play {
  border-color: transparent;
}
@media (max-width: 820px) {
  [data-theme="dark"] .nav {
    background: linear-gradient(to bottom,
      rgba(26, 24, 18, 0.95) 0%,
      rgba(26, 24, 18, 0.72) 70%,
      rgba(26, 24, 18, 0) 100%);
  }
}

/* ─── Dark mode: night tint over the daytime 3D scenes */
[data-theme="dark"] #stage::after,
[data-theme="dark"] .focus .scene-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
[data-theme="dark"] #stage::after {
  /* Heavier at the top (sky) where it reads most clearly as "day") */
  background: linear-gradient(to bottom,
    rgba(8, 6, 20, 0.72) 0%,
    rgba(8, 6, 20, 0.52) 55%,
    rgba(8, 6, 20, 0.28) 100%);
}
[data-theme="dark"] .focus .scene-stage::after {
  background: rgba(8, 6, 20, 0.58);
}

/* ─── Dark mode: focus timer warm glow */
[data-theme="dark"] .focus__time {
  text-shadow: 0 0 60px rgba(216, 169, 88, 0.22);
}

/* ─── Dark mode: ghost button — fix hardcoded cream background */
[data-theme="dark"] .btn--ghost {
  background: rgba(246, 239, 226, 0.06);
  border-color: rgba(246, 239, 226, 0.20);
}
[data-theme="dark"] .btn--ghost:hover {
  background: rgba(246, 239, 226, 0.12);
  border-color: rgba(246, 239, 226, 0.36);
  transform: translateY(-2px);
}

/* ─── Dark mode: daily card ochre separator */
[data-theme="dark"] .daily {
  border-top-color: rgba(216, 169, 88, 0.24);
}
[data-theme="dark"] .daily__text {
  opacity: 0.92;
}
