/* ==========================================================================
   Ryan Gilbert — portfolio styles
   Colors and spacing all live in the :root block below. Change them there.
   ========================================================================== */

/* -------------------------------------------------------------- WEBFONTS */
/* Self-hosted so the site works offline and on any host. Both are variable
   fonts — one file covers every weight from 300 to 800.                     */

@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/ebgaramond.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("assets/fonts/ebgaramond-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("assets/fonts/jost.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("assets/fonts/jost-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Palette — dark green ground, cream type, coffee accent.
     Change these six greens to reshade the whole site.                      */
  --ink:        #0e1a14;   /* deepest forest — page background */
  --ink-2:      #12201a;   /* alternating sections */
  --surface:    #16271f;   /* cards */
  --surface-2:  #1c3128;   /* insets inside cards */
  --line:       #2b463a;
  --line-soft:  #21362c;

  --text:       #f2ebdc;   /* cream */
  --text-2:     #c3bda9;   /* muted cream */
  --text-3:     #8b9086;   /* sage grey */

  --accent:     #c79a6b;   /* coffee with cream — the one warm color */
  --accent-dim: #9a7048;   /* darker roast */
  --accent-ghost: rgba(199, 154, 107, .12);
  --on-accent:  #10201a;   /* text sitting on a coffee button */

  --amber:      #e5c87f;   /* TBD badges — pale gold */
  --amber-ghost: rgba(229, 200, 127, .07);
  --amber-line: rgba(229, 200, 127, .30);

  /* Type */
  --serif: "EB Garamond", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --label: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;

  /* Layout */
  --wide: 1140px;
  --narrow: 760px;
  --nav-h: 68px;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle warm glow behind the top of the page */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 620px;
  background:
    radial-gradient(900px 420px at 18% -8%, rgba(199,154,107,.13), transparent 65%),
    radial-gradient(760px 400px at 92% 2%, rgba(74,148,110,.10), transparent 62%);
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--on-accent);
  padding: .6rem 1rem; z-index: 100; font-weight: 700;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ------------------------------------------------------------------ TYPE */
/* EB Garamond sets optically smaller than most faces, so display sizes run
   larger here and carry almost no negative tracking. */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.13; margin: 0; letter-spacing: -0.005em; }

.section-title {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  margin-bottom: .1rem;
}
.section-head { margin-bottom: 2.75rem; max-width: 60ch; }
.section-intro { color: var(--text-2); margin: .9rem 0 0; font-size: 1.02rem; }

/* Kicker sits UNDER the big title, reading as a subtitle rather than a
   label floating above it. */
.eyebrow {
  font-family: var(--label);
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin: .1rem 0 0;
}

/* ------------------------------------------------------------------- NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: rgba(14,26,20,.72);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.scrolled { border-bottom-color: var(--line-soft); background: rgba(14,26,20,.92); }

/* The side padding sits inside this box but outside the hero's, so the cap is
   widened by that padding — that keeps the RG mark flush with the hero name
   and the Résumé button flush with the photo's right edge. */
.nav-inner {
  --nav-pad: clamp(1.1rem, 4vw, 2rem);
  max-width: calc(var(--wide) + 2 * var(--nav-pad)); margin: 0 auto; height: 100%;
  padding: 0 var(--nav-pad);
  display: flex; align-items: center; gap: 1.5rem;
}

.mark {
  font-family: var(--serif);
  font-size: 1.45rem; font-weight: 700; letter-spacing: .02em;
  color: var(--text); text-decoration: none;
  border: 1px solid var(--line); border-radius: 10px;
  padding: .18rem .55rem;
  transition: border-color .2s, color .2s;
}
.mark:hover { color: var(--accent); border-color: var(--accent-dim); text-decoration: none; }

.nav-links { margin-left: auto; display: flex; gap: 1.75rem; }
.nav-links a {
  color: var(--text-2); font-size: .93rem; font-weight: 500;
  text-decoration: none; position: relative; padding: .3rem 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1.5px;
  background: var(--accent); transition: right .25s ease;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a:hover::after, .nav-links a.active::after { right: 0; }
.nav-links a.active { color: var(--text); }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: .5rem; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; transition: .25s; }

/* ---------------------------------------------------------------- BUTTON */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-weight: 600; font-size: .95rem;
  padding: .78rem 1.35rem; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
  text-decoration: none; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 8px 24px -10px var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn-sm { padding: .5rem 1rem; font-size: .87rem; }

