/* ==========================================================================
   Natasha Cervi — Portfolio
   Design source: Figma "Portfolio-Website" — Wireframes (Desktop frames)
   Target: static HTML/CSS/JS (Squarespace code-injection friendly)
   ========================================================================== */

/* ---- Design tokens (from Figma) ---- */
:root {
  --bg: #f7f5f2;                       /* page background */
  --ink: #070707;                      /* primary text */
  --mint: #8fceb6;                     /* accent */
  --mint-soft: rgba(143, 206, 182, .27); /* skills panel */
  --mint-line: #a2d5c2;                /* footer box border */
  --footer-bg: #f4f4f6;
  --dark-bar: #141824;
  --font-main: 'Poppins', sans-serif;
  --page-max: 1440px;
  --gutter: clamp(24px, 8.6vw, 126px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  /* Sticky footer: pin the footer to the bottom on short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh; /* small-viewport height where supported */
}

main { flex: 1 0 auto; } /* grows to fill leftover space, pushing footer down */

body.page-home { background: #fff; } /* Home artboard is white in Figma */

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { max-width: var(--page-max); margin: 0 auto; }

/* ==========================================================================
   Header (all pages) — sticky nav bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid rgba(7, 7, 7, .06);
}
body.page-home .site-header { background: #fff; }

.brand {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
}
.brand img { width: 96px; height: 96px; object-fit: contain; }

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3.2vw, 56px);
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 500;
  letter-spacing: .04em;
  line-height: 1.2;
}
.main-nav a { transition: color .2s ease; }
.main-nav a:hover { color: var(--mint); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 10px;
}
.nav-toggle span {
  display: block;
  width: 30px;
  height: 3px;
  background: var(--ink);
  margin: 6px 0;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ==========================================================================
   HOME
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 566px);
  justify-content: space-between;
  gap: 48px;
  padding: 0 var(--gutter);
  margin-top: clamp(40px, 6.5vw, 96px);
}

.hero-hi {
  font-size: clamp(24px, 2.5vw, 38px);
  font-weight: 400;
  line-height: 1.15;
}

.hero-title {
  font-size: clamp(36px, 4.5vw, 65px);
  font-weight: 600;
  line-height: 1.2;
  margin-top: 16px;
  white-space: nowrap; /* one line across the hero, per Figma (title sits above the photo) */
}

.hero-intro {
  font-size: clamp(20px, 2.3vw, 34px);
  line-height: 1.55;
  max-width: 708px;
  margin-top: clamp(32px, 4vw, 56px);
}

/* Hero photo — Figma "AI headshot 1": 566×580 @ x755 on the 1440 frame */
.hero-photo {
  position: relative;
  width: min(566px, 100%);
  justify-self: end;
  align-self: start;
  margin-right: -7px;                   /* photo overhangs the right gutter, per Figma */
  margin-top: clamp(96px, 23vw, 332px); /* photo top sits ~332px below hero top, per Figma */
}
/* Mint accent panel behind photo — Figma "Rectangle 21": 484×634 @ x858.
   It peeks 27px above and below the photo and 21px to its right,
   while the photo hangs 103px past the panel's left edge. */
.hero-photo::before {
  content: "";
  position: absolute;
  inset: -27px -21px -27px 103px;
  background: rgba(143, 206, 182, .5);
}
.hero-photo img {
  position: relative; /* keeps the photo painted above the mint panel */
  width: 100%;
  height: auto;
  aspect-ratio: 566 / 580;
  object-fit: cover;
}

.home-cta {
  padding: 0 var(--gutter);
  text-align: right;                  /* CTA sits under the hero photo, in line with its right edge */
  margin-top: clamp(40px, 6vw, 64px); /* snug gap below the hero (mint panel overhang included) */
}
.home-cta a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 600;
  transition: color .2s ease;
}
.home-cta a:hover { color: var(--mint); }

.divider-line { width: 100%; height: 1px; }
.home-divider {
  padding: 0 var(--gutter) clamp(96px, 10vw, 150px); /* empty space below the line */
  margin-top: 28px;                                   /* line sits just under CTA, per Figma */
}
.home-divider img { width: 100%; }

/* ==========================================================================
   WORK
   ========================================================================== */
