/* ============================================================
   VibePet — long-scroll section CSS
   ============================================================ */

/* ---------- MESSAGE CARD ---------- */
.msg-card {
  width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--t-fast);
}
.msg-card.drift {
  box-shadow: 0 12px 32px -16px rgba(0,0,0,.4);
}
[data-theme="light"] .msg-card.drift { box-shadow: 0 12px 32px -18px rgba(0,0,0,.16); }
.msg-card:hover { border-color: var(--border-strong); }
.msg-head { display: flex; align-items: center; justify-content: space-between; }
.msg-title { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.3; }
.msg-body { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }
.msg-actions { margin-top: 4px; display: flex; gap: 6px; }
.msg-card .msg-mini { border-color: var(--border-strong); color: var(--text-secondary); }
.msg-card .msg-mini[data-color="mint"] { border-color: color-mix(in oklch, var(--accent-mint) 35%, transparent); color: var(--accent-mint); }
.msg-card .msg-mini[data-color="coral"] { border-color: color-mix(in oklch, var(--accent-coral) 35%, transparent); color: var(--accent-coral); }
.msg-card .msg-mini[data-color="amber"] { border-color: color-mix(in oklch, var(--accent-amber) 35%, transparent); color: var(--accent-amber); }
.msg-card .msg-mini.primary {
  border-color: color-mix(in oklch, var(--accent-blue) 45%, transparent);
  background: color-mix(in oklch, var(--accent-blue) 10%, transparent);
  color: var(--accent-blue);
}

/* ---------- CHAOS → CALM ---------- */
.chaos-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  margin-top: 24px;
  min-height: 480px;
}
@media (max-width: 980px) {
  .chaos-stage { grid-template-columns: 1fr; gap: 24px; min-height: auto; }
  .chaos-arrow { order: 2; flex-direction: row; }
  .chaos-right { order: 3; }
}
.chaos-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.chaos-cards {
  position: relative;
  min-height: 440px;
}
.chaos-card-pos {
  position: absolute;
  animation: chaos-float 6s ease-in-out infinite;
  transition: transform 250ms ease;
}
.chaos-cards .chaos-card-pos:nth-child(1) { left: 4%;  top: 0; }
.chaos-cards .chaos-card-pos:nth-child(2) { right: 4%; top: 8%; }
.chaos-cards .chaos-card-pos:nth-child(3) { left: 0;   top: 32%; }
.chaos-cards .chaos-card-pos:nth-child(4) { right: 8%; top: 38%; }
.chaos-cards .chaos-card-pos:nth-child(5) { left: 8%;  top: 62%; }
.chaos-cards .chaos-card-pos:nth-child(6) { right: 0;  top: 70%; }
.chaos-cards .msg-card { width: 240px; }

@keyframes chaos-float {
  0%, 100% { transform: translate(var(--x, 0), 0) rotate(var(--r, 0)); }
  50%      { transform: translate(var(--x, 0), -6px) rotate(var(--r, 0)); }
}

.chaos-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chaos-arrow-line {
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--border-strong), transparent);
}
@media (max-width: 980px) {
  .chaos-arrow-line { width: 80px; height: 1px; background: linear-gradient(to right, transparent, var(--border-strong), transparent); }
}

