/* Glassfall: tokens match the game's Prism UI (godot/scripts/prism_ui.gd). */
:root {
  --ground: #070c12;
  --surface: #0d141b;
  --surface-raised: #111a23;
  --surface-sunk: #04080c;
  --glass: rgb(120 200 225 / 0.07);
  --glass-card: rgb(153 217 242 / 0.04);
  --hairline: rgb(160 215 232 / 0.16);
  --hairline-strong: rgb(160 215 232 / 0.46);
  --specular: rgb(217 247 255 / 0.22);
  --ink: #e4f0f3;
  --ink-muted: #9db3bc;
  --ink-faint: #7f96a0;
  --accent: #6fe0ec;
  --on-accent: #03161b;
  --accent-soft: rgb(111 224 236 / 0.12);
  --glow: rgb(111 224 236 / 0.5);
  --prism-violet: #b9b4ff;

  --font-display: "Michroma", "Eurostile", sans-serif;
  --font-text: "Sora", system-ui, sans-serif;
  --font-data: "Geist Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --radius: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink-muted);
  font: 300 17px/1.7 var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-color: rgb(111 224 236 / 0.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--ink); }
h1, h2, h3 { color: var(--ink); margin: 0; font-weight: 400; }
p { margin: 0 0 1.1em; }
em { color: var(--ink); font-style: normal; }
strong { color: var(--ink); font-weight: 500; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; }

