/* ==========================================================================
   Permafrost Game Wiki — Global Stylesheet
   Cold-tech frozen-apocalypse theme · Inter + Share Tech Mono
   ========================================================================== */

:root {
  --bg:        #090d12;
  --surface:   #101620;
  --surface2:  #151e2a;
  --elevated:  #1a2532;
  --border:    rgba(120, 190, 240, .12);
  --border-hi: rgba(168, 216, 240, .30);
  --ice:       #a8d8f0;
  --ice-dim:   #5b9bbf;
  --frost:     #c8e8f8;
  --warn:      #e8b04a;
  --danger:    #e87a7a;
  --success:   #7fce9e;
  --text:      #d4e8f4;
  --muted:     #6a8a9a;
  --mono: 'Share Tech Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', "Segoe UI", Roboto, system-ui, -apple-system, Arial, sans-serif;
  --maxw: 1100px;
  --radius: 10px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; border-radius: 8px; }

a { color: var(--ice); text-decoration: none; transition: color .2s; }
a:hover { color: var(--frost); }

h1, h2, h3, h4 { color: #fff; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
p { margin-bottom: 1rem; }
strong { color: var(--text); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* mono kicker used above headings ("// Label") */
.kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ice-dim); margin-bottom: 12px;
}

/* ── NAV ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(9, 13, 18, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: 1240px; margin: 0 auto; height: 56px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 14px; letter-spacing: .06em; color: var(--frost);
}
.brand:hover { color: var(--frost); }
.brand .logo {
  width: 24px; height: 24px; flex: none;
  background: url(../favicon.svg) center / contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(168, 216, 240, .35));
}
.brand .dot { color: var(--ice-dim); }

.nav-mid { display: flex; align-items: center; gap: 26px; }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; align-items: center; }
.nav-links a {
  font-size: 12px; font-weight: 500; color: var(--muted);
  letter-spacing: .05em; text-transform: uppercase;
}
.nav-links a:hover { color: var(--ice); }
.nav-badge {
  font-family: var(--mono); font-size: 11px;
  background: rgba(168, 216, 240, .10); border: 1px solid rgba(168, 216, 240, .20);
  color: var(--ice); padding: 4px 10px; border-radius: 4px; white-space: nowrap;
}
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  color: var(--ice); font-size: 1.2rem; padding: 3px 11px; border-radius: 6px; cursor: pointer;
}

@media (max-width: 820px) {
  .nav-badge { display: none; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-links.open { max-height: 420px; padding: 6px 0; }
  .nav-links a { display: block; width: 100%; padding: 13px 24px; font-size: 13px; }
  .nav-links a:hover { background: var(--surface2); }
}

/* ── AD SLOTS ── */
.ad-slot {
  margin: 30px auto; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
}
.ad-728 { max-width: 728px; height: 90px; width: 100%; }
.ad-300 { max-width: 300px; height: 250px; width: 100%; float: right; margin: 6px 0 22px 28px; }
@media (max-width: 560px) { .ad-300 { float: none; margin: 24px auto; } }

/* full-bleed ad strips (homepage) */
.ad-strip {
  width: 100%; height: 90px; margin: 0;
  background: rgba(255, 255, 255, .03);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
}
.ad-strip.tall { height: 270px; }
.ad-strip.top { margin-top: 56px; }

/* ── MAIN ── */
main { }
.page { padding: 28px 0 70px; }

/* ── BREADCRUMB ── */
.breadcrumb { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 4px 0 20px; letter-spacing: .03em; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--ice); }
.breadcrumb span { color: var(--ice-dim); }

/* ── HERO ── */
.hero {
  position: relative; min-height: 90vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 120px 24px 70px; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 28%, rgba(40, 90, 130, .35) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 18% 82%, rgba(30, 60, 100, .20) 0%, transparent 60%);
}
.frost-lines {
  position: absolute; inset: 0; pointer-events: none; opacity: .16;
  background-image:
    linear-gradient(112deg, transparent 48%, rgba(168, 216, 240, .4) 49%, transparent 50%),
    linear-gradient(68deg,  transparent 62%, rgba(168, 216, 240, .25) 63%, transparent 64%),
    linear-gradient(135deg, transparent 30%, rgba(100, 180, 230, .2) 31%, transparent 32%);
}
.hero > * { position: relative; z-index: 1; }

/* ── HERO ANIMATED SCENE ── */
.hero-scene { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

/* video background — desktop only */
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
  opacity: 0; transition: opacity 1.4s ease; z-index: 0;
}
.hero-video.loaded { opacity: 1; }

/* dark gradient overlay on top of video */
.hero-video-overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(to bottom,
      rgba(9,13,18,.60) 0%,
      rgba(9,13,18,.20) 35%,
      rgba(9,13,18,.55) 75%,
      rgba(9,13,18,.85) 100%),
    radial-gradient(ellipse 90% 55% at 50% 25%, rgba(5,20,40,.30) 0%, transparent 70%);
}