.chaos-right-stage {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

/* ---------- HOW IT WORKS ---------- */
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 56px;
}
@media (max-width: 900px) { .how-grid { grid-template-columns: 1fr; } }
.how-step {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.how-step-head { font-size: 11px; letter-spacing: 0.08em; }
.how-step-stage {
  background: var(--bg-deeper);
  border-radius: 12px;
  height: 200px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--border-subtle);
}
[data-theme="light"] .how-step-stage { background: #1a1a1a; }
.how-step-stage .notch-stage {
  border: none;
  background: transparent;
  padding: 0;
  min-height: auto;
  transform: scale(0.7);
  transform-origin: center;
}
.how-step-stage .notch-pill {
  border-radius: 999px !important;
}
.how-step-title { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.how-step-body { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }

/* ---------- HIFI variants ---------- */
.how-grid.hifi {
  align-items: stretch;
  gap: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.how-step.hifi {
  background: transparent;
  border: none;
  padding: 0;
  gap: 14px;
  min-width: 0;
}
.how-step-stage.hifi {
  background: transparent;
  border: none;
  padding: 16px 0 0;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: visible;
}
.how-step-stage.hifi .hf-display-wrap {
  align-items: flex-start;
}
@media (max-width: 900px) {
  .how-grid.hifi { grid-template-columns: 1fr; }
}

/* Hero hi-fi stage */
.hero-stage-hifi {
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.hero-stage-hifi .hf-display-wrap {
  max-width: 100%;
}
.hero-stage-hifi .hf-display-caption {
  align-self: center;
}

/* Chaos→Calm right stage: give the expanded panel breathing room */
.chaos-right-stage {
  padding: 16px 0;
  min-height: 480px;
}
.chaos-right-stage .hf-island.expanded {
  width: min(540px, 100%);
}

.footprint-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
}
@media (max-width: 720px) {
  .footprint-strip { grid-template-columns: 1fr; }
}
.footprint-stat {
  background: var(--bg-surface);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footprint-n {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.footprint-num {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.footprint-unit { font-size: 13px; color: var(--text-secondary); }
.footprint-label { font-size: 13px; color: var(--text-muted); }

/* ---------- EIGHT TOOLS ---------- */
.tools-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 980px) {
  .tools-layout { grid-template-columns: 1fr; }
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
}
@media (max-width: 720px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}
.tool-tile {
  background: var(--bg-surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  transition: background 200ms ease;
  position: relative;
}
.tool-tile:hover, .tool-tile.active {
  background: var(--bg-elevated);
}
.tool-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.tool-tile-name { font-size: 14px; font-weight: 600; }
.tool-tile-purpose { font-size: 11px; line-height: 1.4; }

.tools-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 88px;
}
.tools-preview-head, .tools-preview-foot {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tools-preview-stage {
  display: flex;
  justify-content: center;
}
.tools-preview-stage .msg-card { width: 100%; }

/* ---------- PETS ---------- */
.pets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}
@media (max-width: 980px) { .pets-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .pets-grid { grid-template-columns: repeat(2, 1fr); } }
.pet-state-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: var(--t-fast);
}
.pet-state-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.pet-state-stage {
  width: 100%;
  height: 124px;
  display: grid;
  place-items: center;
  background: var(--bg-deeper);
  border-radius: 12px;
}
.pet-state-name { font-size: 16px; }
.pet-state-meta { font-size: 11px; }

.pets-foot {
  flex-wrap: wrap;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
}

/* ---------- SOUNDS ---------- */
.sounds-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
@media (max-width: 720px) { .sounds-grid { grid-template-columns: 1fr; } }
.sound-btn {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 16px;
  transition: var(--t-fast);
}
.sound-btn:hover { border-color: var(--border-strong); }
.sound-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  color: var(--text-primary);
  transition: var(--t-fast);
}
.sound-play:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.sound-play.playing {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}
.sound-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sound-name { font-size: 14px; font-weight: 500; }
.sound-wave {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 22px;
}
.wave-bar {
  flex: 1;
  background: var(--border-strong);
  border-radius: 1px;
  min-height: 2px;
  transition: background 150ms ease;
}
.wave-bar.active { background: var(--accent-blue); }
.sound-meta { font-size: 12px; color: var(--text-muted); }
.sound-cat {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sounds-foot {
  flex-wrap: wrap;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
}

/* ---------- LOCAL-FIRST ---------- */
.local-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 900px) { .local-grid { grid-template-columns: 1fr; } }
.local-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--bg-surface);
}
.local-card-num { font-size: 11px; }
.local-card-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.local-card-body { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }

.local-log {
  background: var(--bg-deeper);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
[data-theme="light"] .local-log { background: #1a1a1a; color: #f5f5f5; }
.local-log-head { display: flex; justify-content: space-between; }
.local-log-body {
  margin: 0;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.7;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow-x: auto;
  color: var(--text-secondary);
}
[data-theme="light"] .local-log-body { background: #0a0a0a; color: #d4d4d4; border-color: rgba(255,255,255,.06); }
.local-log-foot { padding: 0 2px; }

/* ---------- HATCH PET FORM ---------- */
.hatch-foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-top: 24px;
}
.hatch-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  transition: var(--t-fast);
}
.hatch-form:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent-blue) 12%, transparent);
}
.hatch-prefix {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-right: 6px;
  border-right: 1px solid var(--border-subtle);
}
.hatch-input {
  font: inherit;
  font-size: 15px;
  font-family: var(--font-display);
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 4px;
  min-width: 0;
  width: 100%;
}
.hatch-input::placeholder { color: var(--text-muted); }
.hatch-cta {
  padding: 10px 18px;
  font-size: 14px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.hatch-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  flex-wrap: wrap;
  letter-spacing: 0.02em;
}
.hatch-link {
  color: var(--accent-blue);
  border-bottom: 1px dashed currentColor;
  padding-bottom: 1px;
}
.hatch-link:hover { color: var(--text-primary); }
@media (max-width: 640px) {
  .hatch-form {
    grid-template-columns: 1fr;
    padding: 10px;
    border-radius: 16px;
  }
  .hatch-prefix { padding: 0 0 4px; border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .hatch-cta { justify-content: center; }
}

/* ---------- SOUND HERO BUTTONS ---------- */
.sounds-grid.hero {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .sounds-grid.hero { grid-template-columns: 1fr; }
}

.sound-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  padding: 20px 22px 22px;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-canvas));
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  transition:
    border-color 200ms ease,
    transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 250ms ease;
}
.sound-hero:hover {
  border-color: var(--border-emph);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,0.45);
}
.sound-hero.playing {
  border-color: color-mix(in oklch, var(--sh-color, var(--accent-blue)) 55%, var(--border-emph));
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--sh-color, var(--accent-blue)) 35%, transparent),
              0 22px 50px -20px color-mix(in oklch, var(--sh-color, var(--accent-blue)) 55%, transparent);
}

