/* The Gathered Dawn — site styles.
   The look is taken from the game itself: Pixelify Sans (the in-game font), the framed
   night-blue panels with a pale rim, gold headers, and parchment for the world map. */

@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/PixelifySans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/alegreya-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/alegreya-sans-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/alegreya-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("../fonts/alegreya-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* From the game's UiStyle */
  --panel: #212a3d;
  --panel-deep: #171d2c;
  --slot: #121724;
  --rim: #a8bfe0;
  --rim-soft: rgba(168, 191, 224, 0.35);
  --gold: #ffd152;
  --header: #fad67a;
  --text: #f5f2e6;
  --text-dim: #c3cbe0;
  /* Dawn sky */
  --night: #1b1f3d;
  --dusk: #4a3d6e;
  --ember: #c9707a;
  --horizon: #f4bf74;
  /* Parchment */
  --parchment: #efe3c4;
  --parchment-edge: #d9c69a;
  --ink: #3b2a1b;
  --ink-soft: #6b5440;
  /* Beacons */
  --lit: #ffd152;
  --unlit: #5b5677;

  --pixel: "Pixelify Sans", ui-monospace, monospace;
  --body: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  /* The page is a sunrise: night at the top, dawn light by the footer. */
  background: linear-gradient(180deg, var(--night) 0%, #232448 35%, var(--dusk) 78%, #7a4f72 92%, #b9707a 100%);
  background-color: var(--night);
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--header); text-underline-offset: 3px; }
a:hover { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4 {
  font-family: var(--pixel);
  font-weight: 600;
  line-height: 1.15;
  color: var(--header);
  margin: 0 0 0.5em;
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; max-width: 68ch; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 16px; z-index: 50; background: var(--panel); padding: 8px 12px; }

/* ---------------------------------------------------------------- framed panel (the game's look) */
.frame {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--rim);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 rgba(4, 6, 14, 0.75);
  overflow: hidden;
}
.frame::before { /* the soft shine on the top half of every in-game panel */
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  background: rgba(255, 255, 255, 0.035);
  pointer-events: none;
}
.frame > * { position: relative; }

