/* ===========================================================================
   Josh Ginsburg — personal site
   Palette: D "Bone & Oxblood".  Type: Newsreader / Public Sans / IBM Plex Mono.
   Every themable value lives here in :root. Nothing below this block
   hard-codes a color — if you need a new one, add a token first.
   =========================================================================== */

:root {
  --bg:          #FBFAF8;
  --bg-tint:     #F2EFEA;
  --surface:     #FFFFFF;
  --ink:         #1A1614;
  --ink-soft:    #524B46;
  /* Spec value was #9C948D, which lands at 2.9:1 on --bg and fails WCAG AA.
     Darkened to #716960, which clears AA (4.5:1) on all three surfaces —
     --bg 5.17, --bg-tint 4.70, --surface 5.40. It carries eyebrows and small
     mono labels, so it has to pass as normal text, not just large text. */
  --ink-faint:   #716960;
  --line:        #E5E0D9;
  --accent:      #7A2231;
  --accent-soft: #F6E5E7;
  /* Text that sits ON an accent fill. 10.00:1 here, 5.44:1 in dark. */
  --on-accent:   #FFFFFF;

  --shadow:      0 1px 2px rgba(26, 22, 20, .04), 0 4px 16px rgba(26, 22, 20, .05);
  --shadow-lift: 0 2px 4px rgba(26, 22, 20, .06), 0 14px 34px rgba(26, 22, 20, .10);

  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body:    "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius:    4px;   /* sharp — palette D is meant to read classic, not friendly */
  --container: 1080px;

  /* One easing curve and three durations for the entire site. */
  --ease:   cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms;
  --t:      320ms;
  --t-slow: 640ms;

  --marquee-duration: 46s;  /* CSS is the source of truth; JS reads this back */
}

[data-theme="dark"] {
  --bg:          #12100F;
  --bg-tint:     #1A1715;
  --surface:     #201C1A;
  --ink:         #F1EDE8;
  --ink-soft:    #C0B7B0;
  --ink-faint:   #918882;   /* AA on all three dark surfaces: 5.46 / 5.14 / 4.87 */
  --line:        #302A27;
  --accent:      #D2657A;
  /* Spec value #351A1F gave 4.48:1 against --accent. Darkened to clear AA. */
  --accent-soft: #2C1418;
  --on-accent:   #17090C;
  /* A brand logo needs a light backdrop to read in dark theme, whatever the
     theme's own surfaces are — this one stays white on purpose. */
  --logo-chip:   #FFFFFF;

  --shadow:      0 1px 2px rgba(0, 0, 0, .34), 0 4px 16px rgba(0, 0, 0, .30);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .40), 0 14px 34px rgba(0, 0, 0, .46);
}

/* ---------- base ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Sticky header is 68px tall; keep anchor targets clear of it. */
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;   /* the hero wash bleeds past the viewport by design */
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}

img { max-width: 100%; display: block; }
a  { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

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

::selection { background: var(--accent-soft); color: var(--accent); }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  background: var(--accent); color: var(--on-accent);
  padding: .6rem 1rem; border-radius: var(--radius);
  font-family: var(--font-mono); font-size: .8rem;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ---------- section scaffolding ------------------------------------------ */

.section { padding-block: clamp(4.5rem, 9vw, 7.5rem); }
.section--tint { background: var(--bg-tint); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 .9rem;
}
.eyebrow--num { color: var(--accent); }

.section-title {
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  max-width: 22ch;
}
.section-head { margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }
.section-head .lede {
  color: var(--ink-soft);
  max-width: 56ch;
  margin-top: 1.1rem;
}
.section-head--center { text-align: center; }
.section-head--center .section-title { margin-inline: auto; }
.section-head--center .lede { margin-inline: auto; }

/* ---------- buttons ------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .78rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: .95rem; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--solid   { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); }
.btn--solid:hover { box-shadow: var(--shadow-lift); }

.btn--outline { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }

.btn--ghost   { color: var(--ink-soft); }
.btn--ghost:hover { color: var(--accent); background: var(--accent-soft); }

.btn--lg { padding: .95rem 1.6rem; font-size: 1.0125rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ===========================================================================
   HEADER
   =========================================================================== */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 1.25rem;
  height: 68px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.28rem; font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}