/* tone palettes */
.sound-hero.tone-blue  { --sh-color: var(--accent-blue); }
.sound-hero.tone-mint  { --sh-color: var(--accent-mint); }
.sound-hero.tone-amber { --sh-color: var(--accent-amber); }
.sound-hero.tone-coral { --sh-color: var(--accent-coral); }
.sound-hero.tone-purple{ --sh-color: var(--accent-purple); }

.sound-hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 80% at 50% 100%, color-mix(in oklch, var(--sh-color) 40%, transparent) 0%, transparent 70%);
  opacity: 0;
  z-index: -1;
  transition: opacity 320ms ease;
}
.sound-hero.playing .sound-hero-glow { opacity: 1; }

.sound-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sound-hero-head .sound-cat {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sh-color);
  font-weight: 600;
}
.sound-hero-dur {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.sound-hero-stage {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  align-items: center;
  padding: 8px 0;
}

.sound-hero-ring {
  position: relative;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
}
.sound-hero-ring .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid color-mix(in oklch, var(--sh-color) 50%, transparent);
  opacity: 0;
  pointer-events: none;
}
.sound-hero.playing .ring.r1 { animation: sh-ring 1.6s ease-out infinite; }
.sound-hero.playing .ring.r2 { animation: sh-ring 1.6s ease-out infinite 0.4s; }
.sound-hero.playing .ring.r3 { animation: sh-ring 1.6s ease-out infinite 0.8s; }
@keyframes sh-ring {
  0%   { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.8); opacity: 0; }
}

.sound-hero-play {
  position: relative;
  z-index: 1;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--sh-color);
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--sh-color) 60%, transparent),
    0 12px 28px -8px color-mix(in oklch, var(--sh-color) 60%, transparent);
  transition: transform 200ms ease, background 200ms ease;
}
.sound-hero:hover .sound-hero-play { transform: scale(1.04); }
.sound-hero:active .sound-hero-play { transform: scale(0.96); }
.sound-hero.playing .sound-hero-play { background: color-mix(in oklch, var(--sh-color) 80%, #000); }

.sound-hero-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 60px;
  flex: 1;
}
.sound-hero-wave .wave-bar {
  flex: 1 1 0;
  min-width: 2px;
  background: color-mix(in oklch, var(--text-muted) 60%, transparent);
  border-radius: 2px;
  transition: background 200ms ease, transform 200ms ease;
  transform-origin: center;
}
.sound-hero-wave .wave-bar.active {
  background: var(--sh-color);
}
.sound-hero.playing .sound-hero-wave .wave-bar {
  animation: sh-wave 0.9s ease-in-out infinite alternate;
}
@keyframes sh-wave {
  from { transform: scaleY(0.45); }
  to   { transform: scaleY(1.05); }
}

.sound-hero-body { display: flex; flex-direction: column; gap: 4px; }
.sound-hero-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.sound-hero-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.sound-hero-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: color-mix(in oklch, var(--sh-color) 12%, transparent);
}
.sound-hero-bar > span {
  display: block;
  height: 100%;
  background: var(--sh-color);
  transition: width 80ms linear;
}

