/* ═══════════════════════════════════════════
   Theme: Solar
   Deep green nav, gold accents — grounded, optimistic
   ═══════════════════════════════════════════ */

:root {
  --bg: #fffdf7;
  --bg-alt: #f0efe8;
  --text: #1c1917;
  --text-muted: #7a7568;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --nav-bg: #2d6a4f;
  --nav-text: #ffffff;
  --btn-bg: #2d6a4f;
  --btn-text: #ffffff;
  --border: #d6d1c4;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 700px;
  --max-width-wide: 1100px;
  --radius: 2px;
  --spacing: 1.5rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 17px; line-height: 1.65; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--nav-bg); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #1e4d38; }

nav { background: var(--nav-bg); padding: 0 var(--spacing); position: sticky; top: 0; z-index: 100; }
body.nav-hidden nav { display: none; }
nav .inner { max-width: var(--max-width-wide); margin: 0 auto; display: flex; align-items: center; height: 48px; gap: 1.5rem; }
nav .logo { font-weight: 700; font-size: clamp(0.85rem, 2.5vw, 1.15rem); color: var(--nav-text); text-transform: uppercase; letter-spacing: 0.08em; text-decoration: none; white-space: nowrap; }
nav .logo:hover { text-decoration: none; opacity: 0.8; }
nav a:not(.logo) { font-size: clamp(0.6rem, 1.8vw, 0.8rem); font-weight: 600; color: var(--nav-text); text-decoration: none; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.85; white-space: nowrap; }
nav a:not(.logo):hover { opacity: 1; text-decoration: underline; }
nav .spacer { flex: 1; }
nav .lang-switch { font-size: 0.75rem; opacity: 0.7; }

.nav-links { display: flex; align-items: center; gap: 1.5rem; flex: 1; }

.hamburger { display: none; background: none; border: none; color: var(--nav-text); font-size: 1.4rem; cursor: pointer; padding: 0.25rem; line-height: 1; }

@media (max-width: 500px) {
  .hamburger { display: block; position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
  nav .inner { justify-content: center; position: relative; }
  .nav-links { display: none; position: absolute; top: 48px; left: 0; right: 0; background: var(--nav-bg); flex-direction: column; padding: 0.75rem 1.5rem; gap: 0.5rem; z-index: 100; }
  nav.nav-open .nav-links { display: flex; }
  .nav-links a { font-size: 0.85rem; padding: 0.4rem 0; white-space: nowrap; }
  .nav-links .spacer { display: none; }
  .nav-links .lang-switch { padding-top: 0.4rem; border-top: 1px solid rgba(255,255,255,0.2); margin-top: 0.2rem; width: 100%; }
}

.wiki-banner { background: #f0efe8; padding: 1.5rem var(--spacing); border-top: 3px solid var(--accent); }
.wiki-banner .inner { max-width: var(--max-width-wide); margin: 0 auto; display: flex; align-items: center; gap: 2rem; }
.wiki-banner h2 { font-size: 1.2rem; font-weight: 700; flex-shrink: 0; max-width: 280px; }
.wiki-banner p { font-size: 0.85rem; line-height: 1.5; flex: 1; }
.wiki-banner .btn { background: var(--btn-bg); color: var(--btn-text); padding: 0.5rem 1.25rem; font-size: 0.8rem; font-weight: 700; text-decoration: none; text-transform: uppercase; letter-spacing: 0.06em; flex-shrink: 0; border-radius: 4px; }
.wiki-banner .btn:hover { opacity: 0.9; text-decoration: none; }

.category-tag { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--nav-bg); margin-bottom: 0.75rem; }

main { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--spacing); }

/* Article styles */
article { padding-top: 2rem; }

/* article-hero template — hero wrapper div */
article .hero { margin-bottom: 2rem; }
article .hero .category-tag { margin-bottom: 0.5rem; }
article .hero h1 { font-size: 2.4rem; font-weight: 700; line-height: 1.15; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
article .hero .dek { font-size: 1.15rem; line-height: 1.5; color: var(--text-muted); margin-bottom: 1.5rem; font-weight: 400; }
article .hero .hero-dek { font-size: 1.15rem; line-height: 1.5; color: var(--text-muted); margin-bottom: 1.5rem; font-weight: 400; }

article h1 { font-size: 2.4rem; font-weight: 700; line-height: 1.15; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
article .dek { font-size: 1.15rem; line-height: 1.5; color: var(--text-muted); margin-bottom: 1.5rem; font-weight: 400; }

.byline-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.byline-row .author-photo { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-alt); flex-shrink: 0; }
.byline-row .byline-text { font-size: 0.85rem; }
.byline-row .byline-text .author-name { font-weight: 600; }
.byline-row .byline-text .date { color: var(--text-muted); font-size: 0.78rem; }

article h2 { font-size: 1.4rem; margin-top: 2.5rem; margin-bottom: 0.75rem; font-weight: 700; }
article h3 { font-size: 1.15rem; margin-top: 2rem; margin-bottom: 0.5rem; font-weight: 700; }
article p { margin-bottom: 1.25rem; font-size: 1rem; line-height: 1.7; }
article blockquote { border-left: 3px solid var(--accent); margin: 1.5rem 0; padding: 0.75rem 1.25rem; background: var(--bg-alt); color: var(--text-muted); font-style: italic; }
article ul, article ol { margin: 1rem 0 1.5rem 1.5rem; }
article li { margin-bottom: 0.4rem; }
article code { font-family: var(--font-mono); font-size: 0.85rem; background: var(--bg-alt); padding: 0.15em 0.4em; border-radius: 3px; }
article pre { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; overflow-x: auto; margin: 1.5rem 0; font-size: 0.85rem; }
article pre code { background: none; padding: 0; }
article img { max-width: 100%; height: auto; display: block; margin: 1.5rem 0; }
figure { margin: 1.5rem 0; }
figure img { margin: 0; }
figure figcaption { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.4; }
article hr { border: none; border-top: 2px solid var(--accent); margin: 2.5rem 0; width: 60px; }
article .table-wrapper { overflow-x: auto; margin: 1.5rem 0; -webkit-overflow-scrolling: touch; }
article .table-wrapper table { margin: 0; }
article table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
article th, article td { border: 1px solid var(--border); padding: 0.6rem 0.85rem; text-align: left; vertical-align: top; white-space: nowrap; }
article th { background: var(--bg-alt); font-weight: 700; }
article thead { border-bottom: 2px solid var(--border); }

.hero-image { position: relative; margin-bottom: 2rem; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); }
@media (min-width: 960px) { .hero-image { width: 900px; max-width: 900px; margin-left: calc(50% - 450px); } }
.hero-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.hero-image .caption { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.4; }
.hero-image .credit { font-weight: 600; }