.wordmark .dot { color: var(--accent); }

.nav { display: flex; align-items: center; gap: .35rem; }
.nav a {
  padding: .45rem .7rem;
  font-size: .9rem;
  text-decoration: none;
  color: var(--ink-soft);
  border-radius: var(--radius);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--bg-tint); }
.nav a.nav-cta {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 500;
}
.nav a.nav-cta:hover { background: var(--accent); color: var(--on-accent); }

/* language switch — renders with a single active entry today; adding pt.html
   or es.html later is a copy-paste of one <a> plus an hreflang line in <head>. */
.lang {
  display: flex; align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  background: var(--surface);
}
.lang a, .lang span {
  font-family: var(--font-mono);
  font-size: .68rem; font-weight: 500; letter-spacing: .07em;
  padding: .25rem .55rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-faint);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.lang a:hover { color: var(--ink); }
.lang .is-current { background: var(--accent); color: var(--on-accent); }

.theme-toggle {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform var(--t) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.theme-toggle:hover { transform: rotate(12deg); color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; }
/* Only one glyph is ever in the DOM flow — swapped by [data-theme]. */
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.hamburger {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  position: relative;
}
.hamburger span {
  position: absolute; left: 9px; width: 16px; height: 1.5px;
  background: var(--ink);
  transition: transform var(--t) var(--ease), opacity var(--t-fast) var(--ease);
}
.hamburger span:nth-child(1) { top: 13px; }
.hamburger span:nth-child(2) { top: 17.5px; }
.hamburger span:nth-child(3) { top: 22px; }
.site-header.open .hamburger span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.site-header.open .hamburger span:nth-child(2) { opacity: 0; }
.site-header.open .hamburger span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

/* ===========================================================================
   HERO
   =========================================================================== */

.hero {
  position: relative;
  overflow: hidden;              /* keeps the wash from creating x-scroll */
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(4rem, 8vw, 6.5rem);
}

/* Two soft blobs of --accent-soft, masked so they dissolve before the
   marquee strip starts. Purely decorative, so aria-hidden in the markup. */
.hero-wash {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(46rem 30rem at 12% 8%,  var(--accent-soft), transparent 62%),
    radial-gradient(38rem 26rem at 88% 34%, var(--accent-soft), transparent 60%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 42%, transparent 96%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 42%, transparent 96%);
  opacity: .78;
}
[data-theme="dark"] .hero-wash { opacity: .6; }

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  letter-spacing: -0.035em;
  margin: 0 0 1.15rem;
}

.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  line-height: 1.42;
  color: var(--ink-soft);
  max-width: 30ch;
  margin: 0 0 1.25rem;
}
.hero-sub strong {
  color: var(--ink);
  font-weight: 500;
}
.hero-role {
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 1.9rem;
}

.hero .btn-row { margin-bottom: 1.9rem; }

.tag-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tag {
  font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-faint);
  background: var(--surface);
}

/* ---------- portrait ------------------------------------------------------ */

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: 340px;
  width: 100%;
  margin-left: auto;
}
/* The 2px accent frame sits behind the photo, offset down-and-right.
   Negative right/bottom + positive top/left is what produces the offset. */
.portrait::after {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  z-index: 0;
}
.portrait img,
.portrait .monogram {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}
.portrait img { object-fit: cover; object-position: 50% 22%; }

/* Shown only when the photo is missing or fails to decode — the page must
   never render a broken-image glyph. */
.portrait .monogram { display: none; }
.portrait.img-fail img { display: none; }
.portrait.img-fail .monogram {
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent-soft), var(--bg-tint) 72%);
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--accent);
}

/* ===========================================================================
   MARQUEE  ("Where I've worked & served")
   =========================================================================== */