/* ---------- DOWNLOAD (single CTA) ---------- */
.download-solo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 24px auto 32px;
  max-width: 520px;
}
.download-solo .download-dmg {
  font-size: 16px;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
}
.download-solo .dl-card-meta {
  text-align: center;
  font-size: 12px;
}

/* ---------- DOWNLOAD ---------- */
.download-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 900px) { .download-grid { grid-template-columns: 1fr; } }
.download-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 24px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--bg-surface);
}
.download-card.primary {
  border-color: color-mix(in oklch, var(--accent-blue) 35%, var(--border-subtle));
  background: linear-gradient(180deg, color-mix(in oklch, var(--accent-blue) 6%, var(--bg-surface)), var(--bg-surface));
}
[data-accent="mint"] .download-card.primary {
  border-color: color-mix(in oklch, var(--accent-mint) 35%, var(--border-subtle));
  background: linear-gradient(180deg, color-mix(in oklch, var(--accent-mint) 6%, var(--bg-surface)), var(--bg-surface));
}
.dl-card-eyebrow { font-size: 11px; }
.dl-card-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.dl-card-body { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
.dl-card-meta { font-size: 11px; letter-spacing: 0.04em; margin-top: 4px; }

.download-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  font-size: 12px;
}
.download-foot a { color: var(--text-secondary); border-bottom: 1px solid var(--border-strong); }
.download-foot a:hover { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }

/* ---------- DOWNLOAD COMMAND ---------- */
.dl-cmd {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: var(--t-fast);
  max-width: 100%;
  min-width: 0;
}
.dl-cmd:hover { border-color: var(--border-emph); background: var(--bg-elevated); }
.dl-cmd.primary { border-color: var(--accent-blue); background: color-mix(in oklch, var(--accent-blue) 8%, transparent); }
.dl-prefix { color: var(--text-muted); font-size: 12px; flex: none; }
.dl-text {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.dl-copy {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--bg-canvas);
  display: inline-grid;
  place-items: center;
  color: var(--text-secondary);
  flex: none;
  transition: var(--t-fast);
  border: 1px solid var(--border-subtle);
}
.dl-copy:hover { color: var(--accent-blue); border-color: var(--accent-blue); }

.download-dmg svg { transition: transform 200ms ease; }
.download-dmg:hover svg { transform: translateY(1px); }

/* ---------- FOOTER ---------- */
.foot {
  border-top: 1px solid var(--border-subtle);
  padding: 64px 0 32px;
  background: var(--bg-surface);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 32px;
}
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.foot-col a {
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 150ms ease;
}
.foot-col a:hover { color: var(--text-primary); }
.foot-col-head { font-size: 11px; letter-spacing: 0.08em; margin-bottom: 4px; }
.foot-version { margin-top: 16px; font-size: 11px; }
.foot-rule {
  height: 1px;
  background: var(--border-subtle);
  margin: 48px 0 24px;
}
.foot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
}

/* ---------- TWEAKS PANEL custom adjust ---------- */
.tweaks-panel-trigger {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 60;
}

/* ============================================================
   RESPONSIVE — mobile + tablet polish
   ============================================================ */

/* Calm-side scaling wrapper (chaos→calm) */
.chaos-calm-scaler {
  position: relative;
  max-width: 100%;
  overflow: hidden;
}
.chaos-calm-scaler .chaos-calm-inner {
  transform: scale(var(--calm-scale, 1));
  transform-origin: top left;
  width: 540px;
}

/* Responsive containers — tighter padding on phones */
@media (max-width: 720px) {
  .container { padding: 0 18px; }
  :root { --section-py: clamp(56px, 11vw, 100px); }
}
@media (max-width: 480px) {
  .container { padding: 0 14px; }
}

/* Heading rhythm on small screens */
@media (max-width: 720px) {
  .section-heading { margin-bottom: 36px; gap: 10px; }
  .h-section { font-size: clamp(26px, 7vw, 40px); }
  .h-hero { font-size: clamp(36px, 9vw, 64px); line-height: 1.02; }
  .hero-sub { font-size: clamp(15px, 4vw, 17px); margin-top: 20px; }
  .hero-cta { margin-top: 28px; }
  .hero-meta { margin-top: 20px; gap: 16px; row-gap: 8px; }
}

/* Hero stage padding on small screens */
@media (max-width: 720px) {
  .hero { padding-top: 56px; }
  .hero-stage,
  .hero-stage-hifi { margin-top: 36px; gap: 12px; }
  .hero::before { height: 360px; }
}

