/* ==========================================================================
   Jeremy Gleason, Portfolio
   Single stylesheet for the entire site.

   Aesthetic: dark, minimal, refined — editorial, not dev-template.
   - Headlines: Fraunces (refined optical serif). Body: Inter. No monospace.
   - Color discipline: near-black bg, off-white text.
       periwinkle = quiet structural accent (links, active nav, hairlines)
       amber      = strong "look here" emphasis (name word, role, primary CTA,
                    active filter, key stat). Used sparingly so it carries meaning.
   - Restraint over decoration: content sits on the background with generous
     whitespace; containers are quiet hairline surfaces, not glossy panels.

   Sections: Variables, Base, Layout, Nav, Buttons, Hero, Dashboard, Cards,
             Resume, Skills, Contact, Modal/Detail, Footer, Responsive
   ========================================================================== */

/* ---------- Design tokens (edit colors/fonts here) ---------- */
:root {
  --bg:            #0a0b0d;   /* page background, near-black */
  --bg-soft:       #101216;   /* quiet raised surface */
  --bg-softer:     #171a20;   /* hover / nested surface */
  --border:        #20242c;   /* hairlines */
  --border-bright: #2b313b;   /* brighter hairline / hover */

  --text:          #f2f0ec;   /* primary text, warm off-white */
  --text-soft:     #c3c6cd;   /* secondary readable text */
  --text-muted:    #888d97;   /* tertiary / meta text */

  /* periwinkle = quiet structural accent */
  /* One accent family — warm amber/orange — in two tones.
     accent = a quieter, muted amber for structural accents (links, nav,
     tags, small labels). ember = the full bright amber for strong emphasis
     (name word, primary CTA, active filter, stat units) that draws the eye. */
  --accent:        #d49a52;
  --accent-strong: #e8a948;
  --accent-soft:   rgba(232, 169, 72, 0.12);

  /* amber = strong emphasis, draws the eye */
  --ember:         #e8a948;
  --ember-strong:  #f0b452;
  --ember-soft:    rgba(232, 169, 72, 0.12);
  --on-ember:      #1a1205;   /* text sitting on an amber fill */

  --good:          #6cd6a6;

  --radius:        12px;
  --radius-sm:     8px;
  --maxw:          1080px;
  --gap:           clamp(1.25rem, 4vw, 2.5rem);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  --font-head: "Poppins", "Inter", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.1;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.4em;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); font-weight: 600; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; line-height: 1.25; }

p { margin: 0 0 1.1rem; color: var(--text-soft); }

a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-strong); }

ul { margin: 0 0 1rem; padding-left: 1.2rem; }
li { margin-bottom: 0.4rem; color: var(--text-soft); }

strong { color: var(--text); font-weight: 600; }

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

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

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section { padding: clamp(3.5rem, 9vw, 7rem) 0; }
.section--tight { padding: clamp(2rem, 5vw, 3rem) 0; }

/* Quiet section label. No monospace — small caps tracking instead. */
.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  position: relative;
  padding-left: 2.4rem;
}
.eyebrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 1.8rem;
  height: 1px;
  background: var(--accent);
}

