/* ── Kith — the village at dusk ──────────────────────────────────────────
   Warm light on cold ground. See DESIGN.md.
   Replaces site.css on index.html only; other pages still ride site.css
   until the Phase-2 propagation.
   ---------------------------------------------------------------------- */

:root {
  /* the evening */
  --nightfall: #091a21;
  --deepwater: #0e2229;
  --shoal: #142e36;
  --rope: #25454e;
  --rope-bright: #3a6472;

  /* the light */
  --lamplight: #d8b875;
  --brass: #b58a4a;

  /* voices */
  --mist: #dce8e4;
  --rain: #93a9a5;

  /* status — each one means one thing */
  --sage: #91b09e;
  --clay: #c1714a;
  --rust: #c4675e;
  --iris: #9299bd;
  --blurple: #5865f2;

  --serif: 'Vollkorn', Georgia, 'Times New Roman', serif;
  --sans: 'Alegreya Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Share Tech Mono', ui-monospace, 'Cascadia Mono', monospace;

  --paper: 3px;
  --chamfer: 8px;
  --max: 1120px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  --z-nav: 50;
  --z-lantern: 5;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--nightfall);
  color: var(--mist);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(216, 184, 117, .25); }

a { color: var(--lamplight); text-decoration: none; }
p { max-width: 65ch; text-wrap: pretty; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.012em;
  text-wrap: balance;
}

:focus-visible {
  outline: 2px solid var(--lamplight);
  outline-offset: 3px;
  border-radius: var(--paper);
}

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

/* the lantern you carry — warm light follows the cursor */
#lantern {
  position: fixed; inset: 0; z-index: var(--z-lantern);
  pointer-events: none;
  background: radial-gradient(420px circle at var(--lx, -100px) var(--ly, -100px),
    rgba(216, 184, 117, .07), rgba(181, 138, 74, .03) 45%, transparent 70%);
}
@media (hover: none), (pointer: coarse) { #lantern { display: none; } }

/* ── nav: a hairline, not a slab ── */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 16px 24px;
  background: rgba(9, 26, 33, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rope);
}
.brand {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--serif); font-size: 23px; font-weight: 700;
  color: var(--mist); letter-spacing: -.01em;
}
.brand .flame { color: var(--lamplight); }
.brand small {
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  color: var(--rain); text-transform: uppercase;
}
.nav-links { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.nav-links a {
  color: var(--rain); font-size: 16px; font-weight: 500;
  transition: color .2s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current] { color: var(--lamplight); }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: 16px; font-weight: 700;
  padding: 13px 24px; border: none; border-radius: var(--paper);
  cursor: pointer; text-align: center;
  transition: background .2s var(--ease), box-shadow .25s var(--ease), color .2s var(--ease);
}
.btn-lamp { background: var(--lamplight); color: var(--nightfall); }
.btn-lamp:hover { background: var(--brass); box-shadow: 0 0 26px rgba(216, 184, 117, .3); }
.btn-discord { background: var(--blurple); color: #fff; }
.btn-discord:hover { box-shadow: 0 0 26px rgba(88, 101, 242, .4); }
.btn-quiet {
  background: transparent; color: var(--mist);
  box-shadow: inset 0 -1px 0 0 var(--rope-bright);
}
.btn-quiet:hover { color: var(--lamplight); box-shadow: inset 0 -1px 0 0 var(--lamplight); }
.btn-sm { padding: 9px 16px; font-size: 15px; }

/* ── hero: you're on the road, the town is over there ── */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: flex; align-items: center;
  border-bottom: 1px solid var(--rope);
}
#village {
  position: absolute; inset: 0;
  display: block; width: 100%; height: 100%;
  background: linear-gradient(180deg, #06111a, #12303a);
}
/* keeps the left legible without smothering the town on the right */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg,
    rgba(9, 26, 33, .94) 0%,
    rgba(9, 26, 33, .82) 30%,
    rgba(9, 26, 33, .28) 50%,
    transparent 62%);
}
.hero-copy { position: relative; z-index: 2; width: 100%; padding: 48px 0; }
.hero h1 {
  font-size: clamp(2.25rem, 5.2vw, 4rem);
  letter-spacing: -.02em;
  max-width: 14ch;
}
.hero .lede {
  margin-top: 20px; font-size: 19px; color: var(--mist);
  max-width: 42ch;
}
.hero .lede b { color: var(--lamplight); font-weight: 700; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 32px; }

/* the founding: the state of the place, said plainly */
.founding {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 13px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--lamplight);
  margin-bottom: 22px;
}

