:root {
  --bg: #0a0e0c;
  --bg-soft: #111714;
  --panel: #161d18;
  --ink: #eaf3ec;
  --muted: #8aa395;
  --accent: #5fcf6b;
  --accent-2: #4ea8de;
  --warn: #e9c46a;
  --line: rgba(255, 255, 255, 0.08);
  --radius: 18px;
  --maxw: 1200px;
  --font: "Space Grotesk", system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.admin-bar .nav { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .nav { top: 46px; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #06210c; }
.btn--primary:hover { background: #74e084; }
.btn--ghost { border-color: var(--line); color: var(--ink); background: rgba(255, 255, 255, 0.02); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.2rem;
  transition: opacity 0.6s ease;
}
.loader.hide { opacity: 0; pointer-events: none; }
.terravox-js-failed .loader { display: none; }
.loader__bar {
  width: min(320px, 70vw); height: 6px;
  background: var(--panel); border-radius: 999px; overflow: hidden;
}
.loader__bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s ease;
}
.loader__txt { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); letter-spacing: 0.1em; }
.loader__txt em { color: var(--accent); font-style: normal; }

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(10, 14, 12, 0.85), rgba(10, 14, 12, 0));
}
.nav__brand { font-weight: 700; font-size: 1.25rem; letter-spacing: 0.02em; }
.nav__brand i { color: var(--accent); font-style: normal; }
.nav__links,
.footer__nav {
  display: flex;
  gap: 1.8rem;
  list-style: none;
  align-items: center;
}
.nav__links { font-size: 0.92rem; color: var(--muted); }
.footer__nav { color: var(--muted); font-size: 0.9rem; }
.nav__links a:hover,
.footer__nav a:hover,
.nav__links .current-menu-item > a,
.footer__nav .current-menu-item > a { color: var(--ink); }
.nav__cta { padding: 0.55rem 1.1rem; font-size: 0.88rem; }
@media (max-width: 720px) {
  .nav__links { display: none; }
}

.hero { position: relative; height: 100vh; min-height: 640px; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.terravox-js-failed #scene { display: none; }
.hero__grain {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(10, 14, 12, 0.85) 100%),
    linear-gradient(180deg, rgba(10, 14, 12, 0.2), rgba(10, 14, 12, 0.55));
}
.hero__overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 clamp(1.2rem, 6vw, 5rem);
  max-width: 760px; pointer-events: none;
}
.hero__overlay > * { pointer-events: auto; }
.hero__tag { font-family: var(--mono); color: var(--accent); font-size: 0.8rem; letter-spacing: 0.18em; margin-bottom: 1rem; }
.hero__title { font-size: clamp(2.4rem, 7vw, 5rem); line-height: 1.02; font-weight: 700; letter-spacing: -0.02em; }
.hero__title span { color: var(--accent); }
.hero__sub { margin-top: 1.3rem; color: var(--muted); max-width: 48ch; font-size: clamp(1rem, 1.6vw, 1.15rem); }
.hero__actions { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.hero__hint { margin-top: 2.2rem; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.16em; }

.hero__hud {
  position: absolute; right: clamp(1rem, 4vw, 2.5rem); bottom: clamp(1rem, 4vw, 2.5rem);
  display: flex; gap: 1.4rem; flex-wrap: wrap;
}
.hud__item { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--mono); }
.hud__item span { font-size: 0.62rem; color: var(--muted); letter-spacing: 0.12em; }
.hud__item b { font-size: 1.1rem; color: var(--ink); }

.marquee { border-block: 1px solid var(--line); background: var(--bg-soft); overflow: hidden; padding: 0.9rem 0; }
.marquee__track { display: flex; gap: 1.2rem; white-space: nowrap; width: max-content; animation: scroll 28s linear infinite; font-family: var(--mono); font-size: 0.9rem; letter-spacing: 0.1em; color: var(--ink); }
.marquee__track i { color: var(--accent); font-style: normal; }
@keyframes scroll { to { transform: translateX(-50%); } }

.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(4rem, 10vw, 8rem) clamp(1.2rem, 5vw, 2.5rem); }
.section__head { margin-bottom: 3rem; }
.section__num { font-family: var(--mono); color: var(--accent); font-size: 0.8rem; letter-spacing: 0.16em; margin-bottom: 1rem; }
.section__title,
.content-title { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; }
.section__title span { color: var(--accent); }
.section__lead { margin-top: 1.2rem; color: var(--muted); max-width: 60ch; }