.work-title {
  font-size: clamp(52px, 6vw, 92px); /* clearly dominates project titles */
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.05;
  padding: 0 var(--gutter);
  margin-top: clamp(40px, 4.5vw, 64px);
}
.work-sub {
  padding: 0 var(--gutter);
  font-size: clamp(19px, 1.9vw, 28px);
  line-height: 1.5;
  max-width: min(920px, 100%);
  text-align: left; /* header reads as one left-aligned block with the H1 */
  margin-top: 20px;
}
/* Hairline closing the header block — echoes the home-page divider */
.work-rule {
  width: calc(100% - (var(--gutter) * 2));
  margin: clamp(32px, 4vw, 56px) auto 0;
  border: none;
  border-top: 1px solid #000;
}
/* First project sits close under the header; later projects keep the big break */
.project:first-of-type { margin-top: clamp(48px, 6vw, 88px); }

/* Uniform stacked layout: text block on top, image underneath — identical for every project */
.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start; /* left edge of every project lines up with SELECTED WORK */
  gap: clamp(32px, 4vw, 56px);
  padding: 0 var(--gutter);
  margin-top: clamp(72px, 10.5vw, 208px);
}
.project-info,
.project-media { width: min(860px, 100%); }

.project-media img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .3s ease, box-shadow .3s ease;
}
.project--border .project-media img { border: 1px solid #000; }

/* 04 — video project: same frame treatment as the case-study images.
   Text sits closer to the video than the image projects' gap. */
.project--video { gap: clamp(20px, 2.5vw, 32px); }
.project-media--video { position: relative; }
.project-media video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}
.project--border .project-media video { border: 1px solid #000; }
/* Transparent tap-catcher over the picture: click = play/pause.
   Bottom 52px stays uncovered so the native control bar works normally. */
.video-tap {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: 52px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* Hero images open the case-study carousel too — show they're clickable */
.project-media[data-carousel] { cursor: pointer; }

/* Case-study image hover: gentle lift + lighter-mint frame + soft glow
   (same treatment on keyboard focus) */
.project-media:hover img,
.project-media[data-carousel]:focus-visible img {
  transform: translateY(-6px);
  box-shadow: 0 0 0 4px var(--mint-line), 0 18px 40px rgba(143, 206, 182, .45);
}
.project-media[data-carousel]:focus-visible {
  outline: 3px solid var(--mint-line);
  outline-offset: 6px;
}

/* Number + title share one baseline-aligned line: "01. BEE & BLOSSOM".
   flex-wrap lets the title drop below its number if a phone is too narrow. */
.project-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 14px;
  min-width: 0;
}
.project-num {
  font-size: clamp(22px, 2.38vw, 34px); /* ~85% of the title — same size optically, not literally */
  font-weight: 400;                   /* lighter than the title's 600 */
}
.project-title {
  font-size: clamp(26px, 2.8vw, 40px); /* smaller + lighter than the H1 so SELECTED WORK leads */
  font-weight: 600;
  line-height: 1.15;
}
.project-tags {
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 600;
  line-height: 1.35;
  margin-top: 10px;
  /* Wraps on phones instead of running off-screen; stays one line on
     desktop/tablet where the full tag list fits the 860px column. */
  white-space: normal;
  overflow-wrap: break-word;
  max-width: 100%;
}
.project-desc {
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.45;
  margin-top: 24px;
}

/* Small project details (role / tools / focus) under the description */
.project-meta {
  display: grid;
  gap: 14px;
  margin-top: 28px;
  font-size: clamp(13px, 1.2vw, 16px);
  line-height: 1.5;
}
.project-meta dt {
  font-weight: 700;
  letter-spacing: .08em;
}
.project-meta dd {
  margin: 2px 0 0;
  font-weight: 500;
}

.case-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(18px, 1.7vw, 24px);
  margin-top: 40px;
  margin-left: -12px;
  padding: 8px 12px;
  transition: background .2s ease;
}
.case-link:hover { background: var(--mint-line); } /* lighter mint, matches arrow tone */

/* Secondary plain text link (external live site) — centered under the hero image */
.case-link--live {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 2px 0;
  font-size: clamp(15px, 1.25vw, 19px);
  font-weight: 500;
  text-align: center;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color .2s ease;
}
.case-link--live:hover {
  text-decoration-thickness: 2px;
  text-decoration-color: var(--mint);
}

