/* ============================================
   Late Night Lab — shared styles
   Palette: after-hours study desk, ink navy + lamp glow
   ============================================ */

:root {
  --bg: #12162c;
  --bg-elevated: #1a2040;
  --bg-card: #1f2650;
  --bg-card-hover: #262e5e;
  --border: rgba(237, 239, 255, 0.09);
  --border-strong: rgba(237, 239, 255, 0.18);
  --text: #edeffb;
  --text-muted: #9a9fc9;
  --text-faint: #6b709a;
  --amber: #f3c675;
  --amber-soft: rgba(243, 198, 117, 0.14);
  --mint: #86d9c4;
  --mint-soft: rgba(134, 217, 196, 0.14);
  --radius: 14px;
  --radius-sm: 8px;
  --max-w: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

/* --- starfield backdrop --- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(237,239,255,0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 75% 15%, rgba(237,239,255,0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 70%, rgba(237,239,255,0.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 60%, rgba(237,239,255,0.3) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 35% 85%, rgba(237,239,255,0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 10% 65%, rgba(237,239,255,0.35) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 50% 45%, rgba(237,239,255,0.25) 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 90%, rgba(237,239,255,0.3) 50%, transparent 51%);
  background-repeat: repeat;
  background-size: 600px 600px;
  opacity: 0.6;
}

h1, h2, h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* --- header / nav --- */
header.site-header {
  position: relative;
  z-index: 2;
  border-bottom: 1px solid var(--border);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 18px;
}

.brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px 2px var(--amber-soft);
}

nav.main-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--text-muted);
}

nav.main-nav a {
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease;
}

nav.main-nav a:hover,
nav.main-nav a.active {
  color: var(--text);
}

nav.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--amber);
  border-radius: 2px;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
}

/* --- hero --- */
.hero {
  position: relative;
  padding: 88px 24px 64px;
  text-align: left;
  overflow: hidden;
}

.hero .glow {
  position: absolute;
  top: -120px;
  right: -80px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--amber-soft) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.08;
  max-width: 720px;
}

.hero .accent {
  color: var(--amber);
}

.hero p.sub {
  margin-top: 18px;
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
}

.hero .cta-row {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* --- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--amber);
  color: #1a1608;
  border-color: var(--amber);
}

.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--mint);
  color: var(--mint);
}

/* --- section --- */
.section {
  position: relative;
  z-index: 1;
  padding: 56px 24px;
}

.section-head {
  margin-bottom: 32px;
  max-width: 620px;
}

.section-head .label { margin-bottom: 10px; }

.section-head h2 {
  font-size: clamp(26px, 4vw, 34px);
}

.section-head p {
  color: var(--text-muted);
  margin-top: 10px;
}

/* --- card grid (used on home + games) --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.card h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin: 0 0 14px;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--mint-soft);
  color: var(--mint);
}

.tag.amber { background: var(--amber-soft); color: var(--amber); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--text-faint);
}

.status-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
}

.status-pill.live .dot { background: var(--mint); box-shadow: 0 0 6px 1px var(--mint-soft); }
.status-pill.wip .dot { background: var(--amber); box-shadow: 0 0 6px 1px var(--amber-soft); }

/* --- about / people --- */
.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.person-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.person-card .initial {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 14px;
}

.person-card.minho .initial { background: var(--amber-soft); color: var(--amber); }
.person-card.helen .initial { background: var(--mint-soft); color: var(--mint); }

.person-card h3 { font-size: 18px; margin-bottom: 4px; }
.person-card .role { font-size: 13px; color: var(--text-faint); margin-bottom: 12px; }
.person-card p.bio { color: var(--text-muted); font-size: 14.5px; margin: 0; }

/* --- constellation divider (signature element) --- */
.constellation {
  position: relative;
  height: 1px;
  margin: 8px auto 0;
  max-width: var(--max-w);
}

.constellation svg { width: 100%; height: 40px; display: block; overflow: visible; }

/* --- exam list (scioly page) --- */
.exam-group {
  margin-bottom: 40px;
}

.exam-group h3 {
  font-size: 15px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.exam-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.exam-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, padding-left 0.15s ease;
}

.exam-list li a:hover {
  background: var(--bg-card);
  padding-left: 20px;
}

.exam-list .exam-name {
  font-size: 15px;
  color: var(--text);
}

.exam-list .exam-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

.exam-list .arrow {
  color: var(--text-faint);
  transition: transform 0.15s ease, color 0.15s ease;
}

.exam-list li a:hover .arrow {
  transform: translateX(3px);
  color: var(--mint);
}

.note-box {
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 36px;
}

.note-box strong { color: var(--text); }

/* --- footer --- */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 40px 24px 48px;
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

.footer-col h4 {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 0 0 12px;
}

.footer-col a, .footer-col p {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 8px;
  transition: color 0.15s ease;
}

.footer-col a:hover { color: var(--amber); }

.footer-bottom {
  max-width: var(--max-w);
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-faint);
  font-family: "IBM Plex Mono", monospace;
}

/* --- responsive --- */
@media (max-width: 720px) {
  nav.main-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    display: none;
  }
  nav.main-nav.open { display: flex; }
  .menu-toggle { display: inline-flex; }
  .hero { padding: 56px 20px 40px; }
  .footer-inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* focus visibility */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}