.lead {
  font-family: var(--font-sans);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.55;
  color: var(--text-soft);
  font-weight: 400;
  max-width: 36ch;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 11, 13, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav__brand {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.nav__brand:hover { color: var(--text); }
.nav__links { display: flex; gap: 0.15rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: block;
  padding: 0.5rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 2px;
  background: var(--accent);
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font-size: 1.1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.005em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
/* Primary = the one amber action that draws the eye */
.btn--primary { background: var(--ember); color: var(--on-ember); }
.btn--primary:hover { background: var(--ember-strong); color: var(--on-ember); }
/* Ghost = quiet, hairline */
.btn--ghost { border-color: var(--border-bright); color: var(--text); }
.btn--ghost:hover { border-color: var(--text-muted); color: var(--text); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }

/* A quiet inline text link with a moving arrow, used for secondary nav-y links */
.text-link {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.text-link::after { content: "\2192"; transition: transform 0.18s ease; }
.text-link:hover::after { transform: translateX(4px); }

/* ---------- Hero (interior pages: portfolio, about, contact) ---------- */
.hero {
  padding: clamp(4rem, 11vw, 8rem) 0 clamp(2rem, 5vw, 3.5rem);
}
.hero h1 { max-width: 16ch; }
.hero h1 .accent,
.hero h1 span { color: var(--ember); }
.hero .lead { margin-top: 1.5rem; max-width: 46ch; }

/* When a content section flows directly out of the hero, drop its top padding
   so the two read as one continuous column instead of leaving a large gap. */
.hero + .section { padding-top: 0; }

/* About page: the story stays left-aligned to the same edge as the hero.
   The narrow measure lives on the paragraphs (for readability), NOT on the
   wrapper, so nothing gets centered/indented away from the hero. */
.about-body p { color: var(--text-soft); font-size: 1.1rem; line-height: 1.8; margin-bottom: 1.5rem; max-width: 62ch; }
.about-body .lead {
  font-family: var(--font-sans);
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  line-height: 1.5;
  color: var(--text);
  max-width: 60ch;
  margin-bottom: 2rem;
}
.about-body .grid p,
.about-body .card p { font-size: 1rem; line-height: 1.65; color: var(--text-muted); margin-bottom: 0; max-width: none; }

/* ---------- Generic grid + cards ---------- */
.grid {
  display: grid;
  gap: 2.5rem 2rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Quiet card: no fill, no glass. A hairline that brightens on hover, with the
   media doing the visual work. Reads as restrained, not boxed-in. */
.card {
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.card h3 { color: var(--text); margin: 0 0 0.35rem; }
.card p { margin-bottom: 0; font-size: 0.98rem; color: var(--text-muted); line-height: 1.6; }

/* Card media thumbnail (image / video poster). The hero element of each card. */
.card__media {
  display: block;
  position: relative;
  margin: 0 0 1.1rem;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  cursor: pointer;
  width: 100%;
  padding: 0;
  transition: border-color 0.2s ease;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.card--clickable:hover .card__media { border-color: var(--border-bright); }
.card--clickable:hover .card__media img { transform: scale(1.035); }

/* Play badge overlaid on video thumbnails */
.card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card__play::after {
  content: "";
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(10, 11, 13, 0.55);
  border: 1px solid rgba(242, 240, 236, 0.5);
  backdrop-filter: blur(2px);
  /* play triangle via background, centered */
  background-image:
    linear-gradient(transparent, transparent);
  display: block;
}
.card__play::before {
  content: "";
  position: absolute;
  z-index: 1;
  width: 0; height: 0;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}
.card__play-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,11,13,0.1), rgba(10,11,13,0.35));
  transition: background 0.2s ease;
}
.card--clickable:hover .card__play-bg { background: linear-gradient(180deg, rgba(10,11,13,0.05), rgba(10,11,13,0.2)); }

/* "View details" CTA at the bottom of a clickable card */
.card--clickable { cursor: pointer; }
.card--clickable .card__cta {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.7rem;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.15s ease;
}
.card--clickable:hover .card__cta { color: var(--accent); }
.card--clickable .card__cta::after { content: "\2192"; transition: transform 0.18s ease; }
.card--clickable:hover .card__cta::after { transform: translateX(4px); }

/* Tag: quiet uppercase label above the title, no pill, no fill */
.tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

/* ---------- Portfolio filter tabs ---------- */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-bottom: 3rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.filter-tab {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 0;
  padding: 0.3rem 0;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}
.filter-tab:hover { color: var(--text); }
/* Active filter = amber underline, the strong "you are here" signal */
.filter-tab.is-active { color: var(--text); }
.filter-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.3rem;
  height: 2px;
  background: var(--ember);
}
.filter-empty { color: var(--text-muted); padding: 1rem 0; }

/* Sub-section heading inside the portfolio grid (Professional / Personal). */
.grid-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 1.5rem 0 0;
}
.grid-heading:first-child { margin-top: 0; }
.grid-heading h2 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  color: var(--text);
}
.grid-heading .grid-heading__line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.grid-heading .grid-heading__note {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.grid-heading[hidden] { display: none; }

/* Card hidden by the filter */
.card[hidden] { display: none; }

/* ==========================================================================
   HOME PAGE — editorial, asymmetric. The eye lands on the name + tagline,
   then flows down through quiet supporting sections.
   ========================================================================== */

.home { overflow-x: clip; }

/* Status line: the one place a small functional label survives. Quiet. */
.home__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: clamp(2rem, 5vw, 3rem) 0 0;
}
.home__status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px rgba(108, 214, 166, 0.14);
  display: inline-block;
}
.home__status b { color: var(--text); font-weight: 600; }
.home__status .sep { color: var(--border-bright); }

