/* ============================================
   Thorium Baby — Design System
   Dark, technical, slightly brutalist.
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f1419;
  --text: #e7e9ea;
  --accent: #00d084;
  --blue: #1d9bf0;
  --muted: #71767b;
  --card-bg: #16202a;
  --border: #2f3336;
  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --max-w: 1140px;
  --gutter: 1.25rem;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--blue); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.35rem, 3vw, 2rem); margin-bottom: .75rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); margin-bottom: .5rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* --- Layout --- */
.wrapper {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

main { flex: 1; padding: 2rem 0 3rem; }

/* --- Navigation --- */
.site-nav {
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 100;
}

.site-nav .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

.site-nav__brand {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.site-nav__brand:hover { color: var(--accent); }

.site-nav__links {
  display: flex;
  list-style: none;
  gap: .15rem;
  flex-wrap: wrap;
}

.site-nav__links a {
  color: var(--muted);
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 500;
  padding: .35rem .55rem;
  border-radius: 4px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}

.site-nav__links a:hover,
.site-nav__links a.active {
  color: var(--text);
  background: var(--card-bg);
}

/* --- Hamburger (mobile) --- */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.25rem;
  padding: .25rem .5rem;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav__links {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: .5rem;
  }
  .site-nav__links.open { display: flex; }
  .site-nav__links a { padding: .5rem 0; }
}

/* --- Homepage Hero --- */
.hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 50% at 20% 60%, rgba(0,208,132,.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 30%, rgba(29,155,240,.05) 0%, transparent 70%);
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.04em;
}

.hero__tagline {
  font-family: var(--font-head);
  font-size: clamp(.95rem, 2vw, 1.15rem);
  color: var(--muted);
  margin-top: .5rem;
  font-weight: 400;
}

/* --- Section Grid (Homepage) --- */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.section-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  transition: border-color .2s, transform .15s;
  display: flex;
  flex-direction: column;
}

.section-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.section-card__title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

.section-card__title a { color: var(--text); }
.section-card__title a:hover { color: var(--accent); }

.section-card__desc {
  font-size: .9rem;
  color: var(--muted);
  flex: 1;
  margin-bottom: .75rem;
}

.section-card__meta {
  font-family: var(--font-head);
  font-size: .75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* --- About Callout --- */
.callout {
  background: var(--card-bg);
  border-left: 3px solid var(--accent);
  padding: 1.5rem 1.75rem;
  border-radius: 0 6px 6px 0;
  margin: 2.5rem 0;
}

.callout h2 {
  font-size: 1.15rem;
  margin-bottom: .5rem;
}

.callout p {
  color: var(--muted);
  font-size: .95rem;
}

.callout a { font-weight: 600; }

/* --- Section Index Pages --- */
.section-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 50% 60% at 70% 50%, rgba(0,208,132,.04) 0%, transparent 70%);
}

.section-header__title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: .75rem;
}

.section-header__desc {
  color: var(--muted);
  max-width: 720px;
  font-size: .95rem;
  line-height: 1.8;
}

.section-header__count {
  font-family: var(--font-head);
  font-size: .8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 1rem;
}

/* --- Article Grid (Section Index) --- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  transition: border-color .2s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100px;
}

.article-card:hover { border-color: var(--blue); }

.article-card__title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.article-card--placeholder {
  border-style: dashed;
  opacity: .6;
}

.article-card--placeholder .article-card__title {
  font-size: .85rem;
}

/* --- Sidebar Navigation --- */
.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .content-with-sidebar {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  position: sticky;
  top: 4rem;
}

.sidebar__heading {
  font-family: var(--font-head);
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .75rem;
}

.sidebar__list {
  list-style: none;
}

.sidebar__list li { margin-bottom: .35rem; }

.sidebar__list a {
  color: var(--muted);
  font-size: .9rem;
  padding: .3rem 0;
  display: block;
  border-left: 2px solid transparent;
  padding-left: .75rem;
  transition: color .15s, border-color .15s;
}

.sidebar__list a:hover,
.sidebar__list a.active {
  color: var(--text);
  border-left-color: var(--accent);
}

/* --- About Pages --- */
.about-content {
  max-width: 760px;
}

.about-content h1 { margin-bottom: 1.5rem; }
.about-content h2 { margin-top: 2rem; color: var(--accent); }
.about-content h3 { margin-top: 1.5rem; }

.about-content ul,
.about-content ol {
  margin: .75rem 0 1.25rem 1.5rem;
}

.about-content li {
  margin-bottom: .5rem;
  line-height: 1.7;
}

.about-content li::marker { color: var(--accent); }

/* --- Glossary --- */
.glossary-list { list-style: none; margin: 0; }

.glossary-list dt {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.glossary-list dt:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.glossary-list dd {
  color: var(--text);
  font-size: .95rem;
  margin: .25rem 0 0 0;
  padding-left: 0;
}

/* --- FAQ --- */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

.faq-item:first-child { padding-top: 0; }
.faq-item:last-child { border-bottom: none; }

.faq-item h3 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: .5rem;
}

.faq-item p {
  color: var(--muted);
  font-size: .95rem;
}

/* --- Resources --- */
.resource-group { margin-bottom: 2rem; }

.resource-group h2 {
  font-size: 1.15rem;
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.resource-group ul { list-style: none; margin: 0; }

.resource-group li {
  padding: .5rem 0;
  border-bottom: 1px solid rgba(47,51,54,.5);
}

.resource-group li:last-child { border-bottom: none; }

.resource-group a {
  font-weight: 600;
  font-size: .95rem;
}

.resource-group .resource-desc {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  margin-top: .15rem;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}

.site-footer p {
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: .25rem;
}

.site-footer a { color: var(--accent); }

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.accent { color: var(--accent); }
.blue   { color: var(--blue); }
.muted  { color: var(--muted); }

/* --- Geometric decoration --- */
.geo-line {
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
  margin: 1.5rem 0;
  max-width: 120px;
}

/* --- Print --- */
@media print {
  body { background: #fff; color: #000; }
  .site-nav, .site-footer, .sidebar { display: none; }
  a { color: #000; text-decoration: underline; }
}