.marquee-section {
  background: var(--surface);
  border-block: 1px solid var(--line);
  padding-block: 2.25rem;
  overflow: hidden;
}
.marquee-label {
  text-align: center;
  font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.6rem;
}

.marquee {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
/* The track holds TWO identical logo sets. The animation translates exactly
   -50% (one full set), so at the moment it snaps back to 0 the second set is
   sitting where the first was — the seam is invisible. Duplicating the set is
   what makes that possible; one set would show a gap. */
.marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: marquee-scroll var(--marquee-duration) linear infinite;
  will-change: transform;
}
@keyframes marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
/* JS drives the track with rAF for drift-free wrapping; when it takes over it
   sets .js-driven and the keyframe animation steps aside. Without JS the
   keyframes above are the working fallback. */
.marquee-track.js-driven { animation: none; }
.marquee:hover .marquee-track { animation-play-state: paused; }

.logo-set { display: flex; align-items: center; }

.logo {
  display: flex; align-items: center; justify-content: flex-start;
  gap: .85rem;
  height: 52px;
  padding-inline: clamp(1.5rem, 3.4vw, 2.75rem);
  flex: 0 0 auto;
  opacity: 1;
  filter: none;
  transition: opacity var(--t) var(--ease), filter var(--t) var(--ease),
              transform var(--t) var(--ease);
}
.logo img {
  width: 64px;
  height: 44px;
  flex: 0 0 64px;
  object-fit: contain;
}
/* Text fallback. It is what renders until real logo files land in
   images/logos/, so it is styled to stand on its own, not to look broken. */
.logo-text {
  display: block;
  font-family: var(--font-body);
  font-size: .98rem;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--ink);
}
.logo.img-fail img { display: none; }
[data-theme="dark"] .logo-text { color: var(--ink); }

/* Hover state and the touch .is-active state are written out separately on
   purpose: :hover never fires on a touchscreen, and a shared rule would make
   hybrid laptops sticky. JS decides which applies at event time. */
.marquee .logo:hover { transform: scale(1.03); }
.marquee .logo.is-active { transform: scale(1.03); }

/* In dark theme a grayscale-inverted mark reads, but original brand color on a
   near-black strip does not — so the hovered logo gets a light chip to sit on. */
/* Grayscale at 55% reads fine on bone; on near-black it goes too faint to
   read, so the dark theme rests a little brighter. */
[data-theme="dark"] .logo { opacity: 1; }
[data-theme="dark"] .logo img {
  filter: none;
  background: var(--logo-chip);
  padding: 4px 7px;
  border-radius: 3px;
}
[data-theme="dark"] .marquee .logo:hover img,
[data-theme="dark"] .marquee .logo.is-active img {
  filter: none;
  background: var(--logo-chip);
  padding: 5px 9px;
  border-radius: 3px;
}

/* ===========================================================================
   ABOUT
   =========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}
.about-prose p { max-width: 62ch; }
/* First paragraph carries full ink, the rest step back — a quiet emphasis
   gradient that gives the column a reading order without a pull-quote. */
.about-prose p:first-child {
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1.6;
}
.about-prose p + p { color: var(--ink-soft); }

.facts {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fact {
  padding: 1.05rem 1.35rem;
  border-bottom: 1px solid var(--line);
}
.fact:last-child { border-bottom: 0; }
.fact dt {
  font-family: var(--font-mono);
  font-size: .68rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .3rem;
}
.fact dd {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--ink);
}

/* The facts card travels with the reader — but only where that is safe.
   Two conditions, and both matter: the layout must actually be two-column
   (below 901px the card is stacked and sticky would be nonsense), AND the
   viewport must be tall enough to show the whole card. A sticky element
   taller than the viewport pins its own bottom off-screen and the reader
   never sees the last rows, so short windows opt out entirely. */
@media (min-width: 901px) and (min-height: 760px) {
  .facts { position: sticky; top: 100px; }
}