/* mobile/reduced-motion: hide video, show gradient fallback */
@media (max-width: 640px) { .hero-video { display: none; } }
@media (prefers-reduced-motion: reduce) { .hero-video { display: none; } }

/* aurora glow fallback (always shown — subtle behind/through the video) */
.hero-scene .aurora {
  position: absolute; left: -10%; right: -10%; top: -20%; height: 75%; z-index: 2;
  background:
    radial-gradient(40% 60% at 25% 45%, rgba(60,130,180,.18), transparent 70%),
    radial-gradient(35% 55% at 70% 30%, rgba(95,165,215,.14), transparent 70%),
    radial-gradient(30% 50% at 50% 55%, rgba(40,90,140,.12), transparent 70%);
  filter: blur(22px);
  animation: auroraDrift 20s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(-4%, 0, 0) scale(1);    opacity: .75; }
  50%  { opacity: 1; }
  100% { transform: translate3d(5%, 2%, 0) scale(1.08); opacity: .7; }
}

.hero-scene .snow-canvas { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; }

@media (prefers-reduced-motion: reduce) {
  .hero-scene .aurora { animation: none; }
}
.hero-eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ice-dim); margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.4rem); font-weight: 700; line-height: 1.05;
  letter-spacing: -.02em; color: #fff;
}
.hero h1 em {
  font-style: normal; color: var(--ice);
  text-shadow: 0 0 40px rgba(168, 216, 240, .45), 0 0 80px rgba(100, 170, 220, .2);
}
.hero .tagline { margin-top: 20px; max-width: 580px; font-size: 1.05rem; color: var(--muted); }

.countdown { margin-top: 36px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.cd-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 18px; min-width: 74px; text-align: center;
}
.cd-box .num { font-family: var(--mono); font-size: 2rem; font-weight: 400; color: var(--ice); display: block; line-height: 1; }
.cd-box .lbl { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; display: block; }
.cd-caption { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 18px; letter-spacing: .05em; }

.hero-cta { margin-top: 40px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn { display: inline-flex; align-items: center; gap: 7px; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--ice); color: #090d12; padding: 12px 28px; transition: background .2s, transform .15s; }
.btn-primary:hover { background: var(--frost); color: #090d12; transform: translateY(-1px); }
.btn-ghost { border-color: var(--border); color: var(--text); padding: 12px 24px; transition: border-color .2s, color .2s; }
.btn-ghost:hover { border-color: var(--ice-dim); color: var(--ice); }

/* ── SECTIONS ── */
.section { max-width: var(--maxw); margin: 0 auto; padding: 78px 24px; }
.section-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ice-dim); margin-bottom: 12px;
}
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 700; color: #fff; line-height: 1.2; }
.section-sub { color: var(--muted); max-width: 640px; margin-top: 10px; }
.divider { border: none; border-top: 1px solid var(--border); max-width: var(--maxw); margin: 0 auto; }

/* ── TIPS TICKER (homepage) ── */
.tips-bar {
  background: var(--surface2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; gap: 16px; justify-content: center; flex-wrap: wrap;
}
.tips-tag {
  font-family: var(--mono); font-size: 11px; color: var(--warn); text-transform: uppercase;
  letter-spacing: .1em; white-space: nowrap; background: rgba(232, 176, 74, .10);
  border: 1px solid rgba(232, 176, 74, .20); padding: 3px 8px; border-radius: 4px;
}
.tips-text { font-size: 13px; color: var(--muted); }

/* ── ABOUT / STATS ── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 40px; align-items: start; }
.about-text p { color: var(--muted); font-size: .97rem; }
.about-text p strong { color: var(--text); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.stat-val { font-family: var(--mono); font-size: 1.5rem; color: var(--ice); display: block; }
.stat-key { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; display: block; }
@media (max-width: 720px) { .about-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ── CARDS ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 40px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column;
  transition: border-color .2s, transform .15s;
}
.card:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.card .icon { font-size: 1.6rem; margin-bottom: 14px; }
.card h3 { font-size: 1.05rem; font-weight: 600; color: #fff; margin-bottom: 8px; }
.card p { font-size: .9rem; color: var(--muted); flex: 1; margin-bottom: 0; }
.card .card-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 13px; font-weight: 500; color: var(--ice); }
.card .card-link::after { content: '→'; }
.card:hover .card-link { color: var(--frost); }

/* ── POST LIST ── */
.post-list { list-style: none; margin: 36px 0 0; }
.post-list li { display: flex; gap: 16px; align-items: baseline; padding: 15px 0; border-bottom: 1px solid var(--border); }
.post-list .date { font-family: var(--mono); font-size: 12px; color: var(--ice-dim); min-width: 104px; }
.post-list a { font-weight: 500; font-size: 1rem; color: var(--text); }
.post-list a:hover { color: var(--ice); }

/* ── FAQ ── */
.faq { margin-top: 36px; display: flex; flex-direction: column; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0 20px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 0; font-size: .97rem; font-weight: 500; color: var(--text);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.3rem; color: var(--ice-dim); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 14px 0 18px; margin: 0; border-top: 1px solid var(--border); font-size: .9rem; color: var(--muted); }

/* ── ARTICLE BODY ── */
.article-layout { max-width: 780px; margin: 0 auto; }
.article-layout h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin-bottom: 10px; }
.article-layout h2 {
  font-size: 1.5rem; margin: 2.4rem 0 .9rem; padding-left: 14px;
  border-left: 2px solid var(--ice-dim); scroll-margin-top: 80px; color: #fff;
}
.article-layout h3 { font-size: 1.15rem; margin: 1.7rem 0 .6rem; color: var(--frost); }
.article-layout p { color: var(--text); }
.article-layout ul, .article-layout ol { margin: 0 0 1.1rem 1.3rem; color: var(--text); }
.article-layout li { margin-bottom: .5rem; }
.article-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 24px; letter-spacing: .04em; }
.article-layout > img { margin: 8px 0 26px; border: 1px solid var(--border); }