/* Chaos→Calm: tighter stack, smaller cards on phone */
@media (max-width: 980px) {
  .chaos-stage { margin-top: 16px; gap: 16px; }
  .chaos-cards { min-height: 360px; }
  .chaos-cards .msg-card { width: 220px; }
}
@media (max-width: 640px) {
  .chaos-cards { min-height: 320px; }
  .chaos-cards .msg-card { width: 200px; padding: 12px; }
  .chaos-cards .msg-title { font-size: 12px; }
  .chaos-cards .msg-body { font-size: 11px; }
  .chaos-arrow-line { width: 60px; }
}
@media (max-width: 480px) {
  .chaos-cards .chaos-card-pos:nth-child(1) { left: 0; top: 0; }
  .chaos-cards .chaos-card-pos:nth-child(2) { right: 0; top: 10%; }
  .chaos-cards .chaos-card-pos:nth-child(3) { left: 0; top: 36%; }
  .chaos-cards .chaos-card-pos:nth-child(4) { right: 0; top: 46%; }
  .chaos-cards .chaos-card-pos:nth-child(5) { left: 0; top: 72%; }
  .chaos-cards .chaos-card-pos:nth-child(6) { right: 0; top: 82%; }
  .chaos-cards .msg-card { width: 188px; }
}
.chaos-right-stage { overflow: visible; }
@media (max-width: 980px) {
  .chaos-right-stage { min-height: auto; padding: 8px 0 16px; justify-content: flex-start; }
}

/* How-it-works steps: tighter on mobile */
@media (max-width: 900px) {
  .how-grid.hifi { gap: 32px; }
  .how-step.hifi { gap: 10px; }
  .how-step-head { letter-spacing: 0.04em; }
  .how-step-title { font-size: 17px; }
  .how-step-body { font-size: 13.5px; }
}

/* Footprint stats — 1 col on phone for readability */
@media (max-width: 720px) {
  .footprint-strip { grid-template-columns: 1fr; }
  .footprint-stat { padding: 20px 18px; }
  .footprint-num { font-size: 36px; }
}

/* Tools section */
@media (max-width: 980px) {
  .tools-preview { position: static; }
}
@media (max-width: 720px) {
  .tool-tile { padding: 16px; gap: 10px; }
  .tool-tile-name { font-size: 13px; }
  .tools-preview { padding: 16px; gap: 12px; }
}

/* Pets grid keeps existing breakpoints, but tweak the foot */
@media (max-width: 640px) {
  .pet-state-stage { height: 100px; }
  .pet-state-card { padding: 12px; gap: 8px; }
  .pet-state-name { font-size: 14px; }
}

/* Sounds: tighten cards on phone */
@media (max-width: 720px) {
  .sound-hero { padding: 16px 16px 18px; gap: 12px; border-radius: 18px; }
  .sound-hero-name { font-size: 18px; }
  .sound-hero-desc { font-size: 12.5px; }
  .sound-hero-stage { grid-template-columns: 72px 1fr; gap: 12px; }
  .sound-hero-ring { width: 72px; height: 72px; }
  .sound-hero-play { width: 52px; height: 52px; }
  .sound-hero-wave { height: 48px; }
}

/* Local-first card stack on phone */
@media (max-width: 720px) {
  .local-card { padding: 18px; }
  .local-log { padding: 12px; }
  .local-log-body { font-size: 11px; padding: 10px 12px; }
  .local-log-head { flex-wrap: wrap; gap: 8px; }
}

/* Download CTA */
@media (max-width: 720px) {
  .download-solo .download-dmg { font-size: 14px; padding: 12px 18px; white-space: normal; text-align: center; }
  .download-solo { gap: 12px; }
}

/* Footer */
@media (max-width: 900px) {
  .foot { padding: 48px 0 28px; }
  .foot-grid { gap: 24px; }
  .foot-rule { margin: 32px 0 18px; }
}
@media (max-width: 540px) {
  .foot-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Hero meta wraps cleanly on phones */
@media (max-width: 480px) {
  .hero-meta { flex-direction: column; align-items: flex-start; }
}

/* DownloadCommand pill should wrap text on tiny screens */
@media (max-width: 420px) {
  .dl-cmd { padding: 8px 6px 8px 12px; }
  .dl-text { font-size: 12px; white-space: normal; }
}

/* Section heading sub copy on small screens */
@media (max-width: 720px) {
  .sub { font-size: 15px; }
}