/* ===========================================================================
   EXPERIENCE — vertical timeline
   =========================================================================== */

.timeline { position: relative; }
/* The rail. It fades from accent at the top into --line so the eye starts at
   the current role and the older entries recede. */
.timeline::before {
  content: "";
  position: absolute;
  left: 136px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(to bottom, var(--accent), var(--line) 38%);
}

.entry {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 2.5rem;
  padding-bottom: 2.25rem;
}
.entry:last-child { padding-bottom: 0; }

.entry-date {
  text-align: right;
  font-family: var(--font-mono);
  font-size: .78rem;
  line-height: 1.5;
  letter-spacing: .02em;
  color: var(--ink-faint);
  padding-top: 1.4rem;
}
.entry-date .now { color: var(--accent); }

.entry-body { position: relative; }
/* Hollow accent-ringed dot, centred on the rail. */
.entry-body::before {
  content: "";
  position: absolute;
  left: -21px; top: 1.75rem;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.section--tint .entry-body::before { background: var(--bg-tint); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.65rem;
  box-shadow: var(--shadow);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease),
              border-color var(--t) var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.entry-role {
  font-size: 1.22rem;
  margin-bottom: .3rem;
}
.entry-role .at { color: var(--accent); }

.entry-meta {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .05em;
  color: var(--ink-faint);
  margin-bottom: .95rem;
}

.entry-body ul {
  margin: 0; padding-left: 1.15rem;
  display: grid; gap: .5rem;
}
.entry-body li {
  color: var(--ink-soft);
  font-size: .98rem;
  line-height: 1.6;
}
.entry-body li::marker { color: var(--accent); }

/* "Early Roles" groups the pre-professional work into one prose block instead
   of bullets — it shows range without giving a takeout job the same visual
   weight as an internship. */
.card--early {
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 58%);
}
.card--early p { color: var(--ink-soft); font-size: .98rem; }

/* ===========================================================================
   INVOLVEMENT — 3-up card grid
   =========================================================================== */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.pcard {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.35rem;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease),
              border-color var(--t) var(--ease);
}
/* Only the <a> variant lifts. Cards that don't link out are <div>s and stay
   put, so the hover affordance always means "this goes somewhere". */
a.pcard:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
}

.pcard-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.1rem;
}
.pill {
  font-family: var(--font-mono);
  font-size: .66rem; font-weight: 500;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: .28rem .6rem;
  border-radius: var(--radius);
}
.arrow {
  color: var(--ink-faint);
  flex: 0 0 auto;
  transition: transform var(--t) var(--ease), color var(--t) var(--ease);
}
.arrow svg { width: 16px; height: 16px; display: block; }
a.pcard:hover .arrow { transform: translate(3px, -3px); color: var(--accent); }

.pcard h3 { font-size: 1.3rem; margin-bottom: .6rem; }
.pcard p  { color: var(--ink-soft); font-size: .95rem; margin-bottom: 1.35rem; }
.pcard-link {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .06em;
  color: var(--ink-faint);
}
a.pcard:hover .pcard-link { color: var(--accent); }

/* ===========================================================================
   SERVICE & LEADERSHIP — 2x2
   =========================================================================== */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.scard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.65rem;
  box-shadow: var(--shadow);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease),
              border-color var(--t) var(--ease);
}
.scard:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}
/* Mixing numeric stats with word stats ("Director", "Fellow") is deliberate —
   an all-numeric row would read like a metrics dashboard, which is the wrong
   register for volunteering. */
.scard .stat {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 2.75rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin-bottom: .75rem;
}
.scard h3 { font-size: 1.18rem; margin-bottom: .45rem; }
.scard p  { color: var(--ink-soft); font-size: .95rem; }

/* ===========================================================================
   SKILLS & CERTIFICATIONS
   =========================================================================== */

