/* Tales of the Deep: shared styles for every page.
   Colours live at the top so the whole look can be changed in one place. */

:root {
  --night: #0d1420;        /* page background, harbour at midnight */
  --night-2: #142033;      /* panels on the dark background */
  --ink: #23180f;          /* text on parchment */
  --parchment: #efe4cc;    /* cards */
  --parchment-2: #e4d5b5;  /* card edges, table stripes */
  --gold: #c9a35a;         /* rules, headings on dark */
  --gold-dim: #8a6f3c;
  --ember: #a2342a;        /* stamps, links on parchment */
  --tide: #3d6b8f;         /* accents */
  --mist: #b9c3cf;         /* body text on dark */
  --radius: 4px;
  --max: 980px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(61,107,143,.35), transparent 60%),
    var(--night);
  color: var(--mist);
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: #f0d08f; }

h1, h2, h3, .brand, nav a {
  font-family: "Cinzel", "Trajan Pro", Georgia, serif;
  letter-spacing: .04em;
}

/* ---------- Header and navigation ---------- */

.site-header {
  border-bottom: 1px solid rgba(201,163,90,.35);
  background: rgba(13,20,32,.85);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(6px);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; padding-top: .7rem; padding-bottom: .7rem;
}
.brand {
  color: var(--gold); text-decoration: none; font-size: 1.15rem; font-weight: 700;
  white-space: nowrap;
}
.brand span { color: var(--mist); font-weight: 400; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; }
nav a {
  color: var(--mist); text-decoration: none; font-size: .85rem; text-transform: uppercase;
  padding: .2rem 0; border-bottom: 1px solid transparent;
}
nav a:hover, nav a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: 16px; padding-right: 16px; }

main { padding: 2.5rem 0 4rem; }

/* ---------- Page titles ---------- */

.page-title { text-align: center; margin-bottom: 2.5rem; }
.page-title h1 { color: var(--gold); font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 .4rem; }
.page-title p { margin: 0 auto; max-width: 38rem; font-style: italic; }

.rule {
  display: flex; align-items: center; gap: .8rem; color: var(--gold-dim);
  margin: 1rem auto; max-width: 18rem;
}
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: currentColor; }

/* ---------- Home hero ---------- */

.hero { text-align: center; padding: 3rem 0 2rem; }
.hero .kicker {
  font-family: "Cinzel", serif; font-size: .8rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--tide);
}
.hero h1 {
  color: var(--gold); font-size: clamp(2.4rem, 8vw, 4.4rem); line-height: 1.05;
  margin: .4rem 0 .6rem; text-shadow: 0 2px 30px rgba(201,163,90,.25);
}
.hero .sub { font-size: 1.3rem; font-style: italic; max-width: 34rem; margin: 0 auto; }

/* ---------- Parchment cards ---------- */

.card {
  background: var(--parchment);
  background-image: linear-gradient(160deg, rgba(255,255,255,.35), transparent 40%),
                    linear-gradient(0deg, rgba(120,90,40,.08), transparent 30%);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  box-shadow: 0 0 0 1px var(--parchment-2), 0 10px 30px rgba(0,0,0,.45);
  position: relative;
}
.card + .card { margin-top: 1.6rem; }
.card h2, .card h3 { color: #4a2f17; margin-top: 0; }
.card a { color: var(--ember); }
.card .meta {
  font-family: "Cinzel", serif; font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: #7a5a35; margin: -.4rem 0 1rem;
}

.grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid .card + .card { margin-top: 0; }

/* ---------- The crew dossiers ---------- */

.dossier { padding-top: 2.2rem; }
.dossier .codename {
  font-family: "Cinzel", serif; font-size: 1.6rem; color: #4a2f17; margin: 0;
}
.dossier .alias { font-style: italic; color: #6b5134; margin: 0 0 .8rem; }
.dossier dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .9rem; margin: .8rem 0 0; font-size: 1rem; }
.dossier dt { font-family: "Cinzel", serif; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: #7a5a35; padding-top: .2rem; }
.dossier dd { margin: 0; }
.stamp {
  position: absolute; top: .9rem; right: 1rem;
  font-family: "Cinzel", serif; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ember); border: 2px solid var(--ember); padding: .15rem .5rem;
  transform: rotate(4deg); opacity: .8;
}

/* ---------- Journal ---------- */

.entry header { border-bottom: 1px solid var(--parchment-2); margin-bottom: 1rem; }
.entry h2 { margin-bottom: .3rem; }
.entry blockquote {
  margin: 1.2rem 0; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--gold-dim);
  font-style: italic; color: #4a3826;
}
.entry .tally { font-size: 1rem; background: rgba(120,90,40,.08); padding: .8rem 1rem; border-radius: var(--radius); }
.entry .tally h3 { font-size: .9rem; margin-bottom: .3rem; }
.entry .tally ul { margin: 0; padding-left: 1.2rem; }

.toc { list-style: none; padding: 0; margin: 0 0 2rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: center; }
.toc a { font-family: "Cinzel", serif; font-size: .9rem; }

/* ---------- People and places ---------- */

.section-head { color: var(--gold); font-size: 1.3rem; margin: 3rem 0 1rem; border-bottom: 1px solid rgba(201,163,90,.3); padding-bottom: .4rem; }
.section-head:first-of-type { margin-top: 0; }
.npc h3 { margin-bottom: .1rem; }
.npc .role { font-style: italic; color: #6b5134; margin: 0 0 .6rem; font-size: 1rem; }
.npc p { font-size: 1.02rem; margin: .4rem 0; }
.crest-row { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; }
.crest-row img { width: 110px; height: auto; flex: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.crest-row > div { flex: 1; min-width: 220px; }

/* ---------- Home page panels ---------- */

.panel-links { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 2.5rem; }
.panel-links a {
  display: block; text-decoration: none; padding: 1.2rem 1.3rem; border: 1px solid rgba(201,163,90,.35);
  border-radius: var(--radius); background: var(--night-2); color: var(--mist); transition: border-color .2s, transform .2s;
}
.panel-links a:hover { border-color: var(--gold); transform: translateY(-2px); }
.panel-links strong { display: block; font-family: "Cinzel", serif; color: var(--gold); font-size: 1.05rem; }
.panel-links span { font-size: 1rem; }

.latest { margin-top: 2.5rem; }

/* ---------- Footer ---------- */

footer { border-top: 1px solid rgba(201,163,90,.2); padding: 1.5rem 0 2.5rem; text-align: center; font-size: .95rem; color: #7d8794; }

@media (max-width: 560px) {
  body { font-size: 1.05rem; }
  .card { padding: 1.3rem 1.2rem; }
  .site-header { position: static; }
}

/* ---------- One-page sections ---------- */

section[id] { scroll-margin-top: 4.5rem; padding: 3.5rem 0 1rem; }
section[id] + section[id] { border-top: 1px solid rgba(201,163,90,.12); }
.hero { padding: 4rem 0 1rem; }

details.older { margin-top: 1.6rem; }
details.older > summary {
  cursor: pointer; font-family: "Cinzel", serif; color: var(--gold); text-align: center;
  list-style: none; padding: .6rem; border: 1px dashed rgba(201,163,90,.4); border-radius: var(--radius);
}
details.older > summary::-webkit-details-marker { display: none; }
details.older[open] > summary { margin-bottom: 1.6rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