.biomes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 900px) { .biomes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .biomes { grid-template-columns: 1fr; } }
.biome {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  position: relative; overflow: hidden;
}
.biome::before { content: ""; position: absolute; inset: 0; background: var(--tint); opacity: 0; transition: opacity 0.25s ease; mix-blend-mode: soft-light; }
.biome:hover { transform: translateY(-4px); border-color: var(--tint); }
.biome:hover::before { opacity: 0.18; }
.biome__ic { font-size: 2rem; display: block; margin-bottom: 0.8rem; }
.biome h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.biome p { color: var(--muted); font-size: 0.92rem; }

.features__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 700px) { .features__grid { grid-template-columns: 1fr; } }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; transition: transform 0.2s ease, border-color 0.2s ease; }
.feature:hover { transform: translateY(-4px); border-color: var(--accent); }
.feature b { font-family: var(--mono); color: var(--accent); font-size: 0.8rem; letter-spacing: 0.1em; }
.feature h3 { font-size: 1.3rem; margin: 0.6rem 0 0.6rem; }
.feature p { color: var(--muted); font-size: 0.95rem; }
.feature__status {
  display: inline-block; margin: 0.6rem 0 0.2rem;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.12em;
  padding: 0.25rem 0.55rem; border-radius: 999px; border: 1px solid var(--line);
}
.status--done { color: #06210c; background: var(--accent); border-color: var(--accent); }
.status--wip { color: #2a1f06; background: var(--warn); border-color: var(--warn); }
.status--soon { color: var(--muted); }

.devlog__list { list-style: none; display: flex; flex-direction: column; gap: 0; border-left: 1px solid var(--line); }
.devlog__item { position: relative; padding: 0 0 2.2rem 1.8rem; }
.devlog__item::before {
  content: ""; position: absolute; left: -6px; top: 6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--bg);
}
.devlog__item:nth-child(3)::before,
.devlog__item:nth-child(4)::before { background: var(--muted); }
.devlog__meta { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.devlog__ver { font-family: var(--mono); font-weight: 700; color: var(--ink); font-size: 0.9rem; }
.devlog__tag { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.12em; padding: 0.2rem 0.5rem; border-radius: 999px; }
.tag--done { color: #06210c; background: var(--accent); }
.tag--wip { color: #2a1f06; background: var(--warn); }
.devlog__meta time { margin-left: auto; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.1em; }
.devlog__item h3,
.post-card h2 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.devlog__item p,
.post-card p { color: var(--muted); font-size: 0.95rem; max-width: 70ch; }
.devlog__next {
  margin-top: 2.5rem; padding: 1.6rem 1.8rem; border: 1px dashed var(--line);
  border-radius: var(--radius); background: rgba(95, 207, 107, 0.04);
}
.devlog__next h3 { font-size: 1.1rem; margin-bottom: 0.8rem; color: var(--accent); }
.devlog__next ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; }
.devlog__next li { color: var(--ink); font-size: 0.95rem; padding-left: 1.1rem; position: relative; }
.devlog__next li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); }

.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: step; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; position: relative; }
.steps li span { font-family: var(--mono); font-size: 1.6rem; color: var(--accent); display: block; margin-bottom: 0.8rem; }
.steps h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.steps p { color: var(--muted); font-size: 0.92rem; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 1.4rem; text-align: center; background: var(--panel); }
.stat b { display: block; font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; color: var(--accent); font-family: var(--mono); }
.stat span { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.1em; }

.download { display: flex; justify-content: center; }
.download__card {
  width: 100%; max-width: 880px; text-align: center;
  background: linear-gradient(160deg, rgba(95, 207, 107, 0.12), rgba(78, 168, 222, 0.06));
  border: 1px solid var(--line); border-radius: 28px; padding: clamp(2.5rem, 6vw, 4.5rem);
}
.download__card h2 { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.05; }
.download__card p { color: var(--muted); margin: 1.2rem auto 2rem; max-width: 50ch; }
.download__actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.download__fine { margin-top: 2.5rem; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.12em; }

.footer {
  border-top: 1px solid var(--line);
  max-width: var(--maxw); margin: 0 auto;
  padding: 2.5rem clamp(1.2rem, 5vw, 2.5rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.footer__brand { font-weight: 700; font-size: 1.2rem; }
.footer__brand i { color: var(--accent); font-style: normal; }
.footer__legal { color: var(--muted); font-size: 0.78rem; font-family: var(--mono); }

.content-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(7rem, 12vw, 9rem) clamp(1.2rem, 5vw, 2.5rem) 5rem;
}
.content-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(1.8rem, 4vw, 3rem);
}
.content-body {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 1rem;
}
.content-body > * + * { margin-top: 1rem; }
.content-body a,
.post-card a,
.devlog__item a { color: var(--ink); }
.content-body a:hover,
.post-card a:hover,
.devlog__item a:hover { color: var(--accent); }
.post-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}
.post-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.pagination-wrap {
  margin-top: 1rem;
  color: var(--muted);
}
.pagination-wrap .nav-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