/* --------------------------------------------------------------- SECTION */
.section {
  position: relative; z-index: 1;
  padding: clamp(4.5rem, 9vw, 7.5rem) clamp(1.1rem, 4vw, 2rem);
}
.section-alt { background: var(--ink-2); border-block: 1px solid var(--line-soft); }
.section > * { max-width: var(--wide); margin-inline: auto; }

/* ------------------------------------------------------------------ HERO */
.hero {
  position: relative; z-index: 1;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1.1rem, 4vw, 2rem) clamp(3.5rem, 7vw, 5.5rem);
}
.hero-inner {
  max-width: var(--wide); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}

.hero-name {
  font-size: clamp(3.4rem, 9.5vw, 6.2rem);
  line-height: .98; letter-spacing: -0.012em; margin-bottom: .9rem;
  font-weight: 600;
}
.hero-pronouns {
  font-family: var(--label); font-size: .78rem; letter-spacing: .1em;
  color: var(--text-3); vertical-align: super; margin-left: .6rem;
  text-transform: lowercase;
}
/* Tier 2 — what you do. The loudest thing after your name. */
.hero-role {
  font-family: var(--label);
  font-size: 1.12rem; font-weight: 500; letter-spacing: .005em;
  color: var(--text);
  margin: 0 0 .35rem;
}
.hero-role .role-main { color: var(--accent); font-weight: 600; }

/* Tier 3 — where you are. Present, but quiet. */
.hero-meta {
  font-family: var(--label);
  font-size: .95rem; color: var(--text-3);
  margin: 0 0 1.75rem;
}

.role-sep {
  display: inline-block; margin: 0 .55rem;
  color: var(--accent-dim); font-weight: 400;
}

/* Availability — the one thing a recruiter is scanning for. */
.hero-availability {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--label); font-size: .82rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-ghost);
  border: 1px solid var(--accent-dim);
  border-radius: 999px; padding: .42rem 1rem .42rem .85rem;
  margin: 0 0 1.9rem;
}
.hero-availability .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex: none;
  box-shadow: 0 0 0 3px var(--accent-ghost);
}

.hero-tagline {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.35rem, 2.7vw, 1.85rem); line-height: 1.38;
  color: var(--text); margin: 0 0 1.2rem; max-width: 24ch;
  border-left: 2px solid var(--accent-dim); padding-left: 1.1rem;
}
.hero-intro { color: var(--text-2); font-size: 1.06rem; max-width: 52ch; margin: 0 0 2.2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; }

/* Capped so the portrait doesn't tower over a short text column. */
.hero-photo-wrap { position: relative; max-width: 350px; margin-left: auto; }
.hero-photo {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 22%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  filter: saturate(.92) contrast(1.03);
}
.hero-photo-wrap::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  background: linear-gradient(180deg, transparent 55%, rgba(11,12,16,.5));
  pointer-events: none;
}

.hero-facts {
  max-width: var(--wide); margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden;
}
.fact { background: var(--ink); padding: 1.1rem 1.25rem; }
.fact-label {
  font-family: var(--label); font-size: .68rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-3); display: block; margin-bottom: .35rem;
}
.fact-value { font-size: .95rem; color: var(--text); line-height: 1.4; }

/* ------------------------------------------------------------------ WORK */
.work-group + .work-group { margin-top: clamp(3rem, 5vw, 4.5rem); }

.work-group-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.1rem;
  padding-bottom: .85rem; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line-soft);
}
.work-group-title {
  font-size: 1.9rem; color: var(--text);
  display: flex; align-items: baseline; gap: .7rem;
}
.work-group-title::before {
  content: ""; width: 26px; height: 2px; background: var(--accent);
  display: inline-block; transform: translateY(-.32em);
}
.work-group-blurb { color: var(--text-3); font-size: .93rem; margin: 0; }

.project-list { display: flex; flex-direction: column; gap: 1.5rem; }

/* ------------------------------------------------------------- LOGO BAR */
/* Logos arrive on mixed backgrounds — some white, some transparent — so each
   one sits on its own cream tile. That keeps brand colors intact and reads
   consistently against the dark green. */

.org-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: .75rem;
  padding-bottom: 1.5rem; margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line-soft);
}

.org-tab {
  display: flex; flex-direction: column; align-items: center; gap: .7rem;
  padding: 1rem .75rem .85rem;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  cursor: pointer; font-family: var(--label);
  transition: border-color .2s, transform .2s, background .2s, color .2s;
}
.org-tab:hover { border-color: var(--line); transform: translateY(-2px); color: var(--text); }

