/* =========================================================================
   Golden G. Richard III — site styles
   One stylesheet, shared by every page. Edit tokens in :root to retheme.
   ========================================================================= */

:root {
  /* palette */
  --paper:      #f5f2ea;   /* warm off-white background          */
  --paper-2:    #efebe0;   /* slightly deeper panel              */
  --ink:        #17161a;   /* near-black body text               */
  --ink-soft:   #4c4a52;   /* secondary text                     */
  --ink-faint:  #6f6c76;   /* captions, metadata                 */
  --accent:     #5a2e83;   /* deep aubergine (nods to old banner)*/
  --accent-2:   #3a1c57;   /* darker accent for hovers           */
  --line:       rgba(23,22,26,0.14);
  --line-soft:  rgba(23,22,26,0.08);

  /* type */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono:  "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* metrics */
  --measure: 70ch;
  --wrap: 1080px;
  --pad: clamp(1.2rem, 4vw, 3rem);
}

/* ---- reset-ish ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.02rem, 0.55vw + 0.9rem, 1.18rem);
  line-height: 1.62;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

/* subtle paper grain so the background isn't a flat fill */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: radial-gradient(rgba(0,0,0,0.025) 1px, transparent 1px);
  background-size: 3px 3px;
}

/* ---- layout ------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--pad); position: relative; z-index: 1; }
.measure { max-width: var(--measure); }

/* ---- masthead / nav ----------------------------------------------------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem 2rem; flex-wrap: wrap;
  padding-block: 0.85rem;
}
.brand {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.brand b { font-weight: 700; }
.brand span { color: var(--accent); }
nav.primary { display: flex; flex-wrap: wrap; gap: 0.15rem 0.25rem; }
nav.primary a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  position: relative;
}
nav.primary a:hover { color: var(--ink); background: var(--paper-2); }
nav.primary a[aria-current="page"] { color: var(--accent); }
nav.primary a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0.55rem; right: 0.55rem; bottom: 0.05rem;
  height: 2px; background: var(--accent);
}

/* ---- page header -------------------------------------------------------- */
.page-head { padding-block: clamp(2.4rem, 6vw, 4.5rem) clamp(1.4rem, 3vw, 2.2rem); }
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}
h1.title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.3rem, 3.0vw, 1.95rem);
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin: 0;
}
.lede { color: var(--ink-soft); font-size: 1.18em; max-width: 60ch; margin-top: 1.1rem; }

/* ---- generic content ---------------------------------------------------- */
main { padding-bottom: 5rem; }
.section { padding-block: clamp(1.5rem, 4vw, 2.6rem); border-top: 1px solid var(--line-soft); }
.section:first-of-type { border-top: 0; padding-top: 0.4rem; }
.section > h2 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1.1rem;
}
.prose p { margin: 0 0 1.1rem; }
.prose p:last-child { margin-bottom: 0; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul { padding-left: 1.1rem; margin: 0 0 1.1rem; }
.prose li { margin-bottom: 0.45rem; }

/* ---- buttons / pill links ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper); background: var(--accent);
  padding: 0.6rem 1.05rem; border-radius: 6px;
  text-decoration: none; transition: background 0.18s ease, transform 0.18s ease;
}
.btn:hover { background: var(--accent-2); color: var(--paper); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn--ghost:hover { background: var(--paper-2); color: var(--accent-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.4rem; }

/* ---- home hero ---------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(1.5rem, 4vw, 3.2rem); align-items: center;
        padding-block: clamp(2.4rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); }
.hero__img { position: relative; }
.hero__img img { width: 100%; border-radius: 8px; box-shadow: 0 18px 50px -22px rgba(40,20,60,0.55); }
.hero__img::after {
  content: ""; position: absolute; inset: 0; border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
  pointer-events: none;
}
.roles { list-style: none; padding: 0; margin: 1.6rem 0 0; }
.roles li { padding: 0.5rem 0; border-top: 1px solid var(--line-soft); line-height: 1.4; }
.roles li:first-child { border-top: 0; }
.roles .role-main { font-size: 1.08em; }
.creds { margin-top: 1.4rem; color: var(--ink-soft); font-size: 0.98em; }
.creds p { margin: 0.3rem 0; }

/* badges */
.badges { display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
          gap: 2.4rem; margin-top: 2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.badges img { height: 64px; width: auto; max-width: 180px; object-fit: contain;
              filter: saturate(0.95); transition: transform 0.2s ease, filter 0.2s ease; }
.badges a:hover img { transform: translateY(-2px); filter: saturate(1.1); }

/* ---- bio / contact ------------------------------------------------------ */
.factsheet dl { margin: 0; }
.factsheet dt {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-top: 1.4rem;
}
.factsheet dt:first-child { margin-top: 0; }
.factsheet dd { margin: 0.35rem 0 0; line-height: 1.5; }
.factsheet dd .muted { color: var(--ink-faint); }

/* ---- memorial ----------------------------------------------------------- */
.memorial-intro { text-align: center; color: var(--ink-faint); font-style: italic; margin-bottom: 2.5rem; }
.mem { max-width: 60ch; margin: 0 auto; }
.mem__entry { text-align: center; padding-block: 2.2rem; border-top: 1px solid var(--line-soft); }
.mem__entry:first-child { border-top: 0; }
.mem__flame { width: 26px; height: 40px; margin: 0 auto 1rem; }
.mem__name { font-size: 1.35rem; font-weight: 500; margin: 0 0 0.2rem; }
.mem__dates { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; color: var(--ink-faint); margin: 0 0 0.9rem; }
.mem__text { color: var(--ink-soft); font-style: italic; margin: 0; }
@keyframes flicker { 0%,100% { opacity: 1; transform: scaleY(1); } 50% { opacity: 0.85; transform: scaleY(0.94); } }
.mem__flame .flame { transform-origin: 50% 100%; animation: flicker 2.4s ease-in-out infinite; }

/* ---- publications ------------------------------------------------------- */
.pub-group { margin-bottom: 2.6rem; }
.pub-list { list-style: none; padding: 0; margin: 0; counter-reset: pub; }
.pub-list li {
  position: relative; padding: 0.85rem 0 0.85rem 2.6rem;
  border-top: 1px solid var(--line-soft); line-height: 1.45; font-size: 0.98em;
}
.pub-list li::before {
  counter-increment: pub; content: counter(pub);
  position: absolute; left: 0; top: 0.95rem;
  font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint);
}
.pub-list a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 2px; }
.pub-list .venue { color: var(--ink-soft); }
.award { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase;
         color: var(--accent); border: 1px solid var(--line); border-radius: 3px; padding: 0.05rem 0.35rem; margin-left: 0.3rem; white-space: nowrap; }

