/* main.css - mara's lab, round 2: gold quiet line */
/* live's header, screenshot gold, v3.1 bones. */
/* THEME: everything below reads from :root. a few toggles re-theme the
   entire site — no hardcoded colors outside this block. */

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

:root {
  --gold: #e8c874;
  --gold-bright: #ffe9a8;
  --gold-dim: #6b5a2e;
  --void: #000000;
  --ink: #0a0906;
  --white: #f5f2ff;
  --dim: #6a6a7a;
  --green: #4ade80;
  --red: #ff5c5c;
  /* material 3 tonal roles, mapped onto the gold */
  --primary: var(--gold);
  --on-primary: var(--void);
  --primary-container: var(--gold-dim);
  --on-primary-container: var(--gold-bright);
  --surface: var(--void);
  --surface-container: var(--ink);
  --on-surface: var(--white);
  --on-surface-variant: var(--dim);
  --outline: var(--gold-dim);
  --display: "Unbounded", sans-serif;
  --wordmark: "Cormorant Garamond", Georgia, serif;
  --mono: "JetBrains Mono", "Courier New", monospace;
}

html { scroll-behavior: smooth; }

html, body {
  overflow-x: clip;
}
body {
  background: var(--void);
  color: var(--white);
  font-family: var(--mono);
  min-height: 100vh;
  line-height: 1.6;
}

/* focus is always visible — keyboard users get a real ring */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ambient particle backdrop — drawn by bg.js, never the main character */
#bg {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: 0.55;
}

.wrap {
  position: relative; z-index: 1;
  max-width: 760px; margin: 0 auto;
  padding: 0 20px;
}

/* ============ STICKY GLASS NAV ============ */
.topnav {
  position: sticky; top: 0; z-index: 100;
  display: flex; flex-direction: column;
  transition: transform 0.3s ease;
}
/* scroll-aware: transparent at top, glass once scrolled, hides on scroll down */
.topnav-row {
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.topnav.scrolled .topnav-row {
  background: color-mix(in srgb, var(--void) 62%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  box-shadow: 0 1px 24px color-mix(in srgb, var(--gold) 12%, transparent);
}
.topnav.hidden { transform: translateY(-100%); }
/* the honeypot IS the menu */
.honey-drop { position: relative; }
.honey-drop .drop-menu { left: 0; right: auto; }
.dropdown.open .drop-menu { animation: honey-drip 0.32s ease; }
@keyframes honey-drip {
  0% { opacity: 0; transform: translateY(-10px) scaleY(0.85); }
  60% { opacity: 1; transform: translateY(3px) scaleY(1.02); }
  100% { opacity: 1; transform: translateY(0) scaleY(1); }
}
/* mobile: backdrop-filter over a fixed canvas is an iOS jank recipe —
   flat fill instead. the glass stays on desktop where she sees it. */
@media (max-width: 640px) {
  .topnav.scrolled .topnav-row {
    background: color-mix(in srgb, var(--void) 95%, transparent);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
.topnav-right {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto;
}
/* honeypot mark — the whole brand now. gentle bob, soft glow. */
.tmark {
  background: none; border: none; cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  padding: 6px 8px;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--gold) 55%, transparent));
  animation: honey-bob 4s ease-in-out infinite;
  transition: transform 0.2s ease;
}
.tmark:hover { transform: scale(1.15) rotate(-8deg); }
.tmark:active { transform: scale(0.92); }
@keyframes honey-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
/* dropdown */
.dropdown { position: relative; }
.drop-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 280px;
  background: color-mix(in srgb, var(--ink) 97%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  border-radius: 14px;
  padding: 8px;
  display: none;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6),
              0 0 24px color-mix(in srgb, var(--gold) 15%, transparent);
}
.dropdown.open .drop-menu { display: block; }
.drop-card {
  display: block; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  font-family: var(--mono); color: var(--white);
  padding: 12px; border-radius: 10px; text-decoration: none;
  transition: background 0.15s ease;
}
.drop-card:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.drop-card b { display: block; color: var(--gold); font-size: 0.9rem; }
.drop-card span { display: block; color: var(--dim); font-size: 0.78rem; margin-top: 2px; }