.data { font-family: var(--font-data); font-weight: 400; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.kicker {
  font-family: var(--font-data); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px; font-weight: 400;
}
.kicker a { text-decoration: none; }

/* The glass panel: a faint fill, a hairline, a specular edge along the top. */
.glass {
  position: relative;
  background: linear-gradient(180deg, var(--glass) 0%, var(--glass-card) 60%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.glass::before {
  content: ""; position: absolute; inset: 0 12% auto; height: 1px;
  background: linear-gradient(90deg, transparent, var(--specular), transparent);
  pointer-events: none;
}

/* Masthead */
.masthead {
  position: fixed; inset: 0 0 auto; z-index: 5;
  background: linear-gradient(180deg, rgb(7 12 18 / 0.85), rgb(7 12 18 / 0));
  background-origin: border-box;
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s;
}
.masthead.is-scrolled {
  background: rgb(7 12 18 / 0.72);
  border-bottom-color: var(--hairline);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.masthead__inner {
  max-width: var(--max); margin: 0 auto; padding: 18px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  font-family: var(--font-display); font-size: 13px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--ink);
}
.wordmark__mark { width: 22px; height: 22px; color: var(--accent); filter: drop-shadow(0 0 6px var(--glow)); }
.nav { display: flex; gap: clamp(14px, 3vw, 32px); }
.nav a {
  font-family: var(--font-data); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-muted); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Hero */
.hero { position: relative; min-height: clamp(560px, 100svh, 960px); display: grid; grid-template-rows: 1fr auto; isolation: isolate; }
.hero__art, .hero__art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__art { z-index: -2; overflow: hidden; }
.hero__art img { object-fit: cover; object-position: 62% 40%; animation: drift 40s ease-out both; }
.hero__veil {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgb(7 12 18 / 0.88) 0%, rgb(7 12 18 / 0.55) 38%, rgb(7 12 18 / 0) 65%),
    linear-gradient(180deg, rgb(7 12 18 / 0) 50%, rgb(7 12 18 / 0.7) 78%, var(--ground) 96%);
}
.hero__content {
  align-self: center; width: 100%; max-width: var(--max); margin: 0 auto;
  padding: 140px var(--gutter) 48px;
}
.hero__title {
  font-family: var(--font-display); text-transform: uppercase;
  font-size: clamp(30px, 8vw, 96px); line-height: 1.02; letter-spacing: 0.06em;
  margin: 0 0 28px;
  background: linear-gradient(180deg, #f4fbfd 30%, #9fd6e2 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgb(111 224 236 / 0.12);
}
.hero__lede { max-width: 34em; font-size: clamp(17px, 1.6vw, 20px); color: var(--ink); opacity: 0.86; margin-bottom: 36px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px;
  font-family: var(--font-data); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none;
  color: var(--ink); border: 1px solid var(--hairline-strong); border-radius: 999px;
  background: rgb(13 20 27 / 0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.button:hover { border-color: var(--accent); box-shadow: 0 0 24px -6px var(--glow); }
.button--primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 500; }
.button--primary:hover { background: #8ce9f2; }

.facts {
  margin: 0 auto; width: 100%; max-width: var(--max); padding: 0 var(--gutter) 40px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.facts__item { border-top: 1px solid var(--hairline); padding: 14px 18px 0 0; }
.facts dt { font-family: var(--font-data); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); }
.facts dd { margin: 4px 0 0; color: var(--ink); font-size: 15px; font-weight: 400; }

/* Sections */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 10vw, 128px) var(--gutter) 0; }
.section--tight { padding-top: 32px; }
.section__title {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.06em;
  font-size: clamp(24px, 3.2vw, 36px); line-height: 1.25; margin-bottom: 28px;
}

.world { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.world__text p { max-width: 36em; }
.world__figure { margin: 0; padding: 10px; }
.world__figure img { border-radius: 8px; width: 100%; }
.world__figure figcaption { color: var(--ink-faint); padding: 12px 6px 4px; }

.rules__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.rules__list li { padding: 26px 24px 22px; font-size: 15px; line-height: 1.65; }
.rules__list strong { display: block; font-size: 17px; margin-bottom: 8px; }
.rules__n { display: block; color: var(--accent); margin-bottom: 18px; }

.factions__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.faction { padding: 28px 26px 22px; }
.faction__tag { color: var(--prism-violet); margin: 0 0 14px; }
.faction__name { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.5; margin-bottom: 14px; }
.faction__line { color: var(--ink); font-weight: 400; font-size: 15px; }
.faction__body { font-size: 15px; margin: 0; }

.latest { padding-bottom: 0; }
.latest__head { display: flex; justify-content: space-between; align-items: end; gap: 16px; }
.link-arrow { text-decoration: none; margin-bottom: 34px; white-space: nowrap; }
.link-arrow::after { content: " →"; }

/* Devlog lists */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.post-card { display: grid; grid-template-columns: 220px 1fr; column-gap: 32px; row-gap: 4px; padding: 24px 26px; text-decoration: none; transition: border-color .2s; }
.post-card:hover { border-color: var(--hairline-strong); }
.post-card__meta { grid-row: span 2; color: var(--ink-faint); display: flex; flex-direction: column; gap: 4px; }
.post-card__meta span { color: var(--accent); }
.post-card__title { color: var(--ink); font-size: 20px; font-weight: 400; }
.post-card__summary { color: var(--ink-muted); font-size: 15px; }
.post-list__empty { color: var(--ink-faint); }

.page-head { padding-top: clamp(140px, 16vw, 180px); }
.page-head__lede { max-width: 38em; font-size: 18px; }

/* Post */
.post { max-width: 760px; margin: 0 auto; padding: clamp(130px, 15vw, 170px) var(--gutter) 0; }
.post__title { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.05em; font-size: clamp(26px, 4vw, 40px); line-height: 1.25; margin-bottom: 20px; }
.post__summary { font-size: 19px; color: var(--ink); opacity: 0.86; }
.post__meta { color: var(--ink-faint); margin: 0; }
.post__cover { margin: 40px 0 8px; }
.post__cover img { border-radius: var(--radius); border: 1px solid var(--hairline); width: 100%; }
.post__cover figcaption { font-size: 13px; color: var(--ink-faint); margin-top: 10px; }

.prose { margin-top: 40px; }
.prose h2 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; font-size: 16px; margin: 2.6em 0 1em; }
.prose h3 { font-size: 18px; font-weight: 500; margin: 2em 0 .6em; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .6em; }
.prose li::marker { color: var(--accent); }
.prose img { border-radius: 10px; border: 1px solid var(--hairline); margin: 2em 0; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 1px solid var(--accent); color: var(--ink); }
.prose code { font-family: var(--font-data); font-size: .88em; background: var(--surface-raised); border: 1px solid var(--hairline); border-radius: 5px; padding: 1px 6px; }
.prose pre { background: var(--surface-sunk); border: 1px solid var(--hairline); border-radius: 10px; padding: 18px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 3em 0; }

.post__foot { margin-top: 64px; }
.pager { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--hairline); padding-top: 24px; }
.pager__link { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); max-width: 48%; }
.pager__link .data { color: var(--ink-faint); }
.pager__link--next { text-align: right; margin-left: auto; }

/* Footer */
.footer { margin-top: clamp(96px, 12vw, 160px); border-top: 1px solid var(--hairline); }
.footer__inner {
  max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter) 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; font-size: 14px;
}
.footer p { margin: 0; }
.footer__line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer__line .data { color: var(--ink); letter-spacing: 0.3em; font-family: var(--font-display); font-size: 11px; }
.footer__sep { width: 18px; height: 1px; background: var(--hairline-strong); }
.footer__links { display: flex; gap: 22px; color: var(--ink-faint); }
.footer__links a { color: var(--ink-muted); text-decoration: none; }
.footer__links a:hover { color: var(--ink); }

@keyframes drift { from { transform: scale(1.06); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__art img { animation: none; }
}

@media (max-width: 900px) {
  .world, .rules__list, .factions__grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); row-gap: 14px; }
  .post-card { grid-template-columns: 1fr; }
  .post-card__meta { grid-row: auto; flex-direction: row; gap: 14px; margin-bottom: 6px; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wordmark span { display: none; }
  .hero__veil { background: linear-gradient(180deg, rgb(7 12 18 / 0.35) 0%, rgb(7 12 18 / 0.75) 45%, var(--ground) 100%); }
  .hero__art img { object-position: 70% 30%; }
  .latest__head { flex-direction: column; align-items: start; gap: 0; }
  .link-arrow { margin-bottom: 20px; }
}