.icon-arrow { width: 28px; height: 28px; flex: 0 0 auto; }
/* Figma arrows are corner arrows — rotate to read as ← / → */
.icon-arrow.arrow-left  { transform: rotate(135deg); }
.icon-arrow.arrow-right { transform: rotate(-45deg); }
.case-link:hover .icon-arrow.arrow-left  { transform: rotate(135deg) translateX(-4px); }
.case-link:hover .icon-arrow.arrow-right { transform: rotate(-45deg) translateX(4px); }

/* ==========================================================================
   MORE OF MY WORK — auto-scrolling gallery (bottom of Work page)
   ========================================================================== */
.more-work { margin-top: clamp(96px, 12vw, 176px); }
.more-work-title {
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 500;
  text-align: center;
  padding: 0 var(--gutter);
}
.more-work-sub {
  text-align: center;
  padding: 0 var(--gutter);
  font-size: clamp(16px, 1.5vw, 22px);
  margin-top: 12px;
}
.more-work-strip {
  overflow: hidden;
  padding: 32px 0 8px;
}
.more-work-track {
  display: flex;
  width: max-content;
  animation: more-work-scroll 60s linear infinite;
}
/* Pause the scroll on hover/focus so the mint captions are readable */
.more-work-strip:hover .more-work-track,
.more-work-strip:focus-within .more-work-track { animation-play-state: paused; }
.more-work-set {
  display: flex;
  gap: 20px;
  padding-right: 20px; /* matches the gap so the -50% loop lands seamlessly */
}
@keyframes more-work-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
/* Reduced motion: stop the auto-scroll and restore manual swiping */
@media (prefers-reduced-motion: reduce) {
  .more-work-track { animation: none; }
  .more-work-strip {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
.more-work-item {
  position: relative;
  flex: 0 0 auto;
  border: 1px solid #000;
  margin: 0;
}
.more-work-item img {
  display: block;
  height: clamp(180px, 24vw, 280px);
  width: auto;
}
/* Hover (desktop) / focus (mobile tap): mint overlay + centered title */
.more-work-item figcaption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(143, 206, 182, .88);
  color: var(--ink);
  font-weight: 600;
  font-size: clamp(15px, 1.4vw, 20px);
  padding: 12px;
  opacity: 0;
  transition: opacity .25s ease;
}
.more-work-item:hover figcaption,
.more-work-item:focus-visible figcaption { opacity: 1; }

/* Mobile: the auto-scroll marquee becomes a one-picture carousel — an arrow on
   each side of the picture (js/gallery.js); tapping the picture or an arrow
   pages to the next image. Desktop keeps the seamless auto-scroll. */
.more-work-frame { position: relative; }
.gallery-nav {
  display: none; /* desktop keeps the auto-scrolling marquee */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  padding: 10px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.gallery-prev { left: 2px; }
.gallery-next { right: 2px; }
.gallery-nav:hover .icon-arrow.arrow-left  { transform: rotate(135deg) translateX(-4px); }
.gallery-nav:hover .icon-arrow.arrow-right { transform: rotate(-45deg) translateX(4px); }

@media (max-width: 700px) {
  .gallery-nav { display: flex; }
  .more-work-strip {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-top: 8px;
  }
  .more-work-strip::-webkit-scrollbar { display: none; }
  .more-work-track { animation: none; width: auto; } /* items size to the strip, not max-content */
  .more-work-set { gap: 0; padding-right: 0; }
  .more-work-set[aria-hidden="true"] { display: none; } /* no loop needed when paging */
  .more-work-item {
    flex: 0 0 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    border: 0;                    /* frame moves to the img so it hugs the picture */
    display: flex;
    justify-content: center;
    -webkit-touch-callout: none;
  }
  .more-work-item img {
    height: clamp(220px, 46vw, 320px);
    width: auto;
    max-width: calc(100% - 96px); /* stay clear of the side arrows */
    border: 1px solid #000;
    -webkit-user-drag: none;
  }
  .more-work-item figcaption { display: none; } /* tap = next picture */
}

/* ==========================================================================
   FOOTER (shared: Work + Contact) — #f4f4f6 band, 2px mint box, dark bar
   ========================================================================== */
.site-footer {
  margin-top: clamp(72px, 8vw, 128px);
  background: var(--footer-bg);
  padding: 10px;
}

.footer-box {
  max-width: 1420px;
  margin: 0 auto;
  border: 2px solid var(--mint-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding: clamp(40px, 5vw, 64px) clamp(32px, 6vw, 88px);
}

.footer-cta h2 {
  font-size: clamp(28px, 3.2vw, 48px);
  font-weight: 600;
  letter-spacing: .06em;
}
.footer-cta p {
  font-size: clamp(15px, 1.25vw, 18px);
  font-weight: 500;
  line-height: 1.5;
  margin-top: 14px;
  max-width: 520px;
}

.footer-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
  flex: 0 0 auto;
}
.footer-side .footer-link {
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 600;
  transition: color .2s ease;
}
.footer-side .footer-link:hover { color: var(--mint); }

.footer-icons { display: flex; align-items: center; gap: 28px; }
.footer-icons a { display: block; transition: opacity .2s ease; }
.footer-icons a:hover { opacity: .6; }
.footer-icons .icon-linkedin-sm { width: 82px; height: 59.7px; }
.footer-icons .icon-email-sm    { width: 62px; height: 47.1
}
.footer-contact p a { text-decoration: underline; text-underline-offset: 4px; }
.footer-contact .footer-linkedin { width: 62px; height: 42px; }

.footer-bar {
  background: var(--dark-bar);
  color: #fff;
  font-weight: 500;
  font-size: clamp(12px, 4vw, 20px); /* scales down on phones so the credit always fits one line */
  text-align: center;
  min-height: 54px;             /* grows instead of clipping if text ever wraps */
  display: flex;
  align-items: center;
  justify-content: center;
  justify-content: safe center; /* if it ever overflows, keep the start visible instead of clipping both ends */
  padding: 8px 12px;
  line-height: 1.3;
  white-space: nowrap;          /* hard guarantee: "Cervi" can never drop to its own line */
  -webkit-text-size-adjust: 100%; /* stop iOS Safari from inflating the font */
  text-size-adjust: 100%;
}

/* Footer variant: black bar only, no mint box */
.site-footer.footer-simple {
  padding: 0;
  background: transparent;
  margin-top: clamp(180px, 18.5vw, 272px); /* ~8 lines below last VIEW CASE STUDY */
}

/* Contact: even more air before the footer so the page breathes */
.page-contact .site-footer.footer-simple { margin-top: clamp(200px, 21vw, 310px); }

/* Home: divider's bottom padding already provides the pre-footer air */
.page-home .site-footer.footer-simple { margin-top: 0; }

/* ==========================================================================
   RESUME
   ========================================================================== */
.resume-head { padding: 0 var(--gutter); margin-top: clamp(40px, 4.5vw, 64px); text-align: center; }
.resume-head h1 {
  font-size: clamp(48px, 5.4vw, 76px); /* same dominant hierarchy as Work's SELECTED WORK */
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.05;
  text-wrap: balance; /* wraps evenly if it ever breaks to two lines */
}
.resume-sub {
  font-size: clamp(20px, 2vw, 32px);
  font-weight: 600;
  text-align: center;
  max-width: 1220px;
  margin: 22px auto 0;
}
.resume-intro {
  font-size: clamp(17px, 1.55vw, 22px);
  text-align: center;
  max-width: 1244px;
  margin: 28px auto 0;
  line-height: 1.6;
}

.resume-divider-long {
  width: min(1221px, 100%);
  margin: 64px auto 0;
  display: block;
}

.jobs {
  padding: 0 var(--gutter);
  margin-top: clamp(80px, 9vw, 132px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2×2 experience grid */
  column-gap: clamp(40px, 5vw, 88px);
  row-gap: clamp(48px, 5vw, 72px);
}

.job-title { font-size: clamp(22px, 2.2vw, 32px); font-weight: 500; }
.job-title .job-num { font-weight: 400; }
.job-meta {
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 600;
  margin-top: 10px;
  line-height: 1.5;
}
.job-tags {
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 400;
  margin-top: 6px;
}
.job-desc {
  font-size: clamp(16px, 1.7vw, 24px);
  line-height: 1.45;
  margin-top: 14px;
  max-width: 1100px;
}

/* Section heading above the skills panel — matches EDUCATION's style */
.skills-title {
  font-size: clamp(28px, 2.9vw, 42px);
  font-weight: 400;
  padding: 0 var(--gutter);
  margin-top: clamp(96px, 11vw, 168px);
}
.skills {
  width: min(1264px, calc(100% - (var(--gutter) * 2)));
  margin: clamp(32px, 4vw, 48px) auto 0;
  background: transparent;                 /* mint appears on hover only */
  transition: background .3s ease;
  padding: clamp(48px, 4.5vw, 72px) clamp(32px, 4.5vw, 64px);
  display: grid;
  grid-template-columns: repeat(3, auto);   /* columns size to their content */
  justify-content: space-between;
  gap: clamp(28px, 3vw, 44px);
}
.skills:hover { background: var(--mint-soft); }
.skills h2 { font-size: clamp(28px, 2.8vw, 40px); font-weight: 500; margin-bottom: 24px; }
.skills ul { list-style: disc; padding-left: clamp(20px, 1.5vw, 28px); }
.skills li { font-size: clamp(17px, 1.7vw, 25px); line-height: 1.8; white-space: nowrap; }

.edu { padding: 0 var(--gutter); margin-top: clamp(96px, 11vw, 176px); }
.edu h2 { font-size: clamp(28px, 2.9vw, 42px); font-weight: 400; }
.edu-divider { width: min(586px, 100%); margin-top: 24px; display: block; }
.edu-item-divider { width: min(586px, 100%); margin-top: clamp(48px, 4vw, 64px); display: block; }
.edu-item + .edu-item { margin-top: clamp(48px, 4vw, 64px); }
.edu-item h3 { font-size: clamp(24px, 2.5vw, 36px); font-weight: 500; }
.edu-item p { font-size: clamp(20px, 2.2vw, 32px); margin-top: 6px; }

.resume-download {
  max-width: var(--page-max);
  margin: clamp(96px, 8vw, 136px) auto clamp(48px, 4vw, 60px);
  padding: 0 var(--gutter);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  font-size: clamp(24px, 2.5vw, 36px);
}
.resume-download a {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  transition: color .2s ease;
}
.resume-download a:hover { color: var(--mint); }
.resume-download img { width: 56px; height: 56px; }

/* ==========================================================================
   CONTACT
   ========================================================================== */
.contact-label {
  color: var(--mint);
  font-size: clamp(22px, 2.2vw, 32px);
  padding: 0 var(--gutter);
  margin-top: clamp(48px, 4.5vw, 72px);
}

.contact-title {
  font-size: clamp(44px, 5.6vw, 80px);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  line-height: 1.1;
  padding: 0 var(--gutter);
  margin-top: clamp(112px, 16.6vw, 240px);
}

.contact-blurb {
  font-size: clamp(20px, 2.2vw, 32px);
  letter-spacing: .01em;
  text-align: center;
  max-width: min(952px, 100%);
  line-height: 1.5;
  margin: clamp(28px, 2.2vw, 32px) auto 0;
  padding: 0 24px;
}

.contact-divider-short {
  width: min(481px, 60%);
  margin: clamp(72px, 7.5vw, 112px) auto 0;
  display: block;
}

.contact-cards {
  width: min(726px, calc(100% - (var(--gutter) * 2)));
  margin: clamp(72px, 7.5vw, 112px) auto 0;
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 5vw, 72px);
}
.contact-card {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 40px);
  margin: 0 -16px;                /* bleed out so text/icons don't shift on hover */
  padding: 14px 16px;
  transition: background .2s ease;
}
/* Same mint hover as the Work page case-study links */
.contact-card:hover { background: var(--mint-line); }
.contact-card .card-icon { flex: 0 0 auto; }
.contact-card .icon-email    { width: 100px; height: 68px; }
.contact-card .icon-linkedin { width: 93.4px; height: 68px; }
.contact-card .card-label { font-size: 20px; }
.contact-card .card-value { font-size: clamp(18px, 1.7vw, 24px); letter-spacing: .04em; margin-top: 14px; }

/* Footer: same simple footer as Work (black bar only — .site-footer.footer-simple) */

/* ==========================================================================
   CASE-STUDY CAROUSEL (Work page) — overlay gallery opened from VIEW CASE STUDY
   ========================================================================== */
body.carousel-open { overflow: hidden; } /* lock page scroll while the gallery is open */

.carousel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
}
.carousel[hidden] { display: none; }

