/* The Last Words Archive - black & gold archival microsite
   Aesthetic: warm near-black, single gold accent, high-contrast serif for voice.
   Dials: VARIANCE 6 / MOTION 4 / DENSITY 3. */

:root {
  --bg:        #0c0a07;   /* warm near-black */
  --bg-raise:  #131009;   /* card / panel */
  --bg-raise2: #181308;
  --ink:       #ece3d0;   /* warm off-white */
  --ink-soft:  #b8ad95;
  --ink-mute:  #8a8068;
  --gold:      #c8a24a;
  --gold-hi:   #e7cd86;
  --gold-deep: #7d6228;
  --line:      rgba(200,162,74,0.22);
  --line-soft: rgba(200,162,74,0.12);
  --maxw: 1240px;
  --serif: "Cormorant Garamond", "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* archival grain - fixed, never on scrolling containers */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* faint gold vignette glow at top */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(200,162,74,0.10), transparent 55%),
    radial-gradient(80% 60% at 50% 120%, rgba(200,162,74,0.05), transparent 60%);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(12,10,7,0.92), rgba(12,10,7,0.55));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.nav .mark {
  font-family: var(--sans);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--ink);
}
.nav .mark b { color: var(--gold); font-weight: 700; }
.nav .right { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); }

/* ---------- hero ---------- */
.hero {
  min-height: calc(100dvh - 64px);
  display: flex; flex-direction: column; justify-content: center;
  padding: 64px 0 56px;
  position: relative;
}
.hero .rule-top { width: 56px; height: 1px; background: var(--gold); margin-bottom: 28px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.4rem, 11vw, 8.6rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  margin: 14px 0 0;
  color: var(--ink);
}
.hero h1 .it { font-style: italic; color: var(--gold-hi); }
.hero .sub {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 30ch;
  margin: 30px 0 0;
}
.hero .cta-row { margin-top: 38px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--bg); background: var(--gold);
  padding: 14px 26px; border-radius: 2px;
  border: 1px solid var(--gold);
  transition: transform .25s cubic-bezier(.16,1,.3,1), background .25s, box-shadow .25s;
}
.btn:hover { background: var(--gold-hi); box-shadow: 0 10px 30px rgba(200,162,74,0.22); }
.btn:active { transform: translateY(1px); }
.hero .scrolllink { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); border-bottom: 1px solid var(--line); padding-bottom: 4px; transition: color .25s, border-color .25s; }
.hero .scrolllink:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- intro / dedication ---------- */
.intro { padding: 70px 0; border-top: 1px solid var(--line-soft); }
.intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.intro .lead {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.4; color: var(--ink);
}
.intro .lead .gold { color: var(--gold-hi); font-style: italic; }
.intro .body p { color: var(--ink-soft); max-width: 60ch; margin: 0 0 16px; }
.intro .stats { display: flex; gap: 40px; margin-top: 30px; flex-wrap: wrap; }
.intro .stat .n { font-family: var(--serif); font-size: 2.6rem; line-height: 1; color: var(--gold); }
.intro .stat .l { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-mute); margin-top: 8px; }

/* ---------- controls ---------- */
.controls {
  position: sticky; top: 64px; z-index: 30;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 18px 0;
  background: linear-gradient(180deg, rgba(12,10,7,0.96), rgba(12,10,7,0.85));
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.search {
  flex: 1 1 280px; display: flex; align-items: center; gap: 10px;
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: 2px; padding: 11px 14px;
}
.search input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--ink); font-family: var(--sans); font-size: 14px; letter-spacing: 0.02em;
}
.search input::placeholder { color: var(--ink-mute); }
.search svg { width: 16px; height: 16px; stroke: var(--gold); flex: none; }
.filters { display: flex; gap: 8px; }
.chip {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 16px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: var(--gold); border-color: var(--gold); }
.chip.active { color: var(--bg); background: var(--gold); border-color: var(--gold); }

/* ---------- archive grid ---------- */
.archive { padding: 46px 0 90px; }
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}
.card {
  position: relative;
  background: var(--bg-raise);
  padding: 30px 28px 26px;
  cursor: pointer;
  min-height: 300px;
  display: flex; flex-direction: column;
  transition: background .3s, transform .3s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: 0;
  border: 1px solid transparent; pointer-events: none;
  transition: border-color .3s;
}
.card:hover { background: var(--bg-raise2); }
.card:hover::after { border-color: var(--line); }
.card .idx {
  font-family: var(--serif); font-size: 13px; letter-spacing: 0.1em;
  color: var(--gold-deep);
}
.card .top { display: flex; justify-content: space-between; align-items: baseline; }
.card .tier {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-mute);
}
.card .name {
  font-family: var(--serif); font-weight: 500;
  font-size: 2rem; line-height: 1.02; letter-spacing: -0.01em;
  margin: 20px 0 6px; color: var(--ink);
}
.card .role {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 18px;
}
.card .quote {
  font-family: var(--serif); font-style: italic;
  font-size: 1.18rem; line-height: 1.4; color: var(--ink-soft);
  margin: auto 0 0;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.card .quote::before { content: "\201C"; color: var(--gold); }
.card .quote::after { content: "\201D"; color: var(--gold); }
.card .open {
  margin-top: 18px; font-family: var(--sans);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-mute); display: flex; align-items: center; gap: 8px;
  transition: color .25s, gap .25s;
}
.card:hover .open { color: var(--gold); gap: 12px; }