/* the census — a mono readout, because a machine counted it */
/* author display:flex beats the UA stylesheet's [hidden] {display:none} — say it explicitly
   or the "…" placeholders leak out whenever there is no census to show */
.census[hidden], .census span[hidden], .founding[hidden] { display: none; }
.census {
  display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 34px;
  font-family: var(--mono); font-size: 13px; letter-spacing: .1em;
  color: var(--rain);
}
.census b { color: var(--lamplight); font-weight: 400; }
.census .lit {
  display: inline-block; width: 8px; height: 8px; margin-right: 7px;
  background: var(--lamplight); vertical-align: 1px;
  box-shadow: 0 0 9px rgba(216, 184, 117, .8);
}

/* ── sections ── */
section { padding: 88px 0; }
section + section { border-top: 1px solid var(--rope); }
.sec-head { margin-bottom: 40px; }
.sec-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
.sec-head p { margin-top: 14px; color: var(--rain); font-size: 18px; }

/* ── who's here ── */
.folk { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--rope); border: 1px solid var(--rope); }
.folk-cell { background: var(--deepwater); padding: 26px 24px; transition: background .25s var(--ease); }
.folk-cell:hover { background: var(--shoal); }
.folk-cell .n {
  font-family: var(--mono); font-size: 26px; color: var(--lamplight);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.folk-cell h3 { font-family: var(--sans); font-size: 18px; font-weight: 700; margin-top: 12px; letter-spacing: 0; }
.folk-cell p { margin-top: 6px; color: var(--rain); font-size: 16px; }

/* ── districts ── */
.districts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.lot {
  --accent: var(--lamplight);
  background: var(--deepwater);
  border: 1px solid var(--rope);
  border-radius: 0;
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% 100%, 0 100%, 0 var(--chamfer));
  padding: 26px 28px;
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.lot:hover { border-color: var(--accent); background: var(--shoal); }
.lot h3 { font-family: var(--sans); font-size: 19px; font-weight: 700; letter-spacing: 0; color: var(--accent); }
.lot .role { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--rain); margin-top: 4px; text-transform: uppercase; }
.lot ul { list-style: none; margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.lot li { display: flex; flex-direction: column; gap: 1px; }
.lot li a { color: var(--mist); font-size: 16px; font-weight: 500; transition: color .18s var(--ease); }
.lot li a:hover { color: var(--accent); }
.lot .gloss { color: var(--rain); font-size: 15px; line-height: 1.4; }
.lot-foundry   { --accent: var(--sage); }
.lot-shipyard  { --accent: var(--lamplight); }
.lot-outfitter { --accent: var(--iris); }
.lot-exchange  { --accent: var(--brass); }
.lot-board     { --accent: var(--mist); }
.lot-tailor    { --accent: #ec9fcf; }

/* ── under construction ── */
.building { display: flex; flex-direction: column; gap: 26px; max-width: 70ch; }
.build-row { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: baseline; }
.tag {
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; padding: 3px 9px; white-space: nowrap;
  border: 1px solid currentColor;
}
.tag-live { color: var(--sage); }
.tag-building { color: var(--clay); }
.build-row h3 { font-family: var(--sans); font-size: 18px; font-weight: 700; letter-spacing: 0; }
.build-row p { color: var(--rain); font-size: 16px; margin-top: 4px; }

/* ── the close ── */
.close { text-align: left; }
.close h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); max-width: 18ch; }
.close p { margin-top: 16px; font-size: 18px; color: var(--rain); }
.close .hero-actions { margin-top: 30px; }

footer {
  border-top: 1px solid var(--rope);
  padding: 40px 0 56px;
  color: var(--rain);
}
footer .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
footer .fine { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; }
footer a { color: var(--rain); }
footer a:hover { color: var(--lamplight); }

/* narrow: the town can't share the frame with the words, so it goes above them */
@media (max-width: 900px) {
  .hero { display: block; min-height: 0; }
  #village { position: relative; height: 340px; }
  .hero::after {
    /* barely there — on a phone the town has nothing to compete with, so let it be seen */
    background: linear-gradient(180deg, transparent 0%, transparent 55%, rgba(9, 26, 33, .35) 80%, var(--nightfall) 100%);
    inset: 0 0 auto; height: 340px;
  }
  .hero-copy { padding: 32px 0 64px; }
  .hero h1, .hero .lede { max-width: 100%; }
}

/* phone: the nav was wrapping into three rows of rubble. Brand + the one action. */
@media (max-width: 620px) {
  section { padding: 64px 0; }
  .nav { padding: 12px 18px; }
  .brand { font-size: 21px; }
  .brand small { display: none; }
  .nav-links a:not(.btn) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  #lantern { display: none; }
}