/* Fixed height, not aspect-ratio — a tall logo would otherwise stretch its
   own tile and break the row's alignment. */
.org-logo {
  width: 100%; height: 72px;
  display: grid; place-items: center; overflow: hidden;
  padding: .25rem;
}
/* The logos in assets/logos/*-mono files are pre-rendered cream silhouettes
   with transparent backgrounds, so they sit straight on the dark green.
   Absolute max-height, not a percentage — inside a centered grid a percentage
   height has nothing definite to resolve against, and tall logos overflow. */
.org-logo img {
  max-width: 100%; max-height: 58px;
  width: auto; height: auto;
  opacity: .55; transition: opacity .2s;
}
.org-monogram {
  font-family: var(--serif); font-size: 1.9rem; font-weight: 700;
  color: var(--text); line-height: 1;
  opacity: .55; transition: opacity .2s;
}
.org-tab:hover .org-logo img,
.org-tab:hover .org-monogram,
.org-tab[aria-selected="true"] .org-logo img,
.org-tab[aria-selected="true"] .org-monogram { opacity: 1; }

.org-name {
  font-size: .78rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; text-align: center;
}

/* Selected */
.org-tab[aria-selected="true"] {
  background: var(--surface-2); border-color: var(--accent-dim); color: var(--text);
}
.org-tab[aria-selected="true"] .org-name { color: var(--accent); }

/* Panel that drops down under the bar */
.org-panel[hidden] { display: none; }
.org-panel { animation: orgIn .32s ease both; }
@keyframes orgIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .org-panel { animation: none; } }

.org-head { margin-bottom: 1.5rem; max-width: 68ch; }
.org-title { font-size: 1.65rem; margin-bottom: .5rem; }
.org-blurb { color: var(--text-2); margin: .6rem 0 0; }
.org-highlights { list-style: none; padding: 0; margin: .9rem 0 0; display: grid; gap: .5rem; }
.org-highlights li { position: relative; padding-left: 1.25rem; color: var(--text-2); font-size: .95rem; }
.org-highlights li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 6px; height: 1px; background: var(--accent-dim);
}

.credited {
  font-family: var(--label); font-size: .66rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-ghost);
  border: 1px solid var(--accent-dim); border-radius: 999px;
  padding: .18rem .6rem; white-space: nowrap;
}

.project {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  transition: border-color .25s ease, transform .25s ease;
}
.project:hover { border-color: var(--line); transform: translateY(-2px); }

.project-media {
  position: relative; background: var(--surface-2);
  min-height: 240px; display: grid; place-items: center; overflow: hidden;
  border-right: 1px solid var(--line-soft);
}
.project-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.project-media .placeholder {
  font-family: var(--serif); font-size: 5.5rem; font-weight: 600;
  color: var(--accent); opacity: .18; user-select: none;
}
.project-media::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,.02) 0 2px, transparent 2px 8px);
}

/* ------------------------------------------------------- HOVER-PLAY MEDIA */
/* Still image underneath, clip crossfading over it. */
.media-hover { position: absolute; inset: 0; cursor: pointer; }
.media-hover img,
.media-hover video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Asymmetric on purpose: a long dissolve in so the clip emerges from the still
   rather than cutting to it, and a shorter one back out.
   NOTE: the fade-out duration is mirrored by FADE_OUT_MS in app.js, which waits
   it out before pausing. Change one, change the other. */
.media-hover video {
  opacity: 0;
  transition: opacity .9s ease;          /* out */
  pointer-events: none;                  /* hover/click belong to the container */
}
.media-hover.playing video {
  opacity: 1;
  transition: opacity 1.6s ease-in-out;  /* in */
}

/* The still fades out as the clip comes in. Essential when the two aren't the
   same shape: a letterboxed video is narrower than the still behind it, so
   leaving the still up shows it poking out either side of the clip. */
.media-hover > img:not(.media-backdrop) { transition: opacity .9s ease; }
.media-hover.playing > img:not(.media-backdrop) {
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
}

/* No scripting: the still is the whole story. */
html:not(.js) .media-hover video { display: none; }

/* -------------------------------------------------------------- CAROUSEL */
/* Featured work scrolls sideways instead of stacking three full-width slabs.
   Native scroll-snap does the work — trackpad and touch need no JS. */

.carousel-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
}
.carousel-head .work-group-head { flex: 1 1 auto; margin-bottom: 1.25rem; }

