/* ============================================
   MB MEDIA — Design tokens
   Display: Space Grotesk / Body: DM Sans / Mono: JetBrains Mono
   ============================================ */
:root {
  --bg: #0a0a0d;
  --surface: #131318;
  --surface-2: #1a1a21;
  --border: #26262f;
  --text: #f2f2f5;
  --muted: #8f8f9c;
  --gold: #d4af37;
  --gold-dim: #a8862a;
  --teal: #3fb8af;
  --success: #34c77b;
  --error: #e5726c;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --max-width: 1080px;
}

[data-theme="light"] {
  --bg: #faf9f7;
  --surface: #ffffff;
  --surface-2: #f2f1ee;
  --border: #e4e2dd;
  --text: #17171a;
  --muted: #6b6b75;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  transition: background 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

h1, h2, h3, .display {
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0;
}

.mono { font-family: "JetBrains Mono", monospace; }

a { color: inherit; }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 35%, transparent);
}
.brand-text { white-space: nowrap; }
.brand .dot { color: var(--gold); }
.built-by {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border));
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.built-by strong { color: var(--gold); font-weight: 600; }
.built-by:hover {
  color: var(--text);
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, transparent);
}
.nav-links {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.15s;
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active {
  color: var(--gold);
  font-weight: 600;
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.theme-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 20px 20px;
  border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: var(--muted);
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.mobile-menu a.active {
  color: var(--gold);
  font-weight: 600;
}
.mobile-built-by {
  border-bottom: none !important;
  margin-top: 8px;
  font-size: 0.75rem !important;
  color: var(--muted) !important;
  text-align: center;
}

@media (max-width: 980px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
}
@media (max-width: 520px) {
  .brand-wrap {
    flex-wrap: wrap;
    row-gap: 4px;
    column-gap: 8px;
    max-width: calc(100% - 96px);
  }
  .built-by {
    padding: 3px 8px;
    font-size: 0.62rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .brand-text { font-size: 0.98rem; }
  .nav-inner { padding: 10px 12px; }
  .theme-toggle, .hamburger {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 56px;
  overflow: hidden;
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 520px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--gold) 14%, transparent), transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero-brand {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 auto 10px;
  color: var(--text);
  animation: fadeUp 0.5s ease both;
}
.hero-brand .dot { color: var(--gold); }
.hero h1 {
  font-size: clamp(1.55rem, 3.8vw, 2.4rem);
  max-width: 720px;
  margin: 0 auto 10px;
  animation: fadeUp 0.5s ease 0.05s both;
}
.hero h1 .accent { color: var(--gold); }
.hero p.tagline {
  color: var(--muted);
  font-size: 1rem;
  max-width: 440px;
  margin: 0 auto 20px;
  animation: fadeUp 0.5s ease 0.1s both;
}

.status-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 620px;
  margin: 18px auto 0;
  padding: 12px 14px;
  text-align: left;
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border));
  border-radius: var(--radius-sm);
  animation: fadeUp 0.5s ease 0.2s both;
}
.status-banner--youtube {
  background: color-mix(in srgb, #ff0000 8%, var(--surface));
  border-color: color-mix(in srgb, #ff0000 35%, var(--border));
}
.status-banner-icon {
  flex-shrink: 0;
  width: 56px;
  height: auto;
  border-radius: 8px;
  display: block;
}
.status-banner-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.status-banner-label {
  flex-shrink: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: #c00;
  border-radius: 999px;
  padding: 4px 9px;
  line-height: 1.2;
}
.status-banner p {
  margin: 0;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.45;
}
@media (max-width: 560px) {
  .status-banner {
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
  }
  .status-banner-icon {
    width: 48px;
  }
}

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

/* ---------- Convergence input bar (signature element) ---------- */
.converge {
  max-width: 640px;
  margin: 0 auto;
  animation: fadeUp 0.5s ease 0.15s both;
}
.platform-orbit {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 22px;
}
.platform-orbit .glyph {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  color: var(--muted);
  animation: bob 3.2s ease-in-out infinite;
}
.platform-orbit .glyph:nth-child(2) { animation-delay: 0.3s; }
.platform-orbit .glyph:nth-child(3) { animation-delay: 0.6s; }
.platform-orbit .glyph:nth-child(4) { animation-delay: 0.9s; }
.platform-orbit .glyph:nth-child(5) { animation-delay: 1.2s; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.input-bar {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  align-items: stretch;
}
.input-bar input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 14px 16px;
  font-size: 1rem;
  outline: none;
}
.input-bar input::placeholder { color: var(--muted); }
.input-bar .btn {
  flex-shrink: 0;
  align-self: stretch;
  min-height: 48px;
  padding-inline: 22px;
}
.hero-trust {
  margin: 12px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 560px) {
  .hero { padding: 28px 0 32px; }
  .hero-brand { margin-bottom: 6px; font-size: 1.45rem; }
  .hero h1 { font-size: 1.35rem; margin-bottom: 8px; }
  .hero p.tagline { font-size: 0.92rem; margin-bottom: 14px; }
  .hero-trust { font-size: 0.72rem; margin-top: 10px; }
  .converge { max-width: 100%; }
  .input-bar {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }
  .input-bar input {
    width: 100%;
    padding: 14px 12px;
    font-size: 16px;
  }
  .input-bar .btn {
    width: 100%;
    padding: 14px 18px;
    min-height: 48px;
  }
  .platform-orbit { display: none; }
  .preview-card,
  .download-manager,
  #previewSkeleton {
    margin-left: 0;
    margin-right: 0;
  }
  .preview-top {
    flex-direction: column;
    align-items: stretch;
  }
  .preview-top img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 220px;
  }
  .preview-meta h3 {
    font-size: 1rem;
    overflow-wrap: anywhere;
  }
  .btn-block { min-height: 48px; }
  #toast-container {
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    max-width: none;
  }
  .toast { min-width: 0; width: 100%; }
}
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  white-space: nowrap;
  transition: transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: #0a0a0d; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-block { width: 100%; }