.carousel-scrim {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 7, .78);
  cursor: pointer;
}

.carousel-stage {
  position: relative;
  width: min(1100px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--bg);
  padding: clamp(20px, 3.4vw, 44px) clamp(56px, 6vw, 84px) clamp(18px, 2.4vw, 28px);
}

.carousel-viewport { overflow: hidden; }
.carousel-track {
  display: flex;
  transition: transform .35s ease;
}
.carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
/* Render images at native size (never upscale) — keeps low-res exports sharp */
.carousel-slide img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 68vh;
}

/* Per-slide explainer caption under the picture */
.carousel-slide--caption {
  flex-direction: column;
  gap: 14px;
}
.carousel-slide--caption img { max-height: 56vh; } /* leave room for the caption */
.slide-caption {
  max-width: 62ch;
  padding: 0 16px 6px;
  text-align: center;
}
.slide-caption-label {
  font-size: clamp(12px, 1.1vw, 14px);
  font-weight: 700;
  letter-spacing: .08em;
}
.slide-caption-title {
  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 600;
  margin-top: 4px;
}
.slide-caption-text {
  font-size: clamp(13px, 1.2vw, 16px);
  line-height: 1.5;
  margin-top: 8px;
}
.carousel-empty {
  padding: clamp(40px, 8vw, 96px) 0;
  text-align: center;
  font-size: clamp(18px, 1.7vw, 24px);
  color: rgba(7, 7, 7, .55);
}

