/* ─────────────────────────────────────────
   The Gift of Breath - Avery Lake, 2026
   breathstory.averylakeofficial.com
───────────────────────────────────────── */

/* ─────────────────────────────────────────
   The Gift of Breath - Avery Lake, 2026
   breathstory.averylakeofficial.com
───────────────────────────────────────── */

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

:root {
  /* DARK THEME (Default Swiss Stark) */
  --bg: #000000;
  --bg-soft: #111111;
  --text: #FFFFFF;
  --muted: rgba(255, 255, 255, 0.6);
  --dim: rgba(255, 255, 255, 0.4);
  --faint: rgba(255, 255, 255, 0.2);
  --line: rgba(255, 255, 255, 0.15);
  --gold: #FFFFFF; /* Replaced glow with stark white */
  --gold-soft: rgba(255, 255, 255, 0.1);
  --gold-dim: rgba(255, 255, 255, 0.4);
  --aqua: #FFFFFF; /* Replaced glow with stark white */
  --aqua-soft: rgba(255, 255, 255, 0.1);
  --aqua-dim: rgba(255, 255, 255, 0.4);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --breath-duration: 4s;
}

[data-theme="light"] {
  /* LIGHT THEME (Swiss White Cube) */
  --bg: #FFFFFF;
  --bg-soft: #F7F7F7;
  --text: #000000;
  --muted: rgba(0, 0, 0, 0.6);
  --dim: rgba(0, 0, 0, 0.4);
  --faint: rgba(0, 0, 0, 0.2);
  --line: rgba(0, 0, 0, 0.15);
  --gold: #000000;
  --gold-soft: rgba(0, 0, 0, 0.1);
  --gold-dim: rgba(0, 0, 0, 0.4);
  --aqua: #000000;
  --aqua-soft: rgba(0, 0, 0, 0.1);
  --aqua-dim: rgba(0, 0, 0, 0.4);
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: "Inter", ui-sans-serif, system-ui, "Helvetica Neue", Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
}

/* ── Atmospheric overlays ──────────────── */

.field-grid, .scanline {
  display: none; /* Removed for Swiss minimalism */
}

/* ── Topbar ────────────────────────────── */

.topbar {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.3s ease;
}

.brand-link {
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  transition: color 300ms ease, border-color 300ms ease;
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 0px;
  background: transparent;
}

.brand-link:hover {
  color: var(--text);
  border-color: var(--text);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 8px 14px;
  border-radius: 0px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 300ms ease, border-color 300ms ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--text);
}

/* ── Phase indicator (fixed right) ─────── */

.phase-nav {
  position: fixed;
  z-index: 40;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-end;
}

.phase-dot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: color 400ms ease;
  text-align: right;
}

.phase-dot::after {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 0%; /* Square for Swiss */
  border: 1px solid var(--dim);
  transition: border-color 400ms ease, background 400ms ease;
}

.phase-dot .phase-label {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 300ms ease, transform 300ms ease;
  white-space: nowrap;
}

.phase-nav:hover .phase-dot .phase-label,
.phase-dot.active .phase-label {
  opacity: 1;
  transform: translateX(0);
}

.phase-dot.active {
  color: var(--aqua);
}

.phase-dot.active::after {
  border-color: var(--text);
  background: var(--text);
}

.phase-dot.passed::after {
  border-color: var(--gold);
  background: var(--gold);
}

.phase-dot.passed {
  color: var(--gold-dim);
}

/* ── Hero section ──────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 28px;
  background: var(--bg);
}

.hero-eyebrow {
  margin: 0 0 24px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeInUp 1.2s ease 0.3s forwards;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.03em;
  opacity: 0;
  animation: fadeInUp 1.4s ease 0.6s forwards;
}

.hero-subtitle {
  margin: 32px 0 0;
  max-width: 520px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--muted);
  opacity: 0;
  animation: fadeInUp 1.4s ease 1s forwards;
}

/* Breathing line */
.breath-line {
  margin: 44px 0 0;
  width: 1px;
  height: 0;
  background: var(--gold);
  opacity: 0;
  animation: fadeIn 1.6s ease 1.4s forwards, breathLineGrow 1.6s ease 1.4s forwards;
}

.breath-line.alive {
  animation: breathLine var(--breath-duration) ease-in-out infinite;
  opacity: 1;
  height: 60px;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeIn 1s ease 2.2s forwards, breathFade 3s ease-in-out 3.2s infinite;
}

/* ── Chapter sections ──────────────────── */

.chapter {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 28px;
  overflow: hidden;
}

.chapter-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  max-width: 1100px;
  width: 100%;
  align-items: center;
}

.chapter:nth-child(even) .chapter-inner {
  direction: rtl;
}

.chapter:nth-child(even) .chapter-inner > * {
  direction: ltr;
}

.chapter-content {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.chapter.revealed .chapter-content {
  opacity: 1;
  transform: translateY(0);
}

.chapter-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.1s ease 0.15s, transform 1.1s ease 0.15s;
}

.chapter.revealed .chapter-visual {
  opacity: 1;
  transform: translateY(0);
}

/* Background glow per chapter */
.chapter::before {
  display: none; /* Removed for Swiss minimalism */
}

/* Chapter typography */
.chapter-eyebrow {
  margin: 0 0 16px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.chapter-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.02em;
}