.carousel-nav { display: flex; gap: .5rem; padding-bottom: 1.4rem; }
.carousel-btn {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--text-2);
  border: 1px solid var(--line);
  font-size: 1rem; line-height: 1;
  transition: border-color .2s, color .2s, background .2s, opacity .2s;
}
.carousel-btn:hover:not(:disabled) {
  border-color: var(--accent); color: var(--accent); background: var(--accent-ghost);
}
.carousel-btn:disabled { opacity: .3; cursor: default; }

.carousel {
  /* Bleed a little past the container so cards can slide off-screen cleanly. */
  margin-inline: calc(clamp(1.1rem, 4vw, 2rem) * -1);
  padding-inline: clamp(1.1rem, 4vw, 2rem);
  overflow: hidden;
}
.carousel-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 0;
  padding-bottom: .5rem;
  scrollbar-width: none;             /* Firefox */
}
.carousel-track::-webkit-scrollbar { display: none; }

/* Two cards on a wide screen, one plus a peek on a narrow one. */
.carousel-track > .project {
  flex: 0 0 min(560px, 82%);
  scroll-snap-align: start;
  margin: 0;
}
@media (min-width: 1100px) {
  .carousel-track > .project { flex-basis: calc(50% - .625rem); }
}

/* Media keeps the banner proportion but scales with the smaller card instead
   of the viewport, so the ratio is identical and the panel is just smaller. */
.carousel-track > .project.is-banner .project-media {
  height: auto;
  aspect-ratio: 2.54 / 1;
}

.carousel-dots {
  display: flex; gap: .45rem; justify-content: center;
  margin-top: 1.4rem;
}
.carousel-dots button {
  width: 7px; height: 7px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: var(--line);
  transition: background .25s ease, transform .25s ease;
}
.carousel-dots button:hover { background: var(--accent-dim); }
.carousel-dots button[aria-current="true"] {
  background: var(--accent); transform: scale(1.3);
}

/* No JS: the track still scrolls natively, but the controls can't work. */
html:not(.js) .carousel-nav,
html:not(.js) .carousel-dots { display: none; }

/* ------------------------------------------------------------- SLIDESHOW */
.media-slides { position: absolute; inset: 0; cursor: pointer; }
.media-slides img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .8s ease;
}
/* Before JS takes over — and forever, without it — the first photo shows. */
.media-slides:not(.ready) img:first-of-type { opacity: 1; }
.media-slides.ready img.is-on { opacity: 1; }

.slide-dots {
  position: absolute; left: 50%; bottom: .65rem; transform: translateX(-50%);
  display: flex; gap: .3rem;
  opacity: 0; transition: opacity .35s ease;
  pointer-events: none;
}
.media-slides.playing .slide-dots { opacity: 1; }
.slide-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(242, 235, 220, .35);
  transition: background .3s ease, transform .3s ease;
}
.slide-dots span.is-on { background: var(--text); transform: scale(1.35); }

html:not(.js) .slide-dots { display: none; }

/* Side card, art fitted rather than cropped — for product box shots. */
.project-media.is-contain { min-height: 280px; }
.project-media.is-contain > img:not(.media-backdrop),
.project-media.is-contain .media-hover > img:not(.media-backdrop) {
  object-fit: contain;
  padding: 1.1rem;
}

/* --------------------------------------------------------- BANNER LAYOUT */
/* For projects whose still and clip disagree about shape. Media runs the full
   width of the card and nothing is cropped — a blurred, darkened copy of the
   still fills the space around it. */
.project.is-banner { grid-template-columns: 1fr; }
.project.is-banner .project-media {
  height: clamp(250px, 30vw, 430px);
  min-height: 0;
  border-right: 0;
  border-bottom: 1px solid var(--line-soft);
}
.project.is-banner .project-media > img,
.project.is-banner .media-hover > img,
.project.is-banner .media-hover > video {
  object-fit: contain;
}
.media-backdrop {
  object-fit: cover;
  filter: blur(26px) saturate(1.35) brightness(.5);
  transform: scale(1.25);          /* hides the soft edge the blur leaves */
}
.project.is-banner .media-backdrop { object-fit: cover; }
/* Projects with no art yet still get the banner shape, so the row stays even. */
.project.is-banner .project-media .placeholder { font-size: 8rem; }

.project-body { padding: clamp(1.5rem, 3vw, 2.1rem); }

.project-topline {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem 1rem;
  margin-bottom: .55rem;
}
.project-title { font-size: 1.8rem; }
.project-subtitle { color: var(--text-3); font-size: .95rem; }
.project-kind { color: var(--text-2); font-size: .98rem; line-height: 1.45; margin: -.15rem 0 .75rem; }