.action-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.action-row button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.action-row button:hover { color: var(--gold); }
.action-row button:active { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }

#status {
  margin-top: 16px;
  font-size: 0.88rem;
  color: var(--muted);
  min-height: 1.4em;
}
#status.error { color: var(--error); }

/* ---------- Preview card ---------- */
.preview-card {
  display: none;
  max-width: 620px;
  margin: 28px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: left;
  box-shadow: var(--shadow);
}
.preview-top { display: flex; gap: 14px; }
.preview-top img {
  width: 130px; height: 74px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--surface-2);
}
.preview-meta h3 { font-size: 0.98rem; margin-bottom: 6px; line-height: 1.3; }
.preview-meta .sub { color: var(--muted); font-size: 0.8rem; }
.preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.preview-stats span {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: none;
  border: none;
  color: var(--muted);
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
  flex-shrink: 0;
  min-height: 44px;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-panel { display: none; padding-top: 14px; }
.tab-panel.active { display: block; }

select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 10px;
  min-height: 44px;
}
.extra-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chip-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.78rem;
  cursor: pointer;
  min-height: 44px;
}
.chip-btn.selected { color: var(--gold); border-color: var(--gold); }

/* ---------- Download manager ---------- */
.download-manager {
  max-width: 620px;
  margin: 20px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.download-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 20px 0;
  margin: 0;
}
.playlist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  cursor: pointer;
}
.playlist-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: left;
}
.job-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
}
.job-title {
  font-size: 0.85rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.job-actions button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  min-height: 36px;
  padding: 6px 8px;
  flex-shrink: 0;
}
.job-actions .save-btn {
  color: var(--gold);
  font-weight: 600;
}
.job-player {
  display: block;
  width: 100%;
  max-height: 280px;
  margin-top: 12px;
  border-radius: var(--radius-sm);
  background: #000;
}
audio.job-player {
  max-height: none;
  height: 40px;
}
.progress-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 0.3s ease;
}
.job-card.success .progress-fill { background: var(--success); }
.job-card.error .progress-fill { background: var(--error); }
.job-card.queued { opacity: 0.7; }
.job-card.queued .progress-fill { background: var(--muted); width: 100% !important; opacity: 0.3; }
.job-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 6px;
  font-family: "JetBrains Mono", monospace;
}
.job-stats .speed,
.job-stats .eta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Sections ---------- */
section { padding: 70px 0; }
.section-head { text-align: center; max-width: 560px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 10px; }
.section-head p { color: var(--muted); font-size: 0.95rem; }

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card .icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-size: 1.1rem;
}
.card h3 { font-size: 1rem; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 0.88rem; margin: 0; }

