/* ============================================================
   Paul Staff — personal site
   Newsreader display serif · Archivo grotesque body.
   Cream paper · claret accent · photography-forward.
   ============================================================ */

:root {
  --paper:      #f5f1e8;
  --paper-deep: #ece6d8;
  --ink:        #211d18;
  --ink-soft:   #4f483d;
  --muted:      #908875;

  --claret:      #7d2630;   /* the accent — used in real doses */
  --claret-deep: #5e1c24;
  --claret-fg:   #f3e7d8;   /* text on claret */

  --hairline: rgba(33, 29, 24, 0.16);
  --rule:     rgba(33, 29, 24, 0.9);

  --display: "Newsreader", Georgia, serif;
  --sans:    "Archivo", system-ui, sans-serif;

  --gutter: clamp(1.4rem, 5vw, 6rem);
  --pad-l:  max(var(--gutter), 8.5rem);
  --measure: 36rem;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 380;
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.12rem);
  line-height: 1.66;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(115% 75% at 80% -10%, #fdfaf2 0%, transparent 55%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

em { font-style: italic; }

.link {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--claret), var(--claret));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.45s var(--ease), color 0.4s var(--ease);
  padding-bottom: 0.08em;
}
.link:hover { background-size: 100% 1.5px; color: var(--claret); }

/* ---------- shared section labels ---------- */
.folio {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.6rem, 2rem + 3vw, 4.6rem);
  line-height: 0.8;
  color: var(--claret);
  font-feature-settings: "lnum";
}
.section__label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.tick {
  width: 1.8rem;
  height: 2px;
  background: var(--claret);
  display: inline-block;
}

/* ============================================================ TOPBAR */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: clamp(1.3rem, 3vw, 2.2rem) var(--gutter);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 500;
}
.wordmark {
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.26em;
}
.topbar__contact { color: var(--muted); text-decoration: none; letter-spacing: 0.04em; transition: color 0.4s var(--ease); }
.topbar__contact:hover { color: var(--claret); }

/* ============================================================ INDEX NAV */
.index-nav {
  position: fixed;
  left: clamp(1.4rem, 2.6vw, 2.2rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
}
.index-nav ul { list-style: none; }
.index-nav li { margin: 0.5rem 0; }
.index-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}
.index-nav .num { letter-spacing: 0.05em; }
.index-nav .lbl {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.6rem;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  /* backdrop chip so a revealed label never collides illegibly with body text */
  padding: 0.28rem 0.5rem;
  border-radius: 3px;
  background: var(--paper);
  box-shadow: 0 4px 16px -6px rgba(33, 29, 24, 0.3);
  pointer-events: none;
}
.index-nav a:hover { color: var(--ink); }
/* label appears only on hover (not persistently on the active item, which used to overlap content) */
.index-nav a:hover .lbl { opacity: 1; transform: none; }
.index-nav a.is-active { color: var(--claret); }

/* ============================================================ HERO */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 8rem var(--gutter) 5rem var(--pad-l);
}
.hero__name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(4rem, 14vw, 12rem);
  line-height: 0.86;
  letter-spacing: -0.015em;
  margin: clamp(1.2rem, 3vw, 2rem) 0;
}
.hero__lead {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.3rem, 0.9rem + 1.6vw, 2.2rem);
  line-height: 1.32;
  max-width: 20ch;
  color: var(--ink-soft);
}
.hero__lead em { color: var(--claret); }
.cue {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: clamp(2rem, 5vw, 3.2rem);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.cue__arrow { transition: transform 0.4s var(--ease); color: var(--claret); }
.cue:hover .cue__arrow { transform: translateY(4px); }

/* portrait */
.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--paper-deep);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(33, 29, 24, 0.4);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; filter: contrast(1.02) saturate(1.02); }
.portrait__ph {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--muted);
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(125,38,48,0.04) 12px 24px),
    var(--paper-deep);
}
.portrait__ph small { font-weight: 400; letter-spacing: 0.06em; text-transform: none; font-size: 0.7rem; }
.portrait__ph code { font-family: ui-monospace, monospace; color: var(--claret); }
.portrait.is-empty .portrait__ph { display: flex; }