/* Close — boxed ✕, matches the clickable-card language */
.carousel-close {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #000;
  cursor: pointer;
  transition: background .2s ease;
}
.carousel-close:hover { background: var(--mint-line); }

/* Prev / next — the SAME thin mint corner arrow used next to VIEW CASE STUDY
   (the imgs carry .icon-arrow .arrow-left/.arrow-right so they rotate to read
   ← / →). Plain borderless hit-areas — no white square behind them. */
.carousel-nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 12px;
  cursor: pointer;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
}
.carousel-nav:hover .icon-arrow.arrow-left  { transform: rotate(135deg) translateX(-4px); }
.carousel-nav:hover .icon-arrow.arrow-right { transform: rotate(-45deg) translateX(4px); }
.carousel-prev { left: clamp(10px, 1.6vw, 20px); }
.carousel-next { right: clamp(10px, 1.6vw, 20px); }

.carousel-close {
  top: clamp(10px, 1.6vw, 20px);
  right: clamp(10px, 1.6vw, 20px);
  width: 42px;
  height: 42px;
  font-size: 20px;
  line-height: 1;
}

.carousel-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  font-weight: 600;
}
.carousel-title { font-size: clamp(18px, 1.7vw, 24px); letter-spacing: .04em; }
.carousel-count { font-size: clamp(15px, 1.3vw, 18px); font-weight: 500; color: rgba(7, 7, 7, .6); }