.project-meta {
  display: flex; flex-wrap: wrap; gap: .5rem 1.4rem;
  font-family: var(--label); font-size: .73rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 1rem;
}
.project-meta strong { color: var(--text-2); font-weight: 500; }

.project-summary { color: var(--text); margin: 0 0 1.1rem; font-size: 1.02rem; }

.project-highlights { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .5rem; }
.project-highlights li {
  position: relative; padding-left: 1.3rem; color: var(--text-2); font-size: .96rem;
}
.project-highlights li::before {
  content: "▸"; position: absolute; left: 0; top: -1px; color: var(--accent-dim); font-size: .85rem;
}

.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.1rem; }
.tag {
  font-family: var(--label); font-size: .7rem; letter-spacing: .08em;
  padding: .28rem .6rem; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--text-2);
}

.project-links { display: flex; flex-wrap: wrap; gap: .6rem; }

.note {
  margin-top: 1.1rem; padding: .75rem .9rem;
  background: var(--amber-ghost); border: 1px dashed var(--amber-line);
  border-radius: 10px; font-size: .87rem; color: var(--text-2);
}
.note strong {
  font-family: var(--label); font-size: .68rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--amber); display: block; margin-bottom: .25rem;
}

.coming-soon {
  margin-top: 1.5rem; padding: 1.6rem;
  border: 1px dashed var(--line); border-radius: var(--radius);
  text-align: center; color: var(--text-2);
}
.coming-soon h3 { font-size: 1.3rem; margin-bottom: .5rem; color: var(--text); }

/* --------------------------------------------------- CLICKABLE CARD + PD */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* The whole card is the hit area; the mark is just the visible affordance. */
.project-open {
  position: static;
  background: none; border: 0; padding: 0;
  cursor: pointer; color: var(--text-3);
  font-size: 1rem; line-height: 1;
}
.project-open::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.project-open-mark {
  position: absolute; top: 1.1rem; right: 1.2rem;
  transition: color .2s, transform .2s;
}
.project:hover .project-open-mark { color: var(--accent); transform: translate(2px, -2px); }
.project:focus-within { border-color: var(--accent-dim); }
/* MUST stay positioned: `.project-open::after` is the stretched hit area, and
   without this it resolves against `.section` — every card's click layer then
   covers the whole section and one card swallows every click. */
.project { position: relative; cursor: pointer; }