/* ============================================================ SECTIONS */
.section {
  padding: clamp(4.5rem, 11vh, 9rem) var(--gutter) clamp(4.5rem, 11vh, 9rem) var(--pad-l);
  border-top: 1px solid var(--hairline);
}
.section__head {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section__grid {
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.section__body > * + * { margin-top: 1.25rem; }

.section__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.6rem, 1.6rem + 4.5vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}
.lead-para {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.25rem, 1rem + 1.1vw, 1.7rem);
  line-height: 1.42;
  color: var(--ink);
}
.lead-para.narrow { max-width: 30ch; margin-bottom: clamp(2.4rem, 5vw, 3.6rem); }
.section p { color: var(--ink-soft); }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2.6rem;
  margin-top: 2.6rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--rule);
}
.meta dt {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.meta dd { font-size: 1rem; color: var(--ink); }

/* Seniorverse brand plate (deep-ink panel for the white-wordmark logo) */
.brandplate {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 3.8rem);
  background: radial-gradient(135% 120% at 50% 8%, #28241d 0%, #15130f 70%);
  overflow: hidden;
  box-shadow: 0 24px 50px -28px rgba(33, 29, 24, 0.5);
}
.brandplate img {
  width: 100%;
  max-width: 19rem;
  height: auto;
  display: block;
}

/* ---------- cards (02) ---------- */
.cards {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2.2rem);
}
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.8rem;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 44px -28px rgba(33, 29, 24, 0.45);
  border-color: var(--claret);
}
.card__mark {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.5rem;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--claret);
  background: rgba(125, 38, 48, 0.08);
}
.card__name { font-family: var(--display); font-weight: 500; font-size: 1.5rem; letter-spacing: -0.01em; }
.card__desc { font-size: 0.95rem; color: var(--muted); margin-top: 0.5rem; flex: 1 1 auto; }
.card__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}
.card__domain { color: var(--claret); text-transform: lowercase; letter-spacing: 0.02em; }
.card__arrow { display: inline-block; transition: transform 0.4s var(--ease); }
.card:hover .card__arrow { transform: translate(2px, -2px); }

/* ---------- timeline (03 / 04) ---------- */
.timeline { list-style: none; }
.entry {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 1.8rem 0;
  border-top: 1px solid var(--hairline);
}
.entry:last-child { border-bottom: 1px solid var(--hairline); }
.entry__years {
  font-family: var(--sans); font-weight: 600; font-size: 0.72rem;
  letter-spacing: 0.08em; color: var(--muted); padding-top: 0.5rem;
}
.entry__role {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.3rem, 1rem + 1vw, 1.7rem);
  letter-spacing: -0.01em; line-height: 1.2;
}
.entry__org { display: block; font-size: 0.95rem; font-style: italic; font-weight: 400; color: var(--claret); margin-top: 0.15rem; }
.entry__note { font-size: 0.95rem; color: var(--muted); margin-top: 0.6rem; }

/* ============================================================ CONTACT — claret block */
.contact {
  background: var(--claret);
  color: var(--claret-fg);
  padding: clamp(5rem, 13vh, 10rem) var(--gutter) clamp(4rem, 9vh, 7rem) var(--pad-l);
  position: relative;
  overflow: hidden;
}
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 60% at 90% 0%, rgba(255,255,255,0.08), transparent 60%);
  pointer-events: none;
}
.contact .folio { color: var(--claret-fg); }
.contact .section__label { color: rgba(243,231,216,0.6); display: block; margin-top: 1rem; }
.contact__lead {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.6rem, 1rem + 2.6vw, 3rem);
  line-height: 1.25; max-width: 18ch;
  margin-top: 1.6rem;
  color: var(--claret-fg);
}
.contact__email {
  display: inline-block;
  margin-top: 2rem;
  font-family: var(--display);
  font-size: clamp(1.6rem, 1rem + 3vw, 3.2rem);
  font-weight: 500; letter-spacing: -0.01em;
  color: var(--claret-fg); text-decoration: none;
  background-image: linear-gradient(var(--claret-fg), var(--claret-fg));
  background-size: 0% 1.5px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 0.5s var(--ease);
}
.contact__email:hover { background-size: 100% 1.5px; }
.contact__links {
  list-style: none; display: flex; gap: 2rem; margin-top: 2.6rem;
  font-family: var(--sans); font-weight: 500; font-size: 0.82rem; letter-spacing: 0.04em;
}
.contact__links .link { color: rgba(243,231,216,0.75); background-image: linear-gradient(var(--claret-fg), var(--claret-fg)); }
.contact__links .link:hover { color: var(--claret-fg); }
.colophon {
  margin-top: 3.5rem;
  font-family: var(--sans); font-weight: 600; font-size: 0.64rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: rgba(243,231,216,0.5);
}