/* HERO: oversized serif identity statement */
.home__hero {
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 8vw, 6rem);
  border-bottom: 1px solid var(--border);
}
.home__hero .home__kicker {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.home__hero h1 {
  font-size: clamp(2.7rem, 10vw, 7rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
  overflow-wrap: break-word;
}
.home__hero h1 .accent { color: var(--ember); }
.home__hero .home__intro {
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 90ch;
  margin: 0;
}
/* Role marquee: roles scroll horizontally in a seamless loop. */
.role-marquee {
  margin: 0 0 1.75rem;
  overflow: hidden;
  /* fade the left/right edges so items glide in and out */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.role-marquee__track {
  display: flex;
  width: max-content;
  animation: role-scroll 32s linear infinite;
}
.role-marquee:hover .role-marquee__track { animation-play-state: paused; }
.role-marquee__group {
  display: flex;
  flex-shrink: 0;
}
.role-marquee__item {
  font-family: var(--font-sans);
  font-size: 1rem;
  letter-spacing: 0.01em;
  color: var(--ember);
  font-weight: 500;
  white-space: nowrap;
  padding: 0 1.4rem;
  position: relative;
}
/* dot separator between items */
.role-marquee__item::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ember);
  opacity: 0.5;
}
@keyframes role-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .role-marquee__track { animation: none; }
  /* hide the duplicate group when not animating so roles don't repeat */
  .role-marquee__group[aria-hidden="true"] { display: none; }
  .role-marquee { -webkit-mask-image: none; mask-image: none; }
}
.home__hero .btn-row { margin-top: 2.5rem; }

/* STATS: a horizontal band of three figures, varied scale, no boxes */
.home__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(3rem, 7vw, 5rem) 0;
  border-bottom: 1px solid var(--border);
}
.stat .num {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.03em;
}
.stat .num .unit { color: var(--ember); }
.stat .desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 1rem 0 0;
  max-width: 30ch;
}

/* Two-column editorial row: Currently + Featured work */
.home__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  padding: clamp(3rem, 7vw, 5rem) 0;
  border-bottom: 1px solid var(--border);
}
.home__block-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
}

/* "Currently" feed: a clean list, hairline dividers, no boxes */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.98rem;
  margin: 0;
  line-height: 1.5;
}
.feed li:last-child { border-bottom: 1px solid var(--border); }
.feed .marker {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 0.15rem;
  white-space: nowrap;
}
.feed b { color: var(--text); font-weight: 600; }

/* Featured-work: large editorial links, hairline-separated */
.mini-work { display: flex; flex-direction: column; }
.mini-work a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  transition: color 0.15s ease;
}
.mini-work a:last-child { border-bottom: 1px solid var(--border); }
.mini-work a:hover { color: var(--text); }
.mini-work a:hover .mw-title { color: var(--accent); }
.mini-work .mw-cat {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.mini-work .mw-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  transition: color 0.15s ease;
}
.mini-work .arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: transform 0.18s ease, color 0.15s ease;
}
.mini-work a:hover .arrow { color: var(--accent); transform: translateX(4px); }

/* Toolbelt: quiet inline wrap of tools, no chips/boxes — just text + dividers */
.home__tools { padding: clamp(3rem, 7vw, 5rem) 0; }
.toolbelt {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  max-width: 60ch;
}
.toolbelt span {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-soft);
  position: relative;
}
.toolbelt span:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -0.75rem;
  top: 0.45em;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--border-bright);
}

/* ==========================================================================
   RESUME
   ========================================================================== */
.resume-head { margin-bottom: 3rem; }
.resume-head h1 { margin-bottom: 0.5rem; }
.resume-head .lead {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  color: var(--ember);
  max-width: none;
  margin-bottom: 0;
}
.resume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 2rem 0 0;
}

.resume-block { margin-bottom: clamp(2.75rem, 6vw, 4rem); }
.resume-block > h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  padding-bottom: 0.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.resume-block > p { max-width: 70ch; color: var(--text-soft); }

