/*
 * Clash Front — public site theme.
 *
 * "The war council in daylight": the dominion strategy layer of the
 * EtherFantasy realm, styled in the EF family (EB Garamond display + Inter
 * body — self-hosted) on a parchment-white map-room ground. Ink text, EF
 * gold accents, wax-seal crimson on war prompts, cold steel blue on hostile
 * intel. Diagrams stay on dark insets — framed maps on a light table.
 *
 * No build step. No external requests (fonts are vendored in /assets/fonts).
 * No frameworks. One CSS file, one JS file, static HTML.
 */

@font-face {
  font-family: "EB Garamond";
  src: url("/assets/fonts/EBGaramond.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/Inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg:        #f6f2ea;
  --bg-2:      #efe9dd;
  --panel:     #fffdf8;
  --panel-2:   #f7f1e4;
  --panel-3:   #efe6d4;
  --line:      #e4dbc8;
  --line-2:    #d2c5a9;
  --ink:       #2a2419;
  --ink-dim:   #6e6353;
  --ink-faint: #a1937d;
  --ink-bright:#16120b;
  --gold:      #a67617;
  --gold-dim:  #d3b878;
  --rust:      #9a4a25;
  --blood:     #8f1d1d;
  --fire:      #c2410c;
  --ok:        #3f7d3f;
  --bad:       #b03430;
  --cold:      #33567f;
  --accent:    #2f5fa8;
  --radius:    8px;
  --shadow:    0 12px 34px rgba(97, 74, 27, 0.10), 0 2px 6px rgba(97, 74, 27, 0.06);
  --shadow-in: inset 0 0 0 rgba(0,0,0,0);
  --font:      15.5px/1.6 "Inter", -apple-system, system-ui, sans-serif;
  --mono:      13px/1.5 ui-monospace, "Cascadia Mono", Menlo, monospace;
  --serif:     "EB Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 700px at 50% -240px, #fdfbf5 0%, transparent 55%),
    radial-gradient(900px 640px at 92% 100%, #f0e8d6 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; border-bottom: 1px dotted var(--gold-dim); }
a:hover { color: #7d5809; border-bottom-color: currentColor; }
code, kbd { font: var(--mono); background: var(--panel-2); padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--line); color: var(--ink-bright); }
hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }

/* ── Layout skeleton ─────────────────────────────────────────────────────── */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* ── Header / nav ────────────────────────────────────────────────────────── */
header.site {
  position: sticky; top: 0; z-index: 20;
  background: rgba(252, 250, 244, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
header.site .wrap { display: flex; align-items: center; gap: 22px; height: 60px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--ink-bright);
  font-size: 19px;
  text-transform: uppercase;
  border-bottom: 0;
}
.brand img { height: 34px; width: 34px; object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(166,118,23,0.35)); }
.brand:hover { color: var(--gold); }
.brand span { color: var(--ink-faint); font-weight: 400; letter-spacing: 1.5px; margin-left: 2px; font-size: 13px; }
nav.primary {
  display: flex; align-items: center; gap: 3px; margin-left: auto;
  flex-wrap: wrap;
}
nav.primary a {
  color: var(--ink-dim);
  padding: 6px 11px;
  border-radius: 6px;
  border: 0;
  font-size: 14px;
  letter-spacing: 0.2px;
  font-weight: 500;
}
nav.primary a:hover { color: var(--ink-bright); background: var(--panel-2); }
nav.primary a.active { color: var(--gold); background: var(--panel-2); }
.nav-toggle { display: none; }

/* Currently-building ribbon (top of site — dev-status transparency). */
.dev-ribbon {
  background: linear-gradient(90deg, rgba(166,118,23,0.12), rgba(166,118,23,0.02) 70%);
  border-bottom: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 12.5px;
  padding: 6px 0;
  letter-spacing: 0.3px;
}
.dev-ribbon .wrap { display: flex; gap: 10px; align-items: center; }
.dev-ribbon strong { color: var(--gold); }

/* ── Hero (home) ─────────────────────────────────────────────────────────── */
.hero {
  padding: 88px 0 64px;
  border-bottom: 1px solid var(--line);
  background:
    url("/assets/img/ef-logo-512.png") no-repeat right 6% center / 340px auto,
    radial-gradient(1000px 520px at 12% 0%, rgba(166,118,23,0.09), transparent 60%),
    radial-gradient(760px 520px at 92% 30%, rgba(51,86,127,0.07), transparent 60%);
}
.hero h1 {
  font-family: var(--serif);
  font-size: 60px;
  line-height: 1.04;
  margin: 0 0 18px;
  color: var(--ink-bright);
  letter-spacing: -0.5px;
}
.hero h1 em { color: var(--gold); font-style: normal; }
.hero .tag {
  font-size: 20px;
  color: var(--ink-dim);
  max-width: 640px;
  margin: 0 0 30px;
  line-height: 1.5;
}
.hero .pitch { color: var(--ink); font-size: 16px; max-width: 660px; }
.hero .cta { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  color: var(--ink-bright);
  background: var(--panel);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.4px;
  transition: border-color .15s, color .15s, box-shadow .15s;
  border-bottom: 1px solid var(--line-2);
  box-shadow: 0 1px 3px rgba(97,74,27,0.08);
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn.primary {
  background: linear-gradient(180deg, #e2b84e, #c39428);
  border-color: #a67617;
  color: #241a06;
  text-shadow: 0 1px 0 rgba(255,255,255,0.25);
}
.btn.primary:hover { border-color: #7d5809; color: #16120b; box-shadow: 0 4px 14px rgba(166,118,23,0.30); }

/* ── Page titles ─────────────────────────────────────────────────────────── */
.page-head { padding: 56px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.page-head .eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.page-head h1 {
  font-family: var(--serif);
  font-size: 44px;
  margin: 0 0 12px;
  color: var(--ink-bright);
  letter-spacing: -0.3px;
}
.page-head p.lede { color: var(--ink-dim); font-size: 18px; max-width: 720px; margin: 0; line-height: 1.5; }

/* ── Cards & sections ────────────────────────────────────────────────────── */
main { padding-bottom: 80px; }
section.slab { padding: 42px 0; border-bottom: 1px solid var(--line); }
section.slab:last-child { border-bottom: 0; }
section.slab h2 {
  font-family: var(--serif);
  font-size: 30px;
  color: var(--ink-bright);
  margin: 0 0 16px;
  letter-spacing: -0.2px;
}
section.slab h3 {
  color: var(--ink-bright);
  font-size: 17px;
  margin: 22px 0 6px;
  letter-spacing: 0.2px;
}
section.slab p { color: var(--ink); margin: 0 0 12px; }
section.slab p.dim { color: var(--ink-dim); }
section.slab ul { padding-left: 20px; color: var(--ink); }
section.slab ul li { margin: 5px 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin: 22px 0;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}
.card:hover { border-color: var(--line-2); box-shadow: 0 16px 40px rgba(97,74,27,0.14); }
.card.pillar {
  border-top: 3px solid var(--gold-dim);
}
.card.pillar:hover { border-top-color: var(--gold); }
.card h3 { margin: 0 0 8px; color: var(--ink-bright); font-size: 18px; font-family: var(--serif); font-weight: 700; letter-spacing: 0; }
.card p { color: var(--ink-dim); margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; }
.card .foot { margin-top: 14px; font-size: 13px; }
.card .foot a { color: var(--gold); }

.card.status-done   { border-left: 3px solid var(--ok); }
.card.status-build  { border-left: 3px solid var(--gold); }
.card.status-later  { border-left: 3px solid var(--line-2); opacity: 0.9; }

.tag-chip {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  color: var(--ink-dim);
  margin-right: 6px;
  vertical-align: 2px;
  background: var(--panel);
}
.tag-chip.gold { color: var(--gold); border-color: var(--gold-dim); background: rgba(166,118,23,0.06); }
.tag-chip.ok   { color: var(--ok);   border-color: #a8c7a8; background: rgba(63,125,63,0.06); }
.tag-chip.warn { color: var(--fire); border-color: #e0b39a; background: rgba(194,65,12,0.06); }
.tag-chip.cold { color: var(--cold); border-color: #a9bdd6; background: rgba(51,86,127,0.06); }

/* Tables (rules, matrices) */
.tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.tbl th, .tbl td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.tbl th {
  background: var(--panel-2);
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 12px;
  border-bottom-color: var(--line-2);
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(166,118,23,0.045); }
.tbl-scroll { overflow-x: auto; margin: 18px 0 24px; }
.tbl-scroll .tbl { margin: 0; }

/* Quote / rule blocks */
.rule {
  border-left: 3px solid var(--gold);
  padding: 10px 16px;
  background: rgba(166,118,23,0.06);
  color: var(--ink);
  margin: 18px 0;
  font-size: 14.5px;
  border-radius: 0 6px 6px 0;
}
.rule strong { color: var(--gold); }
.spoiler {
  border-left: 3px solid var(--blood);
  padding: 10px 16px;
  background: rgba(143,29,29,0.05);
  color: var(--ink);
  margin: 18px 0;
  font-size: 14.5px;
  font-style: italic;
  border-radius: 0 6px 6px 0;
}

/* Two-col split (mobile: stacks) */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin: 20px 0; }

/* Diagrams (inline SVG) — framed dark map insets on the light table, so any
   diagram authored for the dark theme stays legible unchanged. */
.diagram {
  background: #141a22;
  border: 1px solid #2a3646;
  border-radius: var(--radius);
  padding: 18px;
  margin: 20px 0;
  overflow-x: auto;
  color: #cfd8e3;
  box-shadow: var(--shadow);
}
.diagram svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.diagram .caption { color: #7d8a99; font-size: 12.5px; text-align: center; margin-top: 8px; font-style: italic; }

/* Portrait strips */
.portraits { display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 12px; margin: 12px 0; }
.portrait {
  min-width: 110px; text-align: center; font-size: 12.5px; color: var(--ink-dim);
}
.portrait img {
  width: 96px; height: 96px; border-radius: 50%;
  border: 2px solid var(--gold-dim); background: var(--panel-2);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(97,74,27,0.15);
}
.portrait .name { color: var(--ink-bright); font-weight: 600; margin-top: 6px; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer.site {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 34px 0 44px;
  color: var(--ink-faint);
  font-size: 13px;
  margin-top: 60px;
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 26px; align-items: center; }
footer.site a { color: var(--ink-dim); border-bottom: 0; }
footer.site a:hover { color: var(--gold); }
footer.site .foot-brand { font-family: var(--serif); letter-spacing: 2px; color: var(--gold); text-transform: uppercase; font-weight: 700; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .hero { padding: 60px 0 40px; background-image:
    radial-gradient(1000px 520px at 12% 0%, rgba(166,118,23,0.09), transparent 60%),
    radial-gradient(760px 520px at 92% 30%, rgba(51,86,127,0.07), transparent 60%); }
  .hero h1 { font-size: 42px; }
  .hero .tag { font-size: 17px; }
  .page-head { padding: 36px 0 16px; }
  .page-head h1 { font-size: 32px; }
  .split { grid-template-columns: 1fr; }
  .nav-toggle {
    display: inline-block;
    margin-left: auto;
    color: var(--ink-dim);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font: inherit;
  }
  nav.primary {
    position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--panel); border-bottom: 1px solid var(--line);
    padding: 10px 16px; gap: 0; margin: 0;
    display: none;
    box-shadow: var(--shadow);
  }
  nav.primary.open { display: flex; }
  nav.primary a { padding: 10px 12px; border-bottom: 1px solid var(--line); border-radius: 0; }
  nav.primary a:last-child { border-bottom: 0; }
}

/* Nav play CTA — the door into the game (login → map) */
nav.primary a.play-cta {
  color: #241a06;
  background: linear-gradient(180deg, #e2b84e, #c39428);
  border: 1px solid #a67617;
  font-weight: 700;
  margin-left: 6px;
}
nav.primary a.play-cta:hover { color: #16120b; background: linear-gradient(180deg, #eac35e, #cb9d30); }

/* "From the war table" — live-build screenshot gallery */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 22px 0 6px; }
figure.shot {
  margin: 0; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
figure.shot.feature { grid-column: 1 / -1; }
.shot a { border-bottom: 0; display: block; }
.shot img { width: 100%; height: auto; display: block; }
.shot figcaption { padding: 12px 16px 14px; font-size: 13.5px; color: var(--ink-dim); line-height: 1.5; }
.shot figcaption strong { color: var(--ink-bright); }
@media (max-width: 780px) { .gallery { grid-template-columns: 1fr; } }
