/* ============================================================
   TERRA GUILD — stylesheet (stream-aesthetic edition)
   Palette sampled from Terra's overlay: deep forest-teal base
   with soft butter-yellow accents. Red reserved for LIVE pulse.
   Drop-in replacement — same class names as before.
   ============================================================ */

:root {
  --bg: #01140f;          /* deepest teal-black */
  --surface: #032418;     /* overlay panel teal */
  --surface-2: #042d20;   /* raised card interiors */
  --line: #093a2c;        /* borders / brackets */
  --text: #eef4ec;        /* warm off-white */
  --text-dim: #8fb4a3;    /* muted sage */
  --accent: #d6ca85;      /* soft butter yellow — structure & links */
  --accent-strong: #e6db95; /* hover state */
  --red: #ff5a5a;         /* live pulse only */
  --radius: 6px;
  --display: "Chakra Petch", sans-serif;
  --body: "Space Grotesk", sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(9, 58, 44, 0.25), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  min-height: 100vh;
}

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

a { color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
}

/* ---------- HUD strip ---------- */
.hud-strip {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  background: linear-gradient(90deg, var(--surface), var(--bg));
  border-bottom: 1px solid var(--line);
}
.hud-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.hud-strip[data-state="live"] { color: var(--accent); }
.hud-strip[data-state="live"] .hud-dot {
  background: var(--red);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(255, 90, 90, 0); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hud-strip[data-state="live"] .hud-dot,
  .live-pulse { animation: none !important; }
}

/* ---------- Header ---------- */
.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
}
.site-header .wordmark { justify-self: start; }
.site-header .social-bar { justify-self: center; }
.site-header .site-nav { justify-self: end; justify-content: flex-end; }
@media (max-width: 700px) {
  .site-header { grid-template-columns: 1fr; justify-items: center; row-gap: 0.8rem; }
  .site-header .wordmark { justify-self: center; }
  .site-header .site-nav { justify-self: center; justify-content: center; }
}
.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--text);
  text-decoration: none;
}
.wordmark span { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.site-nav .nav-kofi {
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.35rem 0.8rem;
}
.site-nav .nav-kofi:hover { background: rgba(227, 215, 141, 0.12); }

/* ---------- Social bar (in header) ---------- */
.social-bar {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.social-bar a {
  color: var(--text-dim);
  display: inline-flex;
  transition: color 0.15s ease, transform 0.15s ease;
}
.social-bar a:hover { color: var(--accent); transform: translateY(-2px); }
.social-bar svg { width: 22px; height: 22px; }
@media (max-width: 700px) {
  .social-bar { width: 100%; justify-content: center; }
}

/* ---------- Corner-bracket frames (the overlay motif) ---------- */
.frame { position: relative; }
.frame::before, .frame::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid var(--accent);
  pointer-events: none;
}
.frame::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.frame::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem) 2.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.hero-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.9rem, 5vw, 3.4rem);
  line-height: 1.12;
  margin-bottom: 0.9rem;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub { color: var(--text-dim); max-width: 56ch; margin-bottom: 1.6rem; }

.frame-hero, .frame-wide, .frame-inner {
  background: var(--surface);
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.frame-hero iframe, .frame-wide iframe, .frame-inner iframe,
#twitch-player-host, #twitch-player-host iframe {
  width: 100%; height: 100%; border: 0;
}

.live-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.3rem 0.7rem;
  margin-bottom: 1rem;
}
.live-pulse {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red);
  animation: pulse 1.4s ease-in-out infinite;
}

/* ---------- Secondary cards ---------- */
.secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h2 {
  font-family: var(--display);
  font-size: 1.4rem;
  margin: 0.3rem 0 0.5rem;
}
.card p { color: var(--text-dim); margin-bottom: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; }

.status-pill {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.status-pill.status-live { color: var(--red); border-color: var(--red); }
.status-pill.status-ongoing { color: var(--accent); border-color: var(--accent); }
.status-pill.status-complete { color: #7fd4b5; border-color: #2a7a5f; }
.status-pill.status-retired { opacity: 0.7; }

.twitch-compact {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
  overflow: hidden;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0.65rem 1.2rem;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: #0a4433; color: var(--text); font-weight: 500; }
.btn-primary:hover { background: #0f533f; }
.btn-gold { background: var(--accent); color: #1d1a06; font-weight: 500; }
.btn-gold:hover { background: var(--accent-strong); }
.btn-ghost { color: var(--accent); border: 1px solid var(--accent); }
.btn-ghost:hover { background: rgba(227, 215, 141, 0.12); }

/* ---------- VODs ---------- */
.vods {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 4vw, 3rem);
}
.vods h2 {
  font-family: var(--display);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  margin-bottom: 1.25rem;
}
.vod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.vod-tile { aspect-ratio: 16 / 9; }
.vod-caption {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-top: 0.6rem;
  text-transform: uppercase;
}
.vod-more { display: inline-block; }
@media (max-width: 640px) {
  .vod-grid { grid-template-columns: 1fr; }
}

/* ---------- Community band ---------- */
.community { padding: 1rem clamp(1rem, 4vw, 3rem) 3rem; max-width: 1100px; margin: 0 auto; }
.community-inner {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  align-items: center; justify-content: space-between;
  background: linear-gradient(120deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}
.community h2 { font-family: var(--display); font-size: 1.6rem; margin: 0.3rem 0 0.4rem; }
.community p { color: var(--text-dim); max-width: 44ch; }
.community-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

/* ---------- Challenges page ---------- */
.hero-archive { padding-bottom: 1rem; }
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.75rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 3.5rem;
}
.challenge-card .frame-inner { margin-top: 0.5rem; }

/* ---------- Commands page ---------- */
.commands-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem) 3.5rem;
}
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}
.tab-btn {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
}
.tab-btn:hover { color: var(--text); }
.tab-btn[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.command-list { display: flex; flex-direction: column; gap: 0.75rem; }
.command-cat {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4rem;
  margin: 1.4rem 0 0.2rem;
}
.command-list .command-cat:first-child { margin-top: 0; }
.command-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 1rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.command-name {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent);
  word-break: break-all;
}
.command-info p { color: var(--text); margin: 0; }
.command-aliases {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim) !important;
  margin-top: 0.3rem !important;
}
@media (max-width: 520px) {
  .command-row { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* ---------- Support page ---------- */
.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 3.5rem;
  align-items: start;
}
.support-col {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-width: 0;
}
.support-card {
  margin-bottom: 0;
}
.support-card .btn { margin-top: 0.5rem; }
.support-note {
  font-size: 0.9rem;
  font-style: italic;
}
.tier {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.9rem;
}
.tier-name {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.benefits {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-dim);
}
.benefits li { margin-bottom: 0.25rem; }
.kofi-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.kofi-wrap iframe {
  border: none;
  width: 100%;
  padding: 4px;
  background: #96beb3;
}
@media (max-width: 760px) {
  .support-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: center; justify-content: space-between;
  padding: 1.5rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}
.footer-mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}
.site-footer nav { display: flex; gap: 1.25rem; }
.site-footer a {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: none;
}
.site-footer a:hover { color: var(--text); }

@media (max-width: 520px) {
  .secondary, .challenge-grid { grid-template-columns: 1fr; }
  .community-inner { flex-direction: column; align-items: flex-start; }
}