/* ---- gallery ------------------------------------------------------------ */
.gallery {
  display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  margin-top: 1.8rem;
}
.gallery button {
  all: unset; cursor: zoom-in; display: block; aspect-ratio: 4 / 3; overflow: hidden;
  background: var(--paper-2); border-radius: 4px;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease, filter 0.35s ease;
               filter: grayscale(0.15) contrast(1.02); }
.gallery button:hover img { transform: scale(1.06); filter: grayscale(0) contrast(1.05); }

/* lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; display: none; place-items: center;
            background: rgba(12,8,18,0.92); padding: 4vw; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 92vw; max-height: 82vh; width: auto; image-rendering: auto;
                box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8); border-radius: 4px; }
.lightbox__cap { position: fixed; bottom: 1.4rem; left: 0; right: 0; text-align: center;
                 font-family: var(--mono); font-size: 0.72rem; color: rgba(255,255,255,0.7); letter-spacing: 0.06em; }
.lightbox__btn { position: fixed; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer;
                 color: rgba(255,255,255,0.8); font-size: 2.4rem; padding: 1rem; line-height: 1; }
.lightbox__btn:hover { color: #fff; }
.lightbox__btn.prev { left: 1vw; } .lightbox__btn.next { right: 1vw; }
.lightbox__close { position: fixed; top: 1rem; right: 1.2rem; font-size: 1.6rem; }

/* ---- footer ------------------------------------------------------------- */
.site-foot { border-top: 1px solid var(--line); padding-block: 2.2rem 3rem; margin-top: 2rem; }
.site-foot__inner { display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; align-items: center; justify-content: space-between; }
.site-foot a, .site-foot span { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.03em; color: var(--ink-soft); }
.site-foot a:hover { color: var(--accent); }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }

/* decorative image used as a quiet divider */
.figband { margin: 2rem 0 0; }
.figband img { width: auto; max-width: 100%; border-radius: 6px; opacity: 0.9; }

/* ---- page-load reveal --------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(10px); animation: rise 0.7s cubic-bezier(.2,.7,.2,1) forwards; }
  .reveal:nth-child(2) { animation-delay: 0.06s; }
  .reveal:nth-child(3) { animation-delay: 0.12s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero__img { order: -1; max-width: 440px; }
}
@media (max-width: 560px) {
  .masthead__inner { gap: 0.5rem; }
  .brand { font-size: 0.74rem; white-space: normal; }
  nav.primary a { padding: 0.28rem 0.4rem; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}