.chapter-meta {
  margin: 0 0 28px;
  color: var(--dim);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.chapter-excerpt {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.72;
  max-width: 480px;
}

.chapter-excerpt em {
  color: var(--text);
  font-style: italic;
}

.chapter-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 0px;
  background: transparent;
  transition: color 300ms ease, border-color 300ms ease, background 300ms ease;
}

.chapter-link:hover {
  color: var(--bg);
  border-color: var(--text);
  background: var(--text);
}

.chapter-link::after {
  content: "→";
  transition: transform 200ms ease;
}

.chapter-link:hover::after {
  transform: translateX(3px);
}

/* ── Artwork frames ────────────────────── */

.artwork-frame {
  position: relative;
  display: block;
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0px;
  text-decoration: none;
  transition: border-color 500ms ease, transform 400ms ease;
}

.artwork-frame:hover {
  border-color: var(--text);
  transform: translateY(-4px);
}

.artwork-frame img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.88;
  transition: opacity 500ms ease;
}

.artwork-frame:hover img {
  opacity: 1;
}

/* Screen-style frame for interactive digital works */
.artwork-frame--screen {
  background: var(--bg);
  border-color: var(--line);
}

.artwork-frame--screen:hover {
  border-color: var(--text);
}

.object-stage.webgl-ready .object-fallback {
  display: none;
}

.object-stage canvas {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  display: block;
  pointer-events: auto; /* Allow interaction with the 3D element */
}

/* Enter overlay label */
.frame-enter {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--text);
  padding: 4px 10px;
  border-radius: 0px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 300ms ease, transform 300ms ease;
}

.artwork-frame:hover .frame-enter {
  opacity: 1;
  transform: translateY(0);
}

/* ── Divider between chapters ──────────── */

.chapter-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  padding: 0 28px;
}

.chapter-divider::before {
  content: "";
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--line), transparent);
}

/* ── Statement section ─────────────────── */

.statement-section {
  position: relative;
  min-height: 80svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 28px;
  max-width: 680px;
  margin: 0 auto;
}

.statement-section .chapter-eyebrow {
  margin-bottom: 28px;
}

.statement-lead {
  margin: 0 0 36px;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  line-height: 1.6;
  color: var(--text);
  font-weight: 400;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease, transform 1s ease;
}

.statement-section.revealed .statement-lead {
  opacity: 1;
  transform: translateY(0);
}

.statement-body {
  margin: 0 0 40px;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--muted);
  text-align: left;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease 0.2s, transform 1s ease 0.2s;
}

.statement-section.revealed .statement-body {
  opacity: 1;
  transform: translateY(0);
}

.statement-attribution {
  margin: 0;
  color: var(--dim);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 1s ease 0.4s;
}

.statement-section.revealed .statement-attribution {
  opacity: 1;
}

/* ── Footer ────────────────────────────── */

.site-footer {
  padding: 80px 28px;
  text-align: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.footer-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

.footer-links {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  color: var(--dim);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 300ms ease, border-color 300ms ease;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.footer-link:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

/* ── Keyframe animations ───────────────── */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathLine {
  0%, 100% {
    height: 40px;
    opacity: 0.4;
  }
  50% {
    height: 80px;
    opacity: 0.8;
  }
}

@keyframes breathLineGrow {
  from { height: 0; }
  to { height: 60px; }
}

@keyframes breathFade {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

@keyframes breathThread {
  0%, 100% {
    height: 40px;
    opacity: 0.4;
  }
  50% {
    height: 200px;
    opacity: 0.8;
  }
}

@keyframes breathPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.92);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.06);
  }
}

@keyframes ringDissolve {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  30% {
    opacity: 0.08;
    transform: scale(1.04);
  }
  60% {
    opacity: 0.5;
    transform: scale(0.98);
  }
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes glyphRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Responsive: tablet ────────────────── */

@media (max-width: 960px) {
  .chapter-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .chapter:nth-child(even) .chapter-inner {
    direction: ltr;
  }

  .chapter-content {
    order: 2;
  }

  .chapter-visual {
    order: 1;
  }

  .chapter-excerpt {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }

  .chapter-link {
    margin: 0 auto;
  }

  .visual-container {
    width: 220px;
    height: 220px;
    margin: 0 auto;
  }

  .phase-nav {
    right: 14px;
  }

  .phase-dot .phase-label {
    display: none;
  }
}

/* ── Responsive: mobile ────────────────── */

@media (max-width: 600px) {
  .topbar {
    padding: 14px 18px;
  }

  .hero {
    padding: 60px 20px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
  }

  .chapter {
    padding: 60px 20px;
    min-height: auto;
  }

  .chapter-inner {
    gap: 28px;
  }

  .visual-container {
    width: 180px;
    height: 180px;
  }

  .phase-nav {
    right: 8px;
  }

  .phase-dot {
    padding: 7px 0;
  }

  .phase-dot::after {
    width: 6px;
    height: 6px;
  }

  .statement-section {
    padding: 60px 20px;
  }
}

/* ── Reduced motion ────────────────────── */

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

  .chapter-content,
  .chapter-visual,
  .statement-lead,
  .statement-body,
  .statement-attribution {
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-eyebrow,
  .hero h1,
  .hero-subtitle,
  .breath-line,
  .hero-scroll-hint {
    opacity: 1 !important;
    animation: none !important;
  }
}