/* ------------------------------------------------------ PROJECT DIALOG */
.pd {
  width: min(1040px, 94vw);
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}
/* Open: a soft fade and a few pixels of rise. Close: a quicker fade down. */
.pd[open] { animation: pdIn .3s cubic-bezier(.2, .7, .2, 1) both; }
.pd[open]::backdrop { animation: pdFade .3s ease both; }
.pd.is-closing { animation: pdOut .2s ease both; }
.pd.is-closing::backdrop { animation: pdFade .2s ease reverse both; }
@keyframes pdIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes pdOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px) scale(.995); } }
@keyframes pdFade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .pd[open], .pd[open]::backdrop, .pd.is-closing, .pd.is-closing::backdrop { animation: none; }
}
.pd::backdrop {
  background: rgba(5, 11, 8, .78);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.pd-inner {
  max-height: 92vh;
  overflow-y: auto;
  padding: clamp(1.6rem, 3.5vw, 2.8rem);
}
.pd-close {
  position: absolute; top: .85rem; right: .95rem; z-index: 3;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%; cursor: pointer;
  background: rgba(5, 11, 8, .65); color: var(--text);
  border: 1px solid rgba(242, 235, 220, .22);
  font-size: 1.2rem; line-height: 1;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.pd-close:hover { border-color: var(--accent); color: var(--accent); }

.pd-head { margin-bottom: 1.5rem; padding-right: 2.5rem; }
.pd-title { font-size: clamp(1.9rem, 3.5vw, 2.6rem); margin-bottom: .45rem; }
.pd-sub {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem;
  font-family: var(--label); font-size: .88rem; color: var(--text-3);
}
.pd-status {
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-2);
}

/* gallery: one large image, up to three thumbnails */
.pd-gallery { margin-bottom: 1.6rem; }
.pd-main {
  background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: 10px;
  overflow: hidden; aspect-ratio: 16 / 9;
}
.pd-main img { width: 100%; height: 100%; object-fit: contain; }
.pd-main img { transition: opacity .18s ease; }
.pd-main img.is-swapping { opacity: 0; }
.pd-thumbs { display: flex; gap: .6rem; margin-top: .6rem; }
.pd-thumb {
  width: 96px; height: 64px; flex: none; padding: 0;
  border: 1px solid var(--line-soft); border-radius: 7px;
  background: var(--surface-2); overflow: hidden; cursor: pointer;
  opacity: .55; transition: opacity .2s, border-color .2s;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumb:hover { opacity: .85; }
.pd-thumb.is-on { opacity: 1; border-color: var(--accent); }

.pd-summary {
  font-family: var(--serif); font-size: 1.22rem; line-height: 1.5;
  color: var(--text); margin: 0 0 1.1rem; max-width: 70ch;
}
.pd-highlights { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: .5rem; max-width: 74ch; }
.pd-highlights li { position: relative; padding-left: 1.3rem; color: var(--text-2); font-size: .97rem; }
.pd-highlights li::before {
  content: "▸"; position: absolute; left: 0; top: -1px; color: var(--accent-dim); font-size: .85rem;
}

.pd-section { margin-top: 1.9rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft); }
.pd-section h3 {
  font-family: var(--label); font-size: .74rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1.1rem;
}
.pd-fields {
  margin: 0; display: grid; gap: 1.1rem 2.2rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
/* Overview facts sit in a narrow column on the left; the story fields read
   down the right, divided by a coffee rule. Stacks on narrow screens. */
.pd-overview {
  display: grid; align-items: start;
  grid-template-columns: minmax(10rem, 14rem) 1fr;
  gap: 1.7rem 2.4rem;
}
.pd-fields-facts { grid-template-columns: 1fr; gap: 1rem; }
.pd-fields-story {
  grid-template-columns: 1fr; gap: 1.4rem;
  padding-left: 2.4rem;
  border-left: 1px solid var(--accent-dim);
}
.pd-fields-story .pd-field dd { max-width: 72ch; }
.pd-field dt {
  font-family: var(--label); font-size: .74rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: .3rem;
}
.pd-field dd { margin: 0; color: var(--text-2); font-size: 1rem; line-height: 1.6; }

.pd-tags, .pd-links { margin-top: 1.6rem; }
.pd-note { margin-top: 1.6rem; }

@media (max-width: 700px) {
  /* Full-screen sheet. Browsers give <dialog> their own max-width and margin,
     which fought the old 100vw width and pushed the sheet off the right edge. */
  .pd {
    width: 100%; max-width: 100%;
    height: 100%; max-height: 100%;
    margin: 0; inset: 0;
    border-radius: 0; border: 0;
  }
  .pd-inner {
    height: 100%; max-height: 100%;
    padding: 1.25rem max(1.1rem, env(safe-area-inset-right)) calc(1.6rem + env(safe-area-inset-bottom)) max(1.1rem, env(safe-area-inset-left));
    overscroll-behavior: contain;
  }
  .pd-close { top: calc(.7rem + env(safe-area-inset-top)); right: .7rem; }
  .pd-thumb { width: auto; flex: 1 1 0; max-width: 96px; }
  .pd-summary { font-size: 1.1rem; }
  .pd-main { aspect-ratio: 4 / 3; }
  .pd-overview { grid-template-columns: 1fr; }
  .pd-fields-facts { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
  .pd-fields-story {
    padding-left: 0; border-left: 0;
    padding-top: 1.7rem; border-top: 1px solid var(--accent-dim);
  }
}

/* --------------------------------------------------------------- TBD PILL */
.tbd {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--label); font-size: .68rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--amber); background: var(--amber-ghost);
  border: 1px solid var(--amber-line); border-radius: 5px;
  padding: .1rem .45rem; vertical-align: middle;
}

/* ------------------------------------------------------------ EXPERIENCE */
.timeline { display: flex; flex-direction: column; }
.job {
  display: grid; grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(1rem, 4vw, 3rem);
  padding: 2rem 0;
  border-top: 1px solid var(--line-soft);
}
.job:last-child { border-bottom: 1px solid var(--line-soft); }
.job-when {
  font-family: var(--label); font-size: .76rem; letter-spacing: .08em;
  color: var(--text-3); text-transform: uppercase; padding-top: .4rem;
}
.job-when .loc { display: block; margin-top: .3rem; color: var(--text-3); opacity: .75; }
.job-title { font-size: 1.55rem; margin-bottom: .15rem; }
.job-company { color: var(--accent); font-size: .95rem; font-weight: 600; margin-bottom: .9rem; }
.job-bullets { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.job-bullets li { position: relative; padding-left: 1.25rem; color: var(--text-2); font-size: .97rem; }
.job-bullets li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 6px; height: 1px; background: var(--accent-dim);
}

/* ---------------------------------------------------------------- SKILLS */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.skill-group {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1.4rem 1.5rem;
}
.skill-group h3 {
  font-family: var(--label); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; font-weight: 600;
}
.skill-group ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.skill-group li { color: var(--text-2); font-size: .95rem; }

/* ----------------------------------------------------------------- ABOUT */
.about-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
.about-body p {
  font-family: var(--serif); font-size: 1.24rem; line-height: 1.58;
  color: var(--text-2); margin: 0 0 1.15rem;
}
/* Opening line runs larger as a lede — the emphasis a pull quote used to give,
   without presenting your own sentence as a quotation. */
.about-body p:first-child {
  color: var(--text);
  font-size: 1.42rem; line-height: 1.45;
  margin-bottom: 1.5rem;
}
/* Collapsed remainder: a sliver of the next paragraph shows through a fade,
   which signals "there's more" better than a hard cut. */
.about-more {
  max-height: 88px;
  overflow: hidden;
  transition: max-height .45s ease;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 96%);
  mask-image: linear-gradient(180deg, #000 0%, #000 35%, transparent 96%);
}
.about-more.open {
  -webkit-mask-image: none;
  mask-image: none;
}
@media (prefers-reduced-motion: reduce) { .about-more { transition: none; } }

.about-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 1.1rem; padding: .5rem 1.1rem .5rem 0;
  background: none; border: 0; cursor: pointer;
  font-family: var(--label); font-size: .78rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  transition: gap .2s;
}
.about-toggle:hover { gap: .8rem; }
.about-toggle-chev { transition: transform .3s ease; font-size: .9rem; }
.about-toggle[aria-expanded="true"] .about-toggle-chev { transform: rotate(180deg); }