.noresult { padding: 60px 0; text-align: center; color: var(--ink-mute); font-family: var(--serif); font-size: 1.4rem; font-style: italic; }

/* reveal */
.card { opacity: 1; }
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }

/* ---------- modal ---------- */
.modal-bg {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(6,5,3,0.78);
  backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 6vh 24px 24px;
  opacity: 0; visibility: hidden;
  transition: opacity .35s, visibility .35s;
  overflow-y: auto;
}
.modal-bg.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 760px;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  box-shadow: 0 40px 120px rgba(0,0,0,0.6);
  transform: translateY(18px); transition: transform .4s cubic-bezier(.16,1,.3,1);
  position: relative;
}
.modal-bg.open .modal { transform: none; }
.modal .head { padding: 40px 44px 28px; border-bottom: 1px solid var(--line-soft); position: relative; }
.modal .m-idx { font-family: var(--serif); color: var(--gold-deep); font-size: 14px; letter-spacing: 0.1em; }
.modal .m-name { font-family: var(--serif); font-weight: 500; font-size: clamp(2.4rem,5vw,3.4rem); line-height: 1; margin: 14px 0 8px; }
.modal .m-role { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.modal .m-bio { color: var(--ink-soft); margin: 22px 0 0; max-width: 62ch; font-size: 15px; }
.close {
  position: absolute; top: 26px; right: 28px;
  width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
  cursor: pointer; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, border-color .2s, transform .2s;
}
.close:hover { color: var(--gold); border-color: var(--gold); transform: rotate(90deg); }
.modal .body { padding: 14px 44px 40px; }

.block-label {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-mute);
  margin: 34px 0 18px; display: flex; align-items: center; gap: 14px;
}
.block-label::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.sig { border-left: 2px solid var(--gold); padding: 4px 0 4px 22px; margin: 0 0 26px; }
.sig.legacy { background: linear-gradient(90deg, rgba(200,162,74,0.07), transparent); padding: 16px 20px 16px 22px; }
.sig .q { font-size: 12px; letter-spacing: 0.04em; color: var(--gold); text-transform: uppercase; margin-bottom: 10px; }
.sig .a { font-family: var(--serif); font-size: 1.5rem; line-height: 1.42; color: var(--ink); }
.sig.legacy .tag { display:inline-block; font-family: var(--sans); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-hi); border:1px solid var(--line); padding: 4px 9px; border-radius: 999px; margin-bottom: 12px; }

.others li {
  font-family: var(--serif); font-size: 1.28rem; line-height: 1.42; color: var(--ink-soft);
  list-style: none; padding: 16px 0; border-bottom: 1px solid var(--line-soft);
}
.others li::before { content: "\201C"; color: var(--gold); }
.others li::after { content: "\201D"; color: var(--gold); }
.others { margin: 0; padding: 0; }

.watch {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 30px;
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--line); padding: 13px 22px; border-radius: 2px;
  transition: background .25s, color .25s;
}
.watch:hover { background: var(--gold); color: var(--bg); }
.watch svg { width: 16px; height: 16px; }

.m-note { margin-top: 26px; font-size: 12px; line-height: 1.6; color: var(--ink-mute); border-top: 1px solid var(--line-soft); padding-top: 16px; }
.m-note b { color: var(--ink-soft); font-weight: 600; }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 80px 0 60px; position: relative; }
.foot .ded { font-family: var(--serif); font-size: clamp(1.6rem,3vw,2.4rem); line-height: 1.34; max-width: 24ch; color: var(--ink); }
.foot .ded .gold { color: var(--gold-hi); font-style: italic; }
.foot .by { margin-top: 44px; display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.foot .sig-by .k { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 10px; }
.foot .sig-by .who { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); }
.foot .links { display: flex; gap: 26px; flex-wrap: wrap; }
.foot .links a { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1px solid var(--line); padding-bottom: 5px; transition: color .25s, border-color .25s; }
.foot .links a:hover { color: var(--gold); border-color: var(--gold); }
.foot .fine { margin-top: 50px; font-size: 11px; letter-spacing: 0.08em; color: var(--ink-mute); line-height: 1.7; max-width: 70ch; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .intro-grid { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(3rem, 16vw, 4.4rem); }
  .modal .head { padding: 34px 24px 24px; }
  .modal .body { padding: 10px 24px 32px; }
  .controls { top: 64px; }
  .nav .right { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.in { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { transition: none !important; }
}
