@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=IBM+Plex+Mono:ital,wght@0,400;0,500;1,400&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --surface: #141414;
  --surface2: #1a1a1a;
  --surface3: #1f1f1f;
  --border: #2a2a2a;
  --border-light: #333;
  --text: #e0e0e0;
  --text-dim: #888;
  --text-faint: #555;
  --gold: #d4758c;
  --gold-dim: rgba(212,117,140,0.12);
  --gold-glow: rgba(212,117,140,0.06);
  --rose: #d4758c;
  --etta: #6ba3be;
  --sacred: #a89060;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Space Grotesk', sans-serif;
  --max-w: 900px;
  --nav-h: 52px;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--border) var(--bg);
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  min-height: 100vh;
}

/* ─── TOP NAV ─── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.topnav::-webkit-scrollbar { display: none; }

.topnav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  margin-right: 1.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.topnav-brand:hover { text-decoration: none; color: var(--gold); }

.topnav-links {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.topnav-links a {
  padding: 0 0.85rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.topnav-links a:hover {
  color: var(--text);
}

.topnav-links a.current {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* Hamburger (mobile) */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  z-index: 199;
  padding: 0.5rem 0;
}

.nav-mobile-menu.open { display: block; }

.nav-mobile-menu a {
  display: block;
  padding: 0.65rem 1.5rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-mobile-menu a.current { color: var(--gold); }
.nav-mobile-menu a:hover { color: var(--text); background: var(--surface); }

/* ─── MAIN CONTENT ─── */
.main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 5rem;
}

/* ─── PAGE HERO ─── */
.page-hero {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.page-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  line-height: 1.1;
}

.page-hero p {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 600px;
}

/* ─── LANDING HERO ─── */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: 'ma si tu lo ruk';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--mono);
  font-size: 8rem;
  font-weight: 700;
  color: rgba(201,169,98,0.03);
  letter-spacing: 0.15em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.hero-title {
  font-size: 4rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
}

.hero-sub {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 1rem;
  letter-spacing: 0.04em;
}

.hero-anchors {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.anchor-item { text-align: center; }

.anchor-sound {
  font-family: var(--mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  display: block;
}

.anchor-meaning {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.hero-stats .stat-val {
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 700;
  display: block;
  margin-bottom: 0.1rem;
}

/* ─── SECTION CARDS (landing page) ─── */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
  display: block;
}

.section-card:hover {
  border-color: var(--gold);
  background: var(--surface2);
  text-decoration: none;
  color: var(--text);
}

.section-card .card-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.35rem;
}

.section-card .card-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.section-card .card-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  margin-top: 0.6rem;
}