.about-quote {
  font-family: var(--serif); font-style: italic; font-size: 1.5rem; line-height: 1.45;
  color: var(--text); border-left: 2px solid var(--accent); padding-left: 1.3rem;
  margin: 2rem 0 0;
}
.about-photo {
  width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 20%;
  border-radius: var(--radius); border: 1px solid var(--line);
}
/* Prose at a readable measure when there's no photo beside it. The block keeps
   the page's normal width so it lines up with the heading; the measure is
   limited on the children instead. (Narrowing the block itself pulls it out of
   alignment — `.section > *` centres at the container width.) */
.about-solo { max-width: var(--wide); }
.about-solo > *:not(.about-egg) { max-width: 74ch; }

/* "Off the clock" as a row under the prose rather than a hanging sidebar. */
.about-extras {
  margin-top: clamp(2.25rem, 4vw, 3.25rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--line-soft);
}
.about-extras .extras { margin-top: 0; }
.about-extras .extras dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem 2.5rem;
}
/* Each dt/dd pair is wrapped in a div so a pair occupies one grid cell —
   gridding the dl directly puts labels and values in separate columns. */
.extras dl > div { min-width: 0; }
.about-extras .extras dd { font-size: 1rem; }

/* ------------------------------------------------------------ EASTER EGG */
/* A cat that only turns up once About is expanded. Faint by default — it's
   meant to be noticed, not announced. Sits in the empty space to the right of
   the prose, on the same line as the Read more/less control. */
.about-body { position: relative; }
.about-egg {
  position: absolute;
  right: 0;
  bottom: 0;
  display: block;
  padding: .4rem;
  background: none; border: 0;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .7s ease .25s, transform .7s ease .25s;
}
.is-expanded .about-egg {
  opacity: .2;
  transform: none;
  pointer-events: auto;
}
.is-expanded .about-egg:hover { opacity: .85; }
.about-egg img { width: 46px; height: auto; }
@media (prefers-reduced-motion: reduce) { .about-egg { transition: opacity .2s; } }