@media (max-width: 700px) {
  .carousel-stage { padding-left: 20px; padding-right: 20px; }
  /* Arrows flank the caption bar at the bottom of the picture, vertically
     centered on the title line (mobile users can also swipe the image) */
  .carousel-nav { width: 44px; height: 44px; padding: 8px; top: auto; bottom: 24px; transform: none; }
  .carousel-prev { left: 4px; }
  .carousel-next { right: 4px; }
  /* Title on one line, page count on its own line beneath — always in line */
  .carousel-caption {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-left: 56px;
    padding-right: 56px;
  }
  .carousel-title {
    font-size: 15px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .carousel-count { font-size: 13px; }
  .carousel-close { top: -52px; right: 0; background: transparent; border-color: #fff; color: #fff; }
  .carousel-close:hover { background: rgba(255, 255, 255, .15); }
  .carousel-slide--caption img { max-height: 48vh; }
  .slide-caption { padding: 0 4px 4px; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .hero-title { white-space: normal; } /* let the title wrap once stacked */
  .hero-photo {
    margin: 64px auto 0;          /* stacked: center the photo */
    justify-self: center;         /* belt-and-suspenders: center in the grid too */
  }
  .skills { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .jobs { grid-template-columns: 1fr; } /* experience grid stacks on smaller screens */
  .hero-photo::before { inset: -18px -12px -18px 56px; } /* scale panel offsets down on small screens */  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    gap: 20px;
    padding: 24px var(--gutter) 32px;
    border-bottom: 1px solid rgba(0, 0, 0, .1);
  }
  body.page-home .main-nav { background: #fff; }
  .nav-open .main-nav { display: flex; }
  .site-header { padding-top: 14px; padding-bottom: 14px; }
  .brand, .brand img { width: 64px; height: 64px; }
  .footer-box { flex-direction: column; align-items: flex-start; }
  .footer-side { align-items: flex-start; }
  .footer-icons { gap: 24px; }
}

@media (max-width: 560px) {
  /* H1 stays on ONE line here — the big clamp() min would wrap "SELECTED WORK" on phones */
  .work-title { font-size: clamp(30px, 8.6vw, 44px); }
  /* Contact on phones: stack the icon over ONE centered line. The addresses
     are too long to sit beside an icon, so they get the card's full width and
     scale with the viewport — they can never wrap mid-word again. */
  .contact-card {
    flex-direction: column;
    align-items: center;          /* fallback */
    align-items: safe center;     /* if a tiny screen ever overflows, keep the start visible */
    gap: 18px;
    margin: 0;                    /* drop the hover bleed so centering is true */
    padding: 14px 8px;
    text-align: center;
  }
  .contact-card .icon-email    { width: 62px; height: auto; }
  .contact-card .icon-linkedin { width: 58px; height: auto; }
  .contact-card .card-label { font-size: 16px; }
  .contact-card .card-value {
    display: block;
    font-size: clamp(13px, 4.2vw, 18px); /* ~16px on a 390px phone — one line, fits */
    letter-spacing: 0;
    white-space: nowrap;          /* hard guarantee: no mid-letter line breaks */
    margin-top: 10px;
  }
}

/* ==========================================================================
   DESKTOP TYPOGRAPHY SCALE (≥1200px) — 2026-09-21
   Refined, slightly smaller type at 100% zoom. Layout, spacing, images and
   hierarchy ratios are untouched; below 1200px every size above still applies.
   H1s ~12–15% smaller; large intro/body copy lands in the 21–24px range.
   ========================================================================== */
@media (min-width: 1200px) {
  /* Home */
  .hero-hi      { font-size: clamp(24px, 1.85vw, 27px); }
  .hero-title   { font-size: clamp(36px, 4vw, 56px); }
  .hero-intro   { font-size: clamp(20px, 1.5vw, 23px); }
  .home-cta a   { font-size: clamp(20px, 1.65vw, 24px); }

  /* Work */
  .work-title     { font-size: clamp(52px, 5.3vw, 78px); }
  .work-sub       { font-size: clamp(19px, 1.6vw, 23px); }
  .project-num    { font-size: clamp(22px, 2.15vw, 30px); }
  .project-title  { font-size: clamp(26px, 2.5vw, 35px); }
  .project-tags   { font-size: clamp(18px, 1.45vw, 21px); }
  .project-desc   { font-size: clamp(18px, 1.55vw, 22px); }
  .case-link      { font-size: clamp(18px, 1.55vw, 22px); }
  .more-work-title{ font-size: clamp(28px, 2.6vw, 38px); }
  .more-work-sub  { font-size: clamp(16px, 1.4vw, 20px); }

  /* Resume */
  .resume-head h1  { font-size: clamp(48px, 4.6vw, 66px); }
  .resume-sub      { font-size: clamp(20px, 1.65vw, 24px); line-height: 1.5; }
  .job-title       { font-size: clamp(22px, 1.95vw, 28px); }
  .job-meta        { font-size: clamp(16px, 1.5vw, 22px); }
  .job-tags        { font-size: clamp(14px, 1.35vw, 19px); }
  .job-desc        { font-size: clamp(16px, 1.55vw, 22px); }
  .skills-title    { font-size: clamp(28px, 2.5vw, 36px); }
  .skills h2       { font-size: clamp(28px, 2.4vw, 34px); }
  .skills li       { font-size: clamp(17px, 1.55vw, 22px); }
  .edu h2          { font-size: clamp(28px, 2.5vw, 36px); }
  .edu-item h3     { font-size: clamp(24px, 2.15vw, 31px); }
  .edu-item p      { font-size: clamp(20px, 1.65vw, 24px); }
  .resume-download { font-size: clamp(24px, 2.1vw, 30px); }

  /* Contact */
  .contact-label            { font-size: clamp(22px, 1.85vw, 27px); }
  .contact-title            { font-size: clamp(44px, 4.85vw, 70px); }
  .contact-blurb            { font-size: clamp(20px, 1.65vw, 24px); }
  .contact-card .card-value { font-size: clamp(18px, 1.55vw, 22px); }

  /* Footer (mint-box pages) */
  .footer-cta h2            { font-size: clamp(28px, 2.8vw, 42px); }
  .footer-side .footer-link { font-size: clamp(16px, 1.4vw, 20px); }
}