.sim-embed { border: 1px solid var(--border); margin: 2rem 0; overflow: hidden; }
.sim-embed iframe { width: 100%; height: 480px; border: none; display: block; }
.sim-embed .sim-label { padding: 0.5rem 1rem; font-size: 0.78rem; color: var(--text-muted); border-top: 1px solid var(--border); background: var(--bg-alt); }

footer { background: var(--nav-bg); padding: 2.5rem var(--spacing); margin-top: 4rem; text-align: center; color: var(--nav-text); font-size: 0.85rem; font-weight: 500; }

/* ═══════════════════════════════════════════
   Homepage — Hero Navigation Bar
   ═══════════════════════════════════════════ */

.home-hero .hero-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  z-index: 10;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  width: 100%;
}

.home-hero .hero-nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

.home-hero .hero-nav a:hover {
  color: #ffffff;
  text-decoration: none;
}

.home-hero .hero-nav .hero-nav-links {
  display: flex;
  gap: 1.25rem;
}

.home-hero .hero-nav .hero-nav-lang .lang-switch a {
  opacity: 0.7;
}

.home-hero .hero-nav .hero-nav-lang .lang-switch a:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════
   Homepage — Full-Viewport Hero
   ═══════════════════════════════════════════ */

html { scroll-behavior: smooth; }

.home-hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background: linear-gradient(160deg, #1a3c2a 0%, #0f261a 50%, #0a1f12 100%);
  color: #ffffff;
  padding: 3rem 1.5rem 4rem;
  overflow: hidden;
}

/* Subtle grid pattern overlay */
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.home-hero .hero-inner {
  max-width: 680px;
  position: relative;
  z-index: 1;
}

.home-hero {
  --h-size: clamp(1.75rem, 5.5vw, 3.2rem);
}
.home-hero .hero-title {
  font-size: var(--h-size);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  line-height: 1.1;
  white-space: nowrap;
}

.home-hero .tagline {
  font-size: 1.2rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 2rem;
  font-weight: 400;
}

.home-hero .cta-button {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: 4px;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: all 0.2s;
}

.home-hero .cta-button:hover {
  background: var(--accent);
  color: #1a3c2a;
  text-decoration: none;
}

/* Scroll indicator */
.home-hero .scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  animation: float 2s ease-in-out infinite;
}

.home-hero .scroll-indicator .chevron {
  display: block;
  width: 20px;
  height: 20px;
  border-right: 2px solid rgba(255,255,255,0.4);
  border-bottom: 2px solid rgba(255,255,255,0.4);
  transform: rotate(45deg);
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

@media (max-width: 640px) {
  .home-hero { min-height: 100vh; padding: 2rem 1.25rem 3rem; }
  .home-hero .tagline { font-size: 1rem; }
}

/* ═══════════════════════════════════════════
   Homepage — Hybrid Grid (Card + Description)
   ═══════════════════════════════════════════ */

/* Homepage main wrapper */
.home { max-width: 1210px; padding-top: 1.5rem; }

.hybrid-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.95rem; padding-bottom: 3rem; }
.hybrid-card { display: block; text-decoration: none; color: inherit; border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.2s; }
.hybrid-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.hybrid-card .card-image { aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-alt); }
.hybrid-card .card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hybrid-card .card-body { padding: 0.95rem 0.95rem 1.5rem; }
.hybrid-card .category-tag { display: inline-block; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--nav-bg); margin-bottom: 0.35rem; }
.hybrid-card h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.25; margin: 0 0 0.3rem; letter-spacing: -0.01em; color: var(--text); }
.hybrid-card .card-desc { font-size: 1rem; color: var(--text-muted); line-height: 1.45; margin-bottom: 0.4rem; }
.hybrid-card .byline { font-size: 0.94rem; color: var(--text-muted); }

@media (max-width: 650px) { .hybrid-grid { grid-template-columns: 1fr; gap: 1.1rem; } }
@media (min-width: 651px) and (max-width: 1000px) { .hybrid-grid { grid-template-columns: repeat(2, 1fr); } }