.egg-dialog {
  max-width: 460px; width: calc(100% - 2.5rem);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  overflow: hidden;
}
.egg-dialog::backdrop {
  background: rgba(5, 11, 8, .74);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.egg-photo {
  width: 100%; max-height: 380px; object-fit: cover;
  display: block; border-bottom: 1px solid var(--line-soft);
}
.egg-msg {
  font-family: var(--serif);
  font-size: 1.18rem; line-height: 1.5;
  color: var(--text);
  margin: 0; padding: 1.5rem 1.6rem 1.7rem;
}
.egg-close {
  position: absolute; top: .6rem; right: .7rem;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%; cursor: pointer;
  background: rgba(5, 11, 8, .6); color: var(--text);
  border: 1px solid rgba(242, 235, 220, .25);
  font-size: 1.1rem; line-height: 1;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.egg-close:hover { background: rgba(5, 11, 8, .85); border-color: var(--accent); color: var(--accent); }

.extras { margin-top: 1.5rem; }
.extras h3 {
  font-family: var(--label); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .9rem; font-weight: 600;
}
.extras dl { margin: 0; display: grid; gap: .8rem; }
.extras dt { font-size: .8rem; color: var(--text-3); font-family: var(--label); letter-spacing: .06em; }
.extras dd { margin: .15rem 0 0; color: var(--text-2); font-size: .95rem; }

/* ------------------------------------------------- COMMUNITY / EDUCATION */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; }
.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 1.6rem 1.75rem;
}
.card h3 { font-size: 1.38rem; margin-bottom: .15rem; }
.card .org { color: var(--accent); font-size: .93rem; font-weight: 600; }
.card .when {
  font-family: var(--label); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3); margin: .5rem 0 1rem; display: block;
}
.card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.card li { position: relative; padding-left: 1.2rem; color: var(--text-2); font-size: .94rem; }
.card li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 6px; height: 1px; background: var(--accent-dim);
}
.card .sub { color: var(--text-2); font-size: .95rem; margin-top: .3rem; }

/* --------------------------------------------------------------- CONTACT */
.section-contact { background: var(--ink-2); border-top: 1px solid var(--line-soft); }
.contact-inner { max-width: var(--narrow); text-align: center; }
.contact-inner .section-head { margin-inline: auto; }
.contact-email {
  display: inline-block; font-family: var(--serif);
  font-size: clamp(1.6rem, 4.4vw, 2.7rem); color: var(--text);
  margin: .5rem 0 2rem; word-break: break-word;
  border-bottom: 1px solid var(--accent-dim); padding-bottom: .2rem;
}
.contact-email:hover { color: var(--accent); text-decoration: none; border-bottom-color: var(--accent); }
.contact-links { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }

/* ---------------------------------------------------------------- FOOTER */
.footer {
  position: relative; z-index: 1;
  padding: 2.5rem clamp(1.1rem, 4vw, 2rem);
  border-top: 1px solid var(--line-soft);
  background: var(--ink);
}
.footer-inner {
  max-width: var(--wide); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  color: var(--text-3); font-size: .87rem;
}

/* ------------------------------------------------------------ RESPONSIVE */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo-wrap { max-width: 300px; order: -1; }
  .hero-photo { aspect-ratio: 1; }
  .project { grid-template-columns: 1fr; }
  .project-media { min-height: 180px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .job { grid-template-columns: 1fr; gap: .75rem; }
  .job-when { padding-top: 0; }
  .about-grid { grid-template-columns: 1fr; }
  .about-side { max-width: 320px; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; order: 3; }
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--ink-2); border-bottom: 1px solid var(--line);
    padding: .5rem 0; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .8rem clamp(1.1rem, 4vw, 2rem); }
  .nav-inner > .btn { margin-left: auto; }
}

/* -------------------------------------------------------------- ANIMATION */
/* Gated on `.js` (set by the inline script in <head>). Without scripting the
   rule never applies, so pre-rendered content is visible rather than stuck at
   opacity 0 waiting for an observer that will never run. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------- NO-SCRIPT FALLBACK */
/* Anything JavaScript normally reveals has to be open by default without it. */
html:not(.js) .about-more {
  max-height: none;
  -webkit-mask-image: none;
  mask-image: none;
}
html:not(.js) .about-toggle { display: none; }
html:not(.js) .org-panel[hidden] { display: block; }
html:not(.js) .org-panel + .org-panel { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line-soft); }
html:not(.js) .org-bar { display: none; }

/* ------------------------------------------------------------------ PRINT */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  body::before, .nav, .footer, .hero-photo-wrap, .project-media, .btn, .note, .coming-soon { display: none !important; }
  .section, .hero { padding: 0 0 1.5rem; }
  .section-alt, .card, .skill-group, .project { background: none; border-color: #ccc; }
  a { color: #000; text-decoration: underline; }
  .tbd { color: #666; border-color: #999; background: none; }
  .project { grid-template-columns: 1fr; page-break-inside: avoid; }
  .job { page-break-inside: avoid; }
}

/* Keeps short phrases like "Salt Lake City, UT" whole when a line wraps on
   narrow screens, so the break falls between phrases instead of inside one. */
.nowrap { white-space: nowrap; }