/* ============================================================ BIO BUTTON + MODAL */
.hero__actions {
  display: flex;
  align-items: baseline;
  gap: clamp(1.4rem, 4vw, 2.4rem);
  flex-wrap: wrap;
  margin-top: clamp(2rem, 5vw, 3.2rem);
}
.hero__actions .cue { margin-top: 0; }
/* match the link's hover-underline gap so both sit on the same baseline */
.hero__actions .cue { padding-bottom: 0.2rem; }

.textlink {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0 0 0.2rem;
  cursor: pointer;
  transition: color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.textlink:hover { color: var(--claret); border-color: var(--claret); }
.bio-cta { margin-top: clamp(2rem, 5vw, 3rem); }

.modal {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--ink);
  max-width: 100vw;
}
.modal[open] {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: grid;
  place-items: center;
}
.modal::backdrop {
  background: rgba(21, 19, 15, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal__panel {
  position: relative;
  width: min(620px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--paper);
  padding: clamp(2.2rem, 5vw, 3.6rem);
  border-top: 4px solid var(--claret);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.55);
}
.modal[open] .modal__panel { animation: rise 0.5s var(--ease) both; }
.modal__close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.modal__close:hover { color: var(--claret); }
.modal__eyebrow {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}
.modal__title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem);
  letter-spacing: -0.01em;
  margin: 0.4rem 0 1.4rem;
}
.modal__body > * + * { margin-top: 1.1rem; }
.modal__body p { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.6; }
.modal__body p:first-child { color: var(--ink); }

/* ============================================================ MOTION */
.load { opacity: 0; transform: translateY(1.4rem); }
.is-loaded .load { animation: rise 1.1s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(2rem); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================ RESPONSIVE */

/* ---- Tablet, incl. iPad portrait (1024) & landscape (1080–1100) ----
   Drop the fixed index nav, return to gutter padding, keep the hero split
   but tame its scale, and stack the two-column content grids. */
@media (max-width: 1100px) {
  .index-nav { display: none; }
  .hero {
    gap: clamp(1.6rem, 4vw, 3rem);
    padding: clamp(6rem, 12vw, 8rem) var(--gutter) clamp(3rem, 8vw, 4.5rem);
  }
  .hero__name { font-size: clamp(3.5rem, 9vw, 6.5rem); }
  .hero__lead { font-size: clamp(1.3rem, 0.8rem + 1.6vw, 1.9rem); }
  .section { padding-left: var(--gutter); }
  .section__grid { grid-template-columns: 1fr; }
  .section__grid .brandplate { max-width: 30rem; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .contact { padding-left: var(--gutter); }
}

/* ---- Phone: stack the hero (text over portrait) ---- */
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
    gap: clamp(2rem, 7vw, 2.8rem);
  }
  .hero__text { order: 1; }
  .portrait { order: 2; width: 100%; max-width: 22rem; }
  .hero__name { font-size: clamp(3.6rem, 15vw, 6rem); }
}

@media (max-width: 620px) {
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar { padding: 1.2rem var(--gutter); font-size: 0.66rem; }
  .wordmark { letter-spacing: 0.18em; }
  .meta { gap: 1.8rem; }
  .contact__email { font-size: clamp(1.5rem, 8vw, 2.1rem); overflow-wrap: anywhere; }
  .contact__links { gap: 1.4rem; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .entry { grid-template-columns: 1fr; gap: 0.35rem; }
  .entry__years { padding-top: 0; }
}
@media (max-width: 380px) {
  .topbar__contact { display: none; }
}

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