@import url("fonts.css");

/* —— Default tokens (dispatch home) —— */

:root {
  --bg: #0f0d0c;
  --bg-elevated: #181412;
  --bg-card: #221c18;
  --bg-sidebar: #14110f;
  --text: #f8f2e8;
  --text-muted: #a89f92;
  --accent: #d4a24a;
  --accent-soft: #b8862f;
  --accent-hover: #e8bc62;
  --accent-glow: rgba(212, 162, 74, 0.24);
  --accent-focus: rgba(212, 162, 74, 0.3);
  --accent-secondary: #c45d5a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.24);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", system-ui, sans-serif;
  --sidebar-width: 17.5rem;
  --content-max: 48rem;
  --radius-sm: 0.375rem;
  --radius: 0.625rem;
  --radius-lg: 1rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 0.35s;
  --page-pattern: none;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--page-pattern);
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--duration) var(--ease-out);
}

a:hover {
  color: var(--accent-hover);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  margin: 0 0 1rem;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin: 0 0 0.75rem;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

/* —— App shell —— */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.roster-pane {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.roster-pane__head {
  padding: 1.35rem 1.15rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.roster-pane__label {
  margin: 0.65rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  line-height: 1.25;
  display: block;
  transition: color var(--duration) var(--ease-out);
}

.logo:hover {
  color: var(--accent-hover);
}

.roster-nav {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.5rem 1.25rem;
  gap: 0.2rem;
  flex: 1;
}

.roster-link {
  display: block;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition:
    background var(--duration) var(--ease-out),
    border-color var(--duration) var(--ease-out),
    transform 0.2s var(--ease-out);
}

.roster-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  transform: translateX(2px);
}

.roster-link.is-active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.roster-link__name {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.3;
}

.roster-link__tag {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.roster-toggle {
  display: none;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-main main {
  flex: 1;
  min-height: 50vh;
}

.page-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.page-hero {
  margin-bottom: 2.5rem;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-secondary);
  margin: 0 0 0.75rem;
}

.hero-lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 40ch;
  line-height: 1.65;
}

.hero-copy {
  max-width: 48ch;
  color: var(--text-muted);
  margin-top: 1rem;
}

.member-bio {
  max-width: 48ch;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.section-heading {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  margin: 0 0 1rem;
}

.content-section + .content-section {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.blurb-feed {
  display: grid;
  gap: 1rem;
}

.blurb-card {
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.blurb-card__meta {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.blurb-card__meta a {
  font-weight: 600;
}

.blurb-card__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.blurb-card p:last-child {
  margin-bottom: 0;
  color: var(--text-muted);
}

.story-list {
  display: grid;
  gap: 1rem;
}

.story-card {
  padding: 1.4rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}

.story-card h3 {
  margin-top: 0;
}

.story-card p:last-child {
  margin-bottom: 0;
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  margin-top: auto;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* —— Per-page themes —— */

[data-theme="dispatch"] {
  color-scheme: dark;
  --bg: #12100e;
  --bg-sidebar: #0c0a09;
  --bg-card: #1e1916;
  --text: #f5efe6;
  --text-muted: #9a9086;
  --accent: #d4a24a;
  --accent-hover: #ecc56a;
  --accent-secondary: #c45d5a;
  --page-pattern: radial-gradient(ellipse 120% 80% at 100% 0%, rgba(212, 162, 74, 0.08), transparent 50%);
}

[data-theme="sophia"] {
  color-scheme: light;
  --bg: #f7f3ed;
  --bg-sidebar: #ebe4d8;
  --bg-card: #fffdf9;
  --text: #3d3428;
  --text-muted: #7a6f62;
  --accent: #9a7b4f;
  --accent-hover: #7d6340;
  --accent-secondary: #b8956a;
  --border: rgba(61, 52, 40, 0.12);
  --border-strong: rgba(61, 52, 40, 0.2);
  --font-display: "Fraunces", Georgia, serif;
  --page-pattern: linear-gradient(165deg, #f7f3ed 0%, #efe8dc 100%);
}

[data-theme="scott"] {
  color-scheme: dark;
  --bg: #1a1410;
  --bg-sidebar: #120e0b;
  --bg-card: #261e18;
  --text: #ffe8d6;
  --text-muted: #c4a088;
  --accent: #e85d2a;
  --accent-hover: #ff7a45;
  --accent-secondary: #8b4513;
  --page-pattern: radial-gradient(circle at 20% 100%, rgba(232, 93, 42, 0.15), transparent 45%);
}

[data-theme="nicki"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-sidebar: #e8eef6;
  --bg-card: #ffffff;
  --text: #1a2d42;
  --text-muted: #5a7088;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-secondary: #0ea5e9;
  --border: rgba(26, 45, 66, 0.1);
  --font-body: system-ui, "Segoe UI", sans-serif;
  --font-display: system-ui, "Segoe UI", sans-serif;
  --page-pattern: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(37, 99, 235, 0.03) 8px,
    rgba(37, 99, 235, 0.03) 9px
  );
}

[data-theme="alex"] {
  color-scheme: dark;
  --bg: #0d0f14;
  --bg-sidebar: #080a0e;
  --bg-card: #161a24;
  --text: #e8ffe8;
  --text-muted: #8ab88a;
  --accent: #39ff14;
  --accent-hover: #5fff3d;
  --accent-secondary: #ff00aa;
  --page-pattern: linear-gradient(135deg, rgba(57, 255, 20, 0.06) 0%, rgba(255, 0, 170, 0.06) 100%);
}

[data-theme="devin"] {
  color-scheme: dark;
  --bg: #14121f;
  --bg-sidebar: #0e0c16;
  --bg-card: #1e1a2e;
  --text: #e8e4ff;
  --text-muted: #9a94b8;
  --accent: #7c6cf0;
  --accent-hover: #9d8fff;
  --accent-secondary: #5ec4c4;
  --page-pattern: radial-gradient(ellipse at 50% 0%, rgba(124, 108, 240, 0.12), transparent 60%);
}

[data-theme="finnan"] {
  color-scheme: dark;
  --bg: #1c1814;
  --bg-sidebar: #14110e;
  --bg-card: #2a231c;
  --text: #e8dcc8;
  --text-muted: #a89880;
  --accent: #c9a227;
  --accent-hover: #e0b83a;
  --accent-secondary: #8b6914;
  --font-display: Georgia, "Times New Roman", serif;
  --page-pattern: linear-gradient(180deg, #1c1814, #252018);
}

[data-theme="jerimiah"] {
  color-scheme: light;
  --bg: #f0ebe3;
  --bg-sidebar: #e2d9cc;
  --bg-card: #faf7f2;
  --text: #2c2419;
  --text-muted: #6b5d4a;
  --accent: #6b2d3c;
  --accent-hover: #8a3a4d;
  --accent-secondary: #3d5a40;
  --border: rgba(44, 36, 25, 0.12);
  --font-display: Georgia, "Times New Roman", serif;
}

[data-theme="leanna"] {
  color-scheme: light;
  --bg: #fff8f0;
  --bg-sidebar: #ffe8d6;
  --bg-card: #ffffff;
  --text: #2d1f3d;
  --text-muted: #6b5080;
  --accent: #e91e8c;
  --accent-hover: #ff4da6;
  --accent-secondary: #ff9f1c;
  --border: rgba(45, 31, 61, 0.1);
  --page-pattern: linear-gradient(
    120deg,
    rgba(233, 30, 140, 0.06) 0%,
    rgba(255, 159, 28, 0.06) 50%,
    rgba(46, 196, 182, 0.06) 100%
  );
}

[data-theme="logan"] {
  color-scheme: dark;
  --bg: #1a1f16;
  --bg-sidebar: #12160f;
  --bg-card: #242b1e;
  --text: #d8e0c8;
  --text-muted: #8a9478;
  --accent: #6b8e23;
  --accent-hover: #8fad3a;
  --accent-secondary: #c4a35a;
  --font-body: system-ui, sans-serif;
  --font-display: system-ui, sans-serif;
  --page-pattern: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(107, 142, 35, 0.04) 3px,
    rgba(107, 142, 35, 0.04) 4px
  );
}

[data-theme="kailey"] {
  color-scheme: dark;
  --bg: #0f0a18;
  --bg-sidebar: #0a0610;
  --bg-card: #1a1028;
  --text: #f0e8ff;
  --text-muted: #b090d0;
  --accent: #ff2d95;
  --accent-hover: #ff5cad;
  --accent-secondary: #00e5ff;
  --page-pattern: linear-gradient(180deg, rgba(255, 45, 149, 0.08) 0%, rgba(0, 229, 255, 0.06) 100%);
}

[data-theme="josh"] {
  color-scheme: dark;
  --bg: #0a0e0a;
  --bg-sidebar: #050805;
  --bg-card: #0f160f;
  --text: #33ff66;
  --text-muted: #1a9933;
  --accent: #33ff66;
  --accent-hover: #66ff88;
  --accent-secondary: #00cc44;
  --font-body: "Consolas", "Courier New", monospace;
  --font-display: "Consolas", "Courier New", monospace;
  --page-pattern: none;
}

[data-theme="josh"] .blurb-card,
[data-theme="josh"] .story-card {
  border-radius: 0;
  border-style: dashed;
}

[data-theme="kaitlyn"] {
  color-scheme: light;
  --bg: #fdf6f8;
  --bg-sidebar: #f5e8ec;
  --bg-card: #ffffff;
  --text: #4a3040;
  --text-muted: #8a6a78;
  --accent: #d4567a;
  --accent-hover: #b84565;
  --accent-secondary: #6ec4a8;
  --border: rgba(74, 48, 64, 0.1);
  --page-pattern: radial-gradient(circle at 80% 20%, rgba(110, 196, 168, 0.12), transparent 40%);
}

[data-theme="charlotte"] {
  color-scheme: light;
  --bg: #fff0f8;
  --bg-sidebar: #ffe0f0;
  --bg-card: #fffafc;
  --text: #4a2040;
  --text-muted: #9a6088;
  --accent: #c2188f;
  --accent-hover: #9b1270;
  --accent-secondary: #ffd700;
  --border: rgba(194, 24, 143, 0.15);
  --font-display: "Fraunces", Georgia, serif;
  --page-pattern: radial-gradient(circle at 10% 90%, rgba(255, 215, 0, 0.15), transparent 35%);
}

[data-theme="william"] {
  color-scheme: light;
  --bg: #fffef5;
  --bg-sidebar: #fff8c8;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #4a4a6a;
  --accent: #e63946;
  --accent-hover: #c1121f;
  --accent-secondary: #1d3557;
  --border: 3px solid #1a1a2e;
  --radius-lg: 0;
  --font-display: Impact, "Arial Black", sans-serif;
  --font-body: system-ui, sans-serif;
  --page-pattern: radial-gradient(circle, rgba(26, 26, 46, 0.06) 1px, transparent 1px);
  background-size: 12px 12px, auto;
}

[data-theme="william"] .blurb-card,
[data-theme="william"] .story-card {
  border-width: 3px;
  border-radius: 0;
  box-shadow: 4px 4px 0 #1a1a2e;
}

/* —— Motion —— */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-hero h1 {
  animation: fade-up 0.6s var(--ease-out) both;
}

.page-hero .hero-lead {
  animation: fade-up 0.6s var(--ease-out) 0.06s both;
}

/* —— Responsive —— */

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .roster-pane {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    width: min(var(--sidebar-width), 88vw);
    transform: translateX(-100%);
    transition: transform var(--duration) var(--ease-out);
    box-shadow: var(--shadow);
  }

  .roster-pane.is-open {
    transform: translateX(0);
  }

  .roster-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 150;
    width: 3rem;
    height: 3rem;
    padding: 0;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--bg);
    box-shadow: var(--shadow-sm);
  }

  .roster-toggle__bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 1rem;
  }

  .roster-toggle__bar {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    border-radius: 1px;
    transition: transform var(--duration) var(--ease-out), opacity var(--duration) var(--ease-out);
  }

  .roster-toggle[aria-expanded="true"] .roster-toggle__bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .roster-toggle[aria-expanded="true"] .roster-toggle__bar:nth-child(2) {
    opacity: 0;
  }

  .roster-toggle[aria-expanded="true"] .roster-toggle__bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .page-content {
    padding: 1.75rem 1.25rem 5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .roster-link:hover {
    transform: none;
  }
}