/* ============ HERO — the terminal is the hero ============ */
.hero {
  position: relative;
  min-height: calc(100svh - 56px);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 26px;
  padding: 48px 0 64px;
  text-align: center;
}
/* hero aura — big breathing gold bloom behind everything. khaslana. */
.hero::before {
  content: "";
  position: absolute; inset: -20% -10%;
  background: radial-gradient(ellipse 60% 55% at 50% 42%,
    color-mix(in srgb, var(--gold) 16%, transparent),
    color-mix(in srgb, var(--gold-dim) 7%, transparent) 55%,
    transparent 75%);
  pointer-events: none;
  animation: aura-breathe 8s ease-in-out infinite;
}
@keyframes aura-breathe {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
.hero > * { position: relative; }

.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 28px;
  font-family: var(--mono); font-size: 0.95rem; font-weight: 700;
  color: var(--on-primary); background: var(--primary);
  border: 1px solid var(--primary); border-radius: 12px;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 0 24px color-mix(in srgb, var(--gold) 45%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
/* sheen sweep on hover */
.btn::after {
  content: "";
  position: absolute; top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent,
    color-mix(in srgb, var(--gold-bright) 45%, transparent), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
  pointer-events: none;
}
.btn:hover::after { left: 130%; }
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px color-mix(in srgb, var(--gold) 65%, transparent);
}
.btn.ghost {
  background: transparent; color: var(--gold);
  border-color: color-mix(in srgb, var(--gold) 50%, transparent);
  box-shadow: none;
}
.btn.ghost:hover {
  box-shadow: 0 0 24px color-mix(in srgb, var(--gold) 30%, transparent);
  border-color: var(--gold);
}
.btn:active { transform: scale(0.97); }

/* ============ SECTIONS ============ */
.act { padding: 56px 0; }

/* eyebrow — quiet brand, the text doesn't shout anymore */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  color: color-mix(in srgb, var(--gold) 65%, transparent);
  text-shadow: 0 0 18px color-mix(in srgb, var(--gold) 40%, transparent);
  transition: opacity 0.6s ease;
  min-height: 1.2em;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.eyebrow.fading { opacity: 0; }
/* hero terminal — bigger, deeper, the main event */
.hero-term {
  width: 100%;
  max-width: 720px;
}
.hero-term .term-body {
  min-height: 300px;
}
.term-caret {
  color: var(--gold);
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink {
  50% { opacity: 0; }
}
/* ============ TERMINAL — the one real interaction ============ */
.terminal {
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--void) 82%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--gold) 12%, transparent),
              0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  cursor: text;
}
.term-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 20%, transparent);
  font-size: 0.78rem; color: var(--dim);
}
.dots { display: flex; gap: 8px; }
.dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold-dim); border: none; padding: 0; cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.dot::after { content: ""; position: absolute; inset: -9px; } /* fat tap target, same look */
.dot:hover { transform: scale(1.25); filter: brightness(1.4); }
.dot-close { background: color-mix(in srgb, var(--red) 75%, transparent); }
.dot-min { background: var(--gold-dim); }
.dot-max { background: var(--gold); }
/* tab strip */
.term-tabs { display: flex; gap: 6px; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
.term-tabs::-webkit-scrollbar { display: none; }
.term-tab {
  display: flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  border-radius: 8px; color: var(--dim);
  font-family: var(--mono); font-size: 0.72rem;
  padding: 3px 10px; cursor: pointer; white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.term-tab:hover { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.term-tab.active { color: var(--gold); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.term-tab-x { font-style: normal; opacity: 0.6; }
.term-tab-x:hover { opacity: 1; color: var(--red); }
.term-add {
  background: transparent; border: none; color: var(--dim);
  font-size: 0.95rem; line-height: 1; cursor: pointer; padding: 0;
  margin-left: 4px; /* sits with the dots, flexbox does the rest */
  transition: color 0.15s ease, transform 0.15s ease;
}
.term-add:hover { color: var(--gold); transform: scale(1.25); }
.term-title { margin-left: auto; color: var(--dim); font-size: 0.78rem; }
/* theater mode — breaks out of .wrap, bigger and centered. slow springy bounce. */
.terminal { transition: max-width 0.55s cubic-bezier(0.34, 1.35, 0.64, 1), opacity 0.5s ease, transform 0.5s ease, width 0.55s cubic-bezier(0.34, 1.35, 0.64, 1); }
.term-body { transition: max-height 0.55s cubic-bezier(0.34, 1.35, 0.64, 1); }
.terminal.theater.theater {
  position: fixed; z-index: 150;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(1060px, 94vw);
  max-width: none;
  margin: 0;
}
.terminal.theater .term-body { max-height: 68vh; }
.terminal.minimized .term-body { display: none; }
/* ============ HEADER CONTROLS — compact cluster, right side ============ */
.topnav-row { display: flex; align-items: center; }
.topnav-controls {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
.topnav-controls button {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  color: var(--gold);
  font-family: var(--mono); font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.3s ease, transform 0.3s ease;
  position: relative;
}
.topnav-controls button:hover {
  border-color: var(--gold);
  box-shadow: 0 0 16px color-mix(in srgb, var(--gold) 35%, transparent);
}
#term-reopen[hidden] { display: none; }
/* scroll fab in header: hidden at top, no longer floating */
#scroll-fab { transition: opacity 0.3s ease, transform 0.3s ease; }
#scroll-fab svg { transition: transform 0.3s ease; display: block; }
/* ambient in header — icon only, slider drops below */
#ambient-btn .ab-icon { font-size: 1.05rem; line-height: 1; }
#ambient-btn .vol-slider {
  position: absolute; top: 100%; right: 0;
  width: 110px; display: none;
  accent-color: var(--gold); cursor: pointer;
  background: color-mix(in srgb, var(--ink) 95%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  border-radius: 8px; padding: 10px 8px 8px;
}
/* fine pointers: slider only on hover. touch uses the XY pad drag instead. */
@media (hover: hover) {
  #ambient-btn:hover .vol-slider { display: block; }
}
#ambient-btn.playing { border-color: var(--gold); box-shadow: 0 0 16px color-mix(in srgb, var(--gold) 50%, transparent); }
#ambient-btn.playing .ab-icon { text-shadow: 0 0 8px var(--gold); }
/* wip / private badges — deadpan */
.badge {
  font-style: normal;
  font-family: var(--mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--void); background: var(--gold-dim);
  border-radius: 20px; padding: 2px 9px; margin-left: 8px;
  vertical-align: 2px; white-space: nowrap;
}
.card, .drop-card { position: relative; }
.card .badge, .drop-card .badge {
  position: absolute; top: 10px; right: 12px; margin-left: 0;
}
.term-body {
  padding: 18px;
  min-height: 280px; max-height: 420px;
  overflow-y: auto;
  font-size: 0.92rem; line-height: 1.7;
}
.term-line { word-break: break-word; }
/* clickable command chips in help output */
.t-cmd {
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  border-radius: 20px;
  color: var(--gold);
  font-family: var(--mono); font-size: 0.85em;
  padding: 2px 10px; margin: 1px 2px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.t-cmd:hover {
  background: color-mix(in srgb, var(--gold) 25%, transparent);
  transform: translateY(-1px);
}
.t-cmd:active { transform: scale(0.96); }
.term-input-line { display: flex; align-items: center; margin-top: 10px; }
.term-prompt { color: var(--gold); margin-right: 10px; font-weight: 700; }
#term-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--white); font-family: var(--mono);
  font-size: 16px; /* ≥16px: no iOS focus zoom */
  caret-color: var(--gold);
}
#term-input:focus-visible { outline: none; }
.t-pink { color: var(--gold-bright); }
.t-green { color: var(--green); }
.t-dim { color: var(--dim); }
.t-gold { color: var(--gold); }
.t-red { color: var(--red); }

/* ============ PROJECT CARDS ============ */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.card {
  position: relative;
  overflow: hidden;
  display: block; text-align: left;
  background: color-mix(in srgb, var(--surface-container) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
  border-radius: 16px;
  padding: 22px 20px;
  font-family: var(--mono); color: var(--on-surface);
  text-decoration: none; cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  min-height: 44px;
}
/* card spotlight — light follows the cursor inside each card */
.card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--gold) 14%, transparent),
    transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
/* sheen sweep on hover */
.card::after {
  content: "";
  position: absolute; top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent,
    color-mix(in srgb, var(--gold) 22%, transparent), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s ease;
  pointer-events: none;
}
.card:hover::after { left: 130%; }
/* micro-glitch on hover: the title jitters with rgb split */
.card:hover b {
  animation: card-glitch 0.32s steps(2) 1;
}
@keyframes card-glitch {
  0% { transform: translate(0, 0); text-shadow: none; }
  25% { transform: translate(-2px, 1px); text-shadow: -1px 0 rgba(255, 92, 92, 0.7), 1px 0 rgba(92, 225, 255, 0.7); }
  50% { transform: translate(2px, -1px); text-shadow: 1px 0 rgba(255, 92, 92, 0.7), -1px 0 rgba(92, 225, 255, 0.7); }
  100% { transform: translate(0, 0); text-shadow: none; }
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--gold) 18%, transparent);
}
.card b { display: block; color: var(--gold); font-size: 1rem; margin-bottom: 4px; }
.card span { color: var(--dim); font-size: 0.82rem; }

/* ============ FOOTER ============ */
footer {
  padding: 56px 0 64px;
  text-align: center;
  color: var(--dim); font-size: 0.82rem;
  display: flex; flex-direction: column; gap: 8px;
}
footer .vitals { color: var(--dim); }
footer .spite { color: var(--gold); }

/* (floating fabs retired — controls live in the header now) */
/* ============ REVEALS — subtle, once ============ */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* cursor glow — a soft gold flashlight following the pointer */
#cursor-glow {
  position: fixed; top: 0; left: 0; z-index: 60;
  width: 340px; height: 340px;
  margin: -170px 0 0 -170px;
  border-radius: 50%;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--gold) 13%, transparent),
    color-mix(in srgb, var(--gold) 5%, transparent) 45%,
    transparent 70%);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}
#cursor-glow.on { opacity: 1; }
/* fx canvas — tap bursts live ABOVE the content so they're always visible */
#fx {
  position: fixed; inset: 0; z-index: 70;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ============ REDUCED MOTION — everything static ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .reveal.in { transition: none; }
  .btn, .card, #ambient-btn { transition: none; }
  .btn::after, .card::after { display: none; }
  .hero::before { animation: none; }
  .tmark { animation: none; }
  .dropdown.open .drop-menu { animation: none; }
  .card:hover b { animation: none; }
  .term-caret { animation: none; }
  #ambient-btn .eq i { animation: none; }
}
/* after dark (12am-5am) — the site gets deeper, more honest */
body.after-dark #bg { opacity: 0.75; }
body.after-dark { --gold: #f0d080; }
body.after-dark .eyebrow { letter-spacing: 0.12em; }

/* no sound on mobile, so no sound button */
@media (pointer: coarse) {
  #ambient-btn { display: none !important; }
}

/* radio station dots on the sound button */
.st-dots { display: inline-flex; gap: 3px; margin-left: 6px; align-items: center; }
.st-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); display: inline-block;
  transition: opacity 0.2s ease;
}