/* ---------------------------------------------------------------- header + tabs */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 0;
  background: linear-gradient(180deg, rgba(27, 31, 61, 0.96), rgba(27, 31, 61, 0.82));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rim-soft);
}
.site-head .wrap { display: flex; align-items: center; gap: 20px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--pixel); font-weight: 700; font-size: 1.3rem;
  color: var(--header); text-decoration: none; white-space: nowrap;
}
.brand img { width: 30px; height: 30px; image-rendering: pixelated; }
.tabs { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
/* Styled like the inventory tabs: framed pills, gold rim on the open one. */
.tabs a {
  font-family: var(--pixel);
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--panel);
  border: 2px solid var(--rim-soft);
  transition: border-color 0.15s, color 0.15s;
}
.tabs a:hover { border-color: var(--rim); color: var(--header); }
.tabs a[aria-current="page"] { border-color: var(--gold); color: var(--gold); background: #2a3046; }
.menu-btn {
  display: none; margin-left: auto;
  font-family: var(--pixel); font-size: 1rem; color: var(--text);
  background: var(--panel); border: 2px solid var(--rim); border-radius: 10px; padding: 6px 12px;
}

@media (max-width: 900px) {
  .menu-btn { display: block; }
  .tabs { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 12px 16px 16px;
    background: rgba(27, 31, 61, 0.98); border-bottom: 1px solid var(--rim-soft); flex-direction: column; }
  .tabs.open { display: flex; }
  .tabs a { text-align: left; }
}

/* ---------------------------------------------------------------- page header (inner pages) */
.page-head { padding: 64px 0 28px; }
.page-head p { color: var(--text-dim); font-size: 1.25rem; }

/* ---------------------------------------------------------------- home hero */
.hero {
  position: relative;
  min-height: min(88vh, 860px);
  display: grid;
  align-items: end;
  overflow: hidden;
}
.hero-shot {
  position: absolute; inset: 0 0 0 auto;
  width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%;
}
.hero::after { /* dawn sky melting into the screenshot */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(27, 31, 61, 0.88) 0%, rgba(27, 31, 61, 0.55) 34%, rgba(27, 31, 61, 0) 58%),
    linear-gradient(180deg, rgba(27, 31, 61, 0.85) 0%, rgba(74, 61, 110, 0.3) 30%, rgba(244, 191, 116, 0.0) 50%),
    linear-gradient(0deg, rgba(27, 31, 61, 1) 0%, rgba(27, 31, 61, 0.55) 18%, rgba(27, 31, 61, 0) 42%);
}
.hero .wrap { position: relative; z-index: 1; padding: 0 0 56px; }
/* The title is drawn like the in-game region banner: gold with a dark pixel outline. */
.title {
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 0.95;
  color: var(--gold);
  margin: 0 0 18px;
  text-shadow:
    3px 0 0 #2a1c10, -3px 0 0 #2a1c10, 0 3px 0 #2a1c10, 0 -3px 0 #2a1c10,
    3px 3px 0 #2a1c10, -3px 3px 0 #2a1c10, 3px -3px 0 #2a1c10, -3px -3px 0 #2a1c10,
    0 8px 0 rgba(10, 8, 20, 0.55);
}
.title span { display: block; }
.lede { font-size: clamp(1.2rem, 2.2vw, 1.5rem); max-width: 34ch; text-shadow: 0 2px 8px rgba(10, 10, 30, 0.8); }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--pixel); font-size: 1rem;
  padding: 8px 14px; margin-top: 8px;
}
.status .dot { width: 10px; height: 10px; border-radius: 2px; background: var(--lit); box-shadow: 0 0 10px var(--lit); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.btn {
  display: inline-block;
  font-family: var(--pixel); font-size: 1.1rem; font-weight: 600;
  padding: 10px 20px; border-radius: 12px;
  text-decoration: none;
  border: 2px solid var(--rim);
  background: var(--panel); color: var(--text);
  box-shadow: 0 4px 0 rgba(4, 6, 14, 0.75);
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(4, 6, 14, 0.75); }
.btn.gold { background: var(--gold); color: #2a1c10; border-color: #fff1bf; }
.btn.gold:hover { background: #ffe08a; color: #2a1c10; }

/* ---------------------------------------------------------------- sections */
.section { padding: 72px 0; }
.section-tight { padding: 40px 0; }
.intro { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.intro p { color: var(--text-dim); }
@media (min-width: 1100px) {
  .hero-shot { width: 84%; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24%); mask-image: linear-gradient(90deg, transparent 0, #000 24%); }
}
@media (max-width: 860px) { .intro { grid-template-columns: 1fr; gap: 28px; } }

/* Three things you do, each a framed screenshot "card" with a caption plate */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pillar img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; border-bottom: 2px solid var(--rim-soft); }
.pillar .cap { padding: 16px 18px 18px; }
.pillar p { color: var(--text-dim); font-size: 1.05rem; margin: 0; }
@media (max-width: 860px) { .pillars { grid-template-columns: 1fr; } }

.shot { border-radius: var(--radius); border: 2px solid var(--rim); box-shadow: 0 4px 0 rgba(4, 6, 14, 0.75); }

/* Feature rows alternate image side */
.feature { display: grid; grid-template-columns: 1.25fr 1fr; gap: 44px; align-items: center; padding: 44px 0; }
.feature:nth-child(even) .feature-img { order: 2; }
.feature ul { padding-left: 1.1em; color: var(--text-dim); margin: 0; }
.feature li { margin-bottom: 0.35em; }
.feature li::marker { color: var(--gold); content: "◆  "; font-size: 0.8em; }
.feature p { color: var(--text-dim); }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: 20px; padding: 28px 0; }
  .feature:nth-child(even) .feature-img { order: 0; }
}

/* Region tiers: coloured like the region banner tiers in game */
.tiers { display: grid; gap: 8px; margin-top: 14px; }
.tier { display: grid; grid-template-columns: 9.5rem 1fr; gap: 14px; align-items: baseline; padding: 10px 14px; }
.tier b { font-family: var(--pixel); font-weight: 600; }
.tier span { color: var(--text-dim); font-size: 1rem; }
@media (max-width: 560px) { .tier { grid-template-columns: 1fr; gap: 2px; } }

/* ---------------------------------------------------------------- parchment (world & lore) */
.parchment {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(ellipse at 90% 90%, rgba(150, 110, 60, 0.18), transparent 55%),
    var(--parchment);
  color: var(--ink);
  border-radius: 6px;
  border: 2px solid var(--parchment-edge);
  box-shadow: 0 6px 0 rgba(20, 12, 6, 0.45), inset 0 0 60px rgba(120, 85, 40, 0.25);
  padding: clamp(24px, 5vw, 56px);
}
.parchment h2, .parchment h3 { color: var(--ink); }
.parchment p { color: var(--ink); font-size: 1.15rem; line-height: 1.7; }
.parchment .quote { font-style: italic; font-size: 1.3rem; border-left: 4px solid var(--ink-soft); padding-left: 18px; }

.gods { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-top: 18px; }
.god { padding: 18px; border: 2px solid var(--parchment-edge); border-radius: 6px; background: rgba(255, 250, 235, 0.45); }
.god h3 { margin-bottom: 2px; }
.god .domain { font-family: var(--pixel); color: var(--ink-soft); font-size: 1rem; margin-bottom: 8px; }
.god p { font-size: 1.05rem; margin: 0; }
.sigil { width: 40px; height: 40px; margin-bottom: 10px; image-rendering: pixelated; }

/* ---------------------------------------------------------------- media gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.gallery button {
  padding: 0; border: 0; background: none; cursor: zoom-in; text-align: left; color: inherit;
  border-radius: var(--radius);
}
.gallery figure { margin: 0; }
.gallery img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; border-bottom: 2px solid var(--rim-soft); }
.gallery figcaption { padding: 10px 14px 12px; font-size: 1rem; color: var(--text-dim); }
.gallery button:hover .frame { border-color: var(--gold); }

dialog.lightbox {
  padding: 0; border: 2px solid var(--rim); border-radius: var(--radius);
  background: var(--panel-deep); color: var(--text);
  max-width: min(1600px, 94vw); width: auto;
}
dialog.lightbox::backdrop { background: rgba(10, 10, 25, 0.85); }
dialog.lightbox img { max-height: 80vh; width: auto; margin: 0 auto; }
dialog.lightbox .bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; }
dialog.lightbox .bar p { margin: 0; color: var(--text-dim); }
dialog.lightbox button { font-family: var(--pixel); font-size: 1rem; color: var(--text); background: var(--panel);
  border: 2px solid var(--rim); border-radius: 10px; padding: 6px 12px; cursor: pointer; }

/* ---------------------------------------------------------------- roadmap: a trail of beacons */
.trail { list-style: none; margin: 0; padding: 0; position: relative; }
.trail::before { /* the dashed route between beacons, like the glide ring on the map */
  content: ""; position: absolute; left: 27px; top: 20px; bottom: 20px;
  border-left: 3px dashed var(--rim-soft);
}
.trail li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 18px; padding: 10px 0 22px; }
.beacon { width: 56px; height: 56px; display: grid; place-items: center; }
.beacon img { width: 34px; height: 44px; image-rendering: pixelated; }
.trail .lit .beacon img { filter: drop-shadow(0 0 10px rgba(255, 209, 82, 0.85)); }
.trail .next .beacon img { filter: drop-shadow(0 0 8px rgba(168, 191, 224, 0.6)); }
.trail .card { padding: 16px 20px; }
.trail .card h3 { margin-bottom: 6px; }
.trail .state { font-family: var(--pixel); font-size: 0.95rem; color: var(--gold); margin-bottom: 4px; }
.trail .unlit .state { color: var(--text-dim); }
.trail .next .state { color: var(--rim); }
.trail .card p { color: var(--text-dim); margin: 0; font-size: 1.05rem; }
.trail .unlit .card { background: rgba(33, 42, 61, 0.6); border-color: var(--rim-soft); }

/* ---------------------------------------------------------------- FAQ */
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq details { padding: 0; }
.faq summary {
  cursor: pointer; list-style: none;
  font-family: var(--pixel); font-size: 1.2rem; color: var(--header);
  padding: 16px 52px 16px 20px; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; color: var(--gold);
}
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 20px 18px; color: var(--text-dim); }
.faq .answer p { margin-bottom: 0.7em; }

/* ---------------------------------------------------------------- devlog */
.posts { display: grid; gap: 26px; max-width: 900px; }
.post { padding: 0; }
.post img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; border-bottom: 2px solid var(--rim-soft); }
.post .body { padding: 20px 24px 22px; }
.post time { font-family: var(--pixel); color: var(--rim); font-size: 1rem; }
.post h2 { font-size: 1.6rem; margin-top: 4px; }
.post p, .post li { color: var(--text-dim); }
.post ul { padding-left: 1.2em; margin: 0 0 0.6em; }

/* ---------------------------------------------------------------- footer */
.site-foot { padding: 64px 0 40px; color: #ffe9cf; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: center; }
.site-foot p { margin: 0; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-foot a { color: #fff3dc; }
.horizon-line { height: 3px; background: linear-gradient(90deg, transparent, var(--horizon), transparent); opacity: 0.8; }