.stats-row {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
  text-align: center;
}
.stat-num { font-family: "Space Grotesk", sans-serif; font-size: 2rem; font-weight: 700; color: var(--gold); }
.stat-label { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }

.platform-grid {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.platform-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
}
.faq-a {
  display: none;
  color: var(--muted);
  font-size: 0.88rem;
  padding-top: 10px;
  line-height: 1.6;
}
.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.chev { transition: transform 0.2s; color: var(--muted); }

.testimonial-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.testimonial {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.testimonial p.quote { font-size: 0.9rem; margin-bottom: 14px; }
.testimonial .who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: #0a0a0d;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.who-name { font-size: 0.85rem; font-weight: 500; }
.who-role { font-size: 0.75rem; color: var(--muted); }

.donate-progress {
  background: var(--surface-2);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 20px 0 8px;
}
.donate-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  width: 34%;
}
.provider-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.provider-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 28px;
  align-items: start;
  max-width: 920px;
  margin: 0 auto;
}
form.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.field label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); }
.field .error-msg { color: var(--error); font-size: 0.76rem; margin-top: 4px; display: none; }
.field.invalid .error-msg { display: block; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--error); }
.contact-aside {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.contact-aside h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}
.contact-aside p, .contact-aside li {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}
.contact-aside ul {
  margin: 12px 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact-aside a { color: var(--gold); text-decoration: none; }
.contact-aside a:hover { text-decoration: underline; }
.aside-note { margin-top: 14px; }
.linkish {
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}
@media (max-width: 760px) {
  .contact-layout { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 50px 0 24px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 30px;
  margin-bottom: 34px;
}
.footer-grid h4 { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.footer-grid a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}
.footer-bottom a { color: var(--gold); text-decoration: none; }
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  section { padding: 48px 0; }
  .stats-row { gap: 28px; }
  .page-hero { padding: 44px 0 16px; }
}

/* ---------- Toast ---------- */
#toast-container {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  right: max(20px, env(safe-area-inset-right));
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  min-width: 240px;
  animation: toastIn 0.25s ease both;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: skeletonLoad 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonLoad {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- 404 ---------- */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}
.error-page .code {
  font-family: "Space Grotesk", sans-serif;
  font-size: 5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

/* ---------- Utility page content ---------- */
.prose {
  max-width: 720px;
  margin: 0 auto;
}
.prose h2 { margin-top: 34px; margin-bottom: 12px; font-size: 1.2rem; }
.prose p { color: var(--muted); font-size: 0.92rem; margin-bottom: 14px; }
.prose ul { color: var(--muted); font-size: 0.92rem; padding-left: 20px; }
.prose li { margin-bottom: 8px; }

.page-hero {
  text-align: center;
  padding: 60px 0 20px;
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 10px; }
.page-hero p { color: var(--muted); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.modal-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  max-height: min(90vh, 640px);
  overflow-y: auto;
}
.modal-panel h3 { margin-bottom: 8px; }
.modal-copy {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 14px;
  line-height: 1.5;
}
.modal-copy strong { color: var(--text); font-weight: 600; }
.modal-steps {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.modal-steps-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.modal-steps ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}
.modal-steps li { margin-bottom: 6px; }
.modal-steps li:last-child { margin-bottom: 0; }
.modal-steps code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--gold);
}
.modal-note {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--error);
  line-height: 1.4;
}
.modal-file {
  width: 100%;
  margin-bottom: 14px;
  color: var(--text);
  font-size: 0.9rem;
}
.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.modal-actions .btn { flex: 1 1 140px; min-height: 44px; }
.modal-status {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 10px;
  min-height: 1.2em;
}