.job {
  margin-bottom: 2.25rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--border);
}
.job:hover { border-left-color: var(--accent); }
.job__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.job__title { color: var(--text); font-size: 1.3rem; margin: 0; font-weight: 500; }
.job__dates { color: var(--text-muted); font-size: 0.9rem; white-space: nowrap; }
.job__meta { color: var(--accent); font-size: 0.95rem; margin: 0.2rem 0 0.8rem; font-style: normal; }
.job ul { margin-top: 0.5rem; }
.job li { color: var(--text-soft); }

.resume-highlights { padding-left: 0; list-style: none; }
.resume-highlights li {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-soft);
}
.resume-highlights li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.6rem;
  height: 1px;
  background: var(--ember);
}
.resume-highlights strong { color: var(--text); }

.edu-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
}
.edu-row .edu { flex: 1 1 240px; color: var(--text-soft); }
.edu strong { color: var(--text); display: block; font-size: 1.1rem; margin-bottom: 0.2rem; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.skill-group { }
.skill-group h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.skill-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.skill-group li {
  margin: 0;
  padding: 0.45rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.95rem;
}
.skill-group li:first-child { border-top: 0; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-card {
  margin-top: 2.5rem;
  max-width: 600px;
}
.contact-card .contact-label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.contact-card .email-link {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 3.6vw, 2.1rem);
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  display: inline-block;
  border-bottom: 1px solid var(--border-bright);
  padding-bottom: 0.1rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.contact-card .email-link:hover { color: var(--ember); border-color: var(--ember); }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.5rem; }

/* ==========================================================================
   MODAL / DETAIL / CAROUSEL  (project popup)
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(6, 7, 9, 0.9);
  backdrop-filter: blur(6px);
}
.modal.is-open { display: flex; }
.modal__inner {
  position: relative;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.modal__inner img,
.modal__inner video {
  max-width: 100%;
  max-height: 82vh;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright);
}
.modal__inner iframe {
  width: 100%;
  height: 82vh;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  background: #fff;
}
.modal__video {
  position: relative;
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 16 / 9;
}
.modal__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}
.modal__caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}
.modal__close {
  position: absolute;
  top: -2.8rem;
  right: 0;
  background: none;
  border: 1px solid var(--border-bright);
  color: var(--text);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.modal__close:hover { border-color: var(--ember); color: var(--ember); }

/* Project detail view */
.modal--detail .modal__inner {
  max-width: 820px;
  align-items: stretch;
}
.detail {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  max-height: 88vh;
  overflow-y: auto;
  text-align: left;
}
.detail__tag {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.detail h2 {
  margin: 0.75rem 0 0;
  font-size: clamp(1.7rem, 3.8vw, 2.3rem);
  font-weight: 600;
}

.detail__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.detail__meta dt {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.detail__meta dd { margin: 0; color: var(--text); font-size: 0.95rem; }

.detail h3 {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 1.75rem 0 0.6rem;
}
.detail p { color: var(--text-soft); }
.detail ol, .detail ul { color: var(--text-soft); padding-left: 1.2rem; }
.detail ol li, .detail ul li { margin-bottom: 0.5rem; }

.detail__media { margin-top: 1.75rem; }
.detail__media .modal__video { max-width: 100%; }
.detail__media img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.detail__media audio { width: 100%; }
.detail__links { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* Image carousel (inside the detail popup) */
.carousel { position: relative; }
.carousel__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.carousel__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel__slide.is-current { opacity: 1; }
.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 0;
}
.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-bright);
  background: rgba(10, 11, 13, 0.8);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.carousel__btn:hover { border-color: var(--ember); color: var(--ember); }
.carousel__btn--prev { left: 0.7rem; }
.carousel__btn--next { right: 0.7rem; }
.carousel__caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.carousel__dots {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.7rem;
}
.carousel__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: var(--border-bright);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.carousel__dot.is-current { background: var(--ember); transform: scale(1.3); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 0;
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.footer p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.footer__links { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.footer__links a { color: var(--text-soft); font-size: 0.9rem; }
.footer__links a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .home__stats { grid-template-columns: 1fr; gap: 2.5rem; }
  .home__row { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 720px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem var(--gap) 1rem;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 0.85rem 0.5rem; }
  .nav__links a.is-active::after { display: none; }
  .job__head { flex-direction: column; }
  .job__dates { white-space: normal; }
  .feed li { grid-template-columns: 1fr; gap: 0.3rem; }
}