/* ─── GENERAL CONTENT ─── */
h2 {
  font-size: 1.6rem;
  color: var(--gold);
  margin: 2.5rem 0 0.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2:first-child { margin-top: 0; }

.section-intro {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  max-width: 640px;
}

h3 {
  font-size: 1.15rem;
  color: var(--text);
  margin: 2rem 0 0.75rem;
  font-weight: 600;
}

h4 {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 1.5rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

h5, h6 {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 1rem 0 0.4rem;
  font-weight: 500;
}

p { margin: 0.6rem 0; }
strong { color: var(--gold); font-weight: 600; }
em { font-style: italic; color: var(--text); }

code {
  font-family: var(--mono);
  background: var(--surface2);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.88em;
  color: var(--text);
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

pre code { background: none; padding: 0; font-size: inherit; color: var(--text); }

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { margin: 0.5rem 0 0.5rem 1.25rem; }

ul { list-style: none; }
ul li::before {
  content: "4";
  color: var(--gold);
  margin-right: 0.5rem;
  font-weight: 300;
}

ol li { padding-left: 0.25rem; margin: 0.25rem 0; }

blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.6rem 1.25rem;
  margin: 1rem 0;
  background: var(--gold-dim);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--text);
}

hr.divider {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ─── TABLES ─── */
.table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
  border-radius: 6px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th {
  text-align: left;
  padding: 0.6rem 0.85rem;
  background: var(--surface2);
  color: var(--gold);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

td {
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(201,169,98,0.03); }

/* ─── DICTIONARY FILTER ─── */
.dict-filter {
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
  background: var(--bg);
  padding: 1rem 0;
  margin-bottom: 1rem;
}

.dict-filter input {
  width: 100%;
  max-width: 400px;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.dict-filter input:focus { border-color: var(--gold); }
.dict-filter input::placeholder { color: var(--text-faint); }

.dict-count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

/* ─── COLLAPSIBLE SECTIONS ─── */
details {
  margin: 0.5rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

details summary {
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  user-select: none;
  transition: background 0.15s;
  list-style: none;
}

details summary::-webkit-details-marker { display: none; }

details summary::before {
  content: "B8";
  color: var(--gold);
  margin-right: 0.6rem;
  font-size: 0.8rem;
  display: inline-block;
  transition: transform 0.15s;
}

details[open] summary::before { transform: rotate(90deg); }
details summary:hover { background: var(--surface2); }

details .grammar-content,
details .lesson-content,
details .session-content {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
}

details.rose summary { border-left: 3px solid var(--rose); }
details.etta summary { border-left: 3px solid var(--etta); }

/* ─── CONVERSATION STYLING ─── */
.conversation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  margin: 1.25rem 0;
}

.conversation h3 {
  color: var(--gold);
  margin: 0 0 0.15rem;
  font-size: 1.1rem;
}

.conv-subtitle {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem !important;
}

.register-tag {
  display: inline-block;
  background: var(--gold-dim);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-style: normal;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.dialogue {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dialogue-line {
  display: grid;
  grid-template-columns: 90px 1fr;
  grid-template-rows: auto auto;
  gap: 0 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.dialogue-line:last-child { border-bottom: none; }

.speaker {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  grid-row: 1 / 3;
  padding-top: 0.15rem;
}

.akros-text { font-weight: 500; color: var(--text); font-size: 0.9rem; }
.english-text { font-style: italic; color: var(--text-dim); font-size: 0.82rem; margin-top: 0.1rem; }

/* ─── SACRED TEXT STYLING ─── */
.sacred-section {
  border-left: 3px solid var(--sacred);
  padding-left: 1.5rem;
  margin: 1rem 0;
}

/* ─── PANTHEON CARDS ─── */
.pantheon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.god-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.god-card:hover { border-color: var(--gold); }
.god-card .god-name { font-size: 1.1rem; font-weight: 700; color: var(--gold); margin-bottom: 0.1rem; }
.god-card .god-domain { font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.6rem; }
.god-card .god-desc { font-size: 0.85rem; color: var(--text-dim); line-height: 1.55; }
.god-card .god-anchor { font-family: var(--mono); font-size: 0.75rem; color: var(--gold); margin-top: 0.6rem; opacity: 0.7; }

/* ─── REALM CARDS ─── */
.realm-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.realm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; text-align: center; }
.realm-card .realm-name { font-size: 1rem; font-weight: 700; color: var(--gold); }
.realm-card .realm-desc { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.4rem; }

/* ─── HERO CARDS ─── */
.heroes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.hero-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1rem; }
.hero-card .hero-name { font-weight: 700; color: var(--gold); font-size: 0.95rem; }
.hero-card .hero-role { font-family: var(--mono); font-size: 0.65rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.hero-card .hero-desc { font-size: 0.8rem; color: var(--text-dim); line-height: 1.5; }

/* ─── MILESTONE TIMELINE ─── */
.milestone { display: flex; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.milestone:last-child { border-bottom: none; }
.milestone-cycle { font-family: var(--mono); font-weight: 600; color: var(--gold); min-width: 60px; flex-shrink: 0; }
.milestone-desc { color: var(--text-dim); }

/* ─── AGENT CARDS ─── */
.agent-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.agent-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; }
.agent-card.rose { border-left: 3px solid var(--rose); }
.agent-card.etta { border-left: 3px solid var(--etta); }
.agent-card .agent-name { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.agent-card.rose .agent-name { color: var(--rose); }
.agent-card.etta .agent-name { color: var(--etta); }
.agent-card p { font-size: 0.85rem; color: var(--text-dim); margin: 0.25rem 0; }

/* ─── TABS ─── */
.tab-controls {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.tab-btn {
  padding: 0.6rem 1.25rem;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); }
.tab-btn.rose-tab.active { color: var(--rose); border-bottom-color: var(--rose); }
.tab-btn.etta-tab.active { color: var(--etta); border-bottom-color: var(--etta); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── FOOTER ─── */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* ─── UTILITY ─── */
.dim { color: var(--text-dim); }
.gold { color: var(--gold); }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }

/* ─── MOBILE ─── */
@media (max-width: 760px) {
  .topnav-links { display: none; }
  .nav-hamburger { display: block; }

  .main { padding: 0 1rem 4rem; }

  .hero-title { font-size: 2.2rem; }
  .hero-anchors { gap: 1rem; }
  .hero-stats { gap: 1.25rem; }
  .page-hero h1 { font-size: 1.8rem; }
  .page-hero { padding: 2rem 0 1.5rem; }

  .agent-cards, .realm-row { grid-template-columns: 1fr; }
  .dialogue-line { grid-template-columns: 60px 1fr; }

  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  pre, code { white-space: pre-wrap; word-break: break-word; }

  h2 { font-size: 1.3rem; }
  details summary { font-size: 0.9rem; }
}