.skill-group h3 {
  font-size: 1.15rem;
  padding-bottom: .7rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.chip {
  font-size: .875rem;
  padding: .4rem .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink-soft);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
/* Certifications are a different class of thing from self-declared skills,
   so they get the filled treatment rather than the outlined one. */
.chip--cert {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}
.chip--cert:hover { border-color: var(--accent); }
.cert-list {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}
.cert-list .chip--cert {
  width: 100%;
  padding: .65rem .75rem;
}
.credential-link {
  display: grid;
  gap: .2rem;
  color: inherit;
  text-decoration: none;
}
.credential-link strong {
  color: var(--ink);
  font-size: .82rem;
  line-height: 1.3;
}
.credential-meta {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: .64rem;
  line-height: 1.4;
}
.credential-proof {
  margin-top: .18rem;
  color: var(--accent);
  font-weight: 600;
  font-size: .72rem;
}

/* ===========================================================================
   CONTACT
   =========================================================================== */

.contact {
  position: relative;
  overflow: hidden;
  text-align: center;
}
.contact::before {
  content: "";
  position: absolute;
  left: 50%; bottom: -18rem;
  width: min(52rem, 130vw); height: 34rem;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--accent-soft), transparent 74%);
  pointer-events: none;
}
[data-theme="dark"] .contact::before { opacity: .7; }
.contact .inner { position: relative; max-width: 960px; margin-inline: auto; }
.contact h2 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 1.1rem; }
.contact p  { color: var(--ink-soft); max-width: 640px; margin: 0 auto 2rem; }
.contact .btn-row { justify-content: center; flex-wrap: nowrap; }
.contact .btn { flex: 1 1 0; justify-content: center; min-height: 5.25rem; }

/* ===========================================================================
   FOOTER
   =========================================================================== */

.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: .75rem;
  align-items: center; justify-content: space-between;
  padding-block: 1.75rem;
  font-size: .85rem;
  color: var(--ink-faint);
}
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }

/* ===========================================================================
   MOTION — reveals and load-in
   =========================================================================== */

/* Scoped under .js (set by the inline head script) so that with JS disabled
   nothing is hidden and the page reads as plain, complete HTML. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

.js .hero-anim {
  opacity: 0;
  animation: rise-in var(--t-slow) var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

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

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .js .hero-anim { opacity: 1; animation: none; }
  .btn:hover, .card:hover, a.pcard:hover, .scard:hover,
  .chip:hover, .theme-toggle:hover { transform: none; }

  /* The strip stops being a marquee altogether: a static, centred, wrapped
     row with no mask and no motion. */
  .marquee { -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .marquee-track {
    animation: none !important;
    transform: none !important;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }
  .marquee-track .logo-set[aria-hidden="true"] { display: none; }
  .logo-set { flex-wrap: wrap; justify-content: center; }
  .logo { padding-block: .6rem; }
}

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

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait { margin-inline: 0; max-width: 290px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Below 900px the timeline drops the date column: a single left rail with the
   date sitting above each card. */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .timeline::before { left: 5px; }
  .entry { grid-template-columns: 1fr; gap: 0; padding-left: 1.9rem; }
  .entry-date { text-align: left; padding-top: 0; margin-bottom: .5rem; }
  .entry-body::before { top: .35rem; left: -1.9rem; }
}

@media (max-width: 760px) {
  .nav {
    display: none;
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: .5rem 1.5rem 1.25rem;
    box-shadow: var(--shadow-lift);
  }
  .site-header.open .nav { display: flex; }
  .nav a { padding: .8rem .25rem; font-size: 1rem; border-radius: 0; }
  .nav a.nav-cta { margin-top: .5rem; padding-inline: .8rem; text-align: center; }
  .hamburger { display: block; }
  .header-inner { position: relative; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .contact .btn-row { flex-direction: column; align-items: stretch; }
  .contact .btn { flex: none; justify-content: center; }
}

@media (max-width: 420px) {
  .lang { display: none; }   /* single-language today; reclaim the header room */
  .btn { padding: .72rem 1.1rem; font-size: .9rem; }
  .card, .pcard, .scard { padding: 1.25rem 1.15rem; }
}