/* ── TABLE OF CONTENTS ── */
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 26px; margin: 26px 0 34px; }
.toc h2 { font-size: 1rem; margin: 0 0 12px; padding: 0; border: none; font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ice-dim); }
.toc ol { margin: 0 0 0 1.1rem; }
.toc li { margin-bottom: .4rem; }
.toc a { color: var(--muted); font-size: .95rem; }
.toc a:hover { color: var(--ice); }

/* ── TIP BOXES ── */
.tip { border-radius: 8px; padding: 16px 20px; margin: 24px 0; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--ice); }
.tip.warn { border-left-color: var(--warn); }
.tip.danger { border-left-color: var(--danger); }
.tip.success { border-left-color: var(--success); }
.tip .tip-title { font-weight: 700; color: #fff; display: block; margin-bottom: 4px; font-size: .95rem; }
.tip p { margin-bottom: 0; color: var(--muted); font-size: .93rem; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--border); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: #fff; background: var(--surface2); font-family: var(--mono); font-weight: 400; font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; }
td { color: var(--muted); }
td strong { color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(168, 216, 240, .03); }

/* ── RELATED ── */
.related { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.related h2 { border: none; padding: 0; font-size: 1.3rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 18px; }
.related-grid a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; color: #fff; font-weight: 600; font-size: .95rem; transition: border-color .2s; }
.related-grid a:hover { border-color: var(--border-hi); color: var(--frost); }
.related-grid a span { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: 4px; }

/* ── FOOTER ── */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 44px 0 34px; margin-top: 40px; font-size: 13px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 34px; margin-bottom: 28px; }
.footer-grid h4 { color: #fff; font-size: .95rem; margin-bottom: 12px; }
.footer-brand { font-family: var(--mono); color: var(--frost); font-size: 14px; letter-spacing: .06em; margin-bottom: 12px; display: block; }
.footer-brand .dot { color: var(--ice-dim); }
.footer-grid ul { list-style: none; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--muted); }
.footer-grid a:hover { color: var(--ice); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 18px; text-align: center; line-height: 1.7; }
.disclaimer { font-size: 11px; color: var(--muted); max-width: 780px; margin: 8px auto 0; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }

/* ── AD SLOTS HIDDEN ──
   Ads are not yet integrated. The slot markup stays in the HTML so it can be
   re-enabled instantly — just delete this block (or set display: block) once a
   real ad network is wired up. */
.ad-slot, .ad-strip { display: none !important; }

/* ── MOBILE ── */
@media (max-width: 640px) {
  .container { padding: 0 16px; }

  /* Hero */
  .hero { padding: 86px 16px 44px; min-height: unset; }
  .hero h1 { font-size: 2.4rem; }
  .hero .tagline { font-size: .93rem; margin-top: 14px; max-width: 100%; }

  /* Countdown — 2×2 grid so all 4 fit neatly */
  .countdown { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 230px; margin-top: 24px; }
  .cd-box { min-width: unset; padding: 12px 8px; }
  .cd-box .num { font-size: 1.65rem; }
  .cd-caption { margin-top: 12px; }

  /* CTA buttons — stack vertically */
  .hero-cta { flex-direction: column; align-items: stretch; margin-top: 28px; gap: 10px; }
  .btn { justify-content: center; }

  /* Sections */
  .section { padding: 44px 16px; }
  .section-title { font-size: 1.6rem; }

  /* Post list — date above link */
  .post-list li { flex-direction: column; gap: 3px; padding: 14px 0; }
  .post-list .date { min-width: auto; }

  /* Article pages */
  .page { padding: 20px 16px 50px; }
  .toc { padding: 16px 18px; }
  .article-layout h2 { font-size: 1.3rem; }
  .article-layout h1 { font-size: 1.75rem; }
  .related-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 360px) {
  .hero h1 { font-size: 2rem; }
  .countdown { max-width: 200px; }
  .cd-box .num { font-size: 1.4rem; }
}
