/* ---- common/styles/brand.css ---- */
/* ==========================================================================
   brand.css — The CB Creative design tokens
   Single source of truth for brand styling: color, type, spacing scale.
   Every page/section/common stylesheet should reference these variables
   rather than hardcoding values.
   ========================================================================== */

:root {

  /* ---- Color ---- */
  --color-paper: #F6F3EC;   /* cream — primary light background, and text-on-dark */
  --color-ink: #1C1F16;     /* near-black — primary dark background, and text-on-light */
  --color-forest: #2F3A1F;  /* brand dark green — accents on light backgrounds */
  --color-sage: #93A876;    /* brand light green — accents on dark backgrounds */

  --color-muted-on-light: #6E6B5D; /* body copy over paper */
  --color-muted-on-dark: #9A9789;  /* body copy over ink/forest */
  --color-border: #D9D5C9;         /* hairlines, input underlines, dashed borders */
  --color-cta-bg: #1E2614;         /* slightly deeper green used only behind the CTA band */
  --color-nav-hairline: #D8D5CA;   /* thin bottom border on the light/frosted nav */
  --color-forest-deep: #12160C;    /* darkest green — service card 1 & 2 photo overlays */
  --color-error: #8A2F22;          /* form error text; 7.5:1 on paper */

  /* R,G,B triplets (no rgb() wrapper) for --color-paper/--color-ink, so any
     stylesheet can drop them into rgba(var(--color-paper-rgb), 0.2) for a
     translucent tint instead of re-deriving/hardcoding the same triplet. */
  --color-paper-rgb: 246, 243, 236;
  --color-ink-rgb: 28, 31, 22;
  --color-sage-rgb: 147, 168, 118;
  --color-forest-rgb: 47, 58, 31;

  /* ---- Motion ---- */
  /* Signature "ease out, settle" curve used for every scroll-reveal and
     hover-pop transition on the site — one place to retune the feel. */
  --ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Font families ---- */
  --font-serif: 'Playfair Display', Georgia, serif;       /* headlines */
  --font-serif-accent: 'Cormorant Garamond', serif;       /* italic accents, quote marks */
  --font-sans: 'Geist', system-ui, -apple-system, sans-serif; /* body copy, UI, labels */

  /* ---- Font sizes — desktop scale ---- */
  --fs-hero-headline: 3.5rem;       /* 64px */
  --fs-section-headline: 3.25rem; /* 52px */
  --fs-card-title: 3rem;          /* 48px */
  --fs-quote: 3rem;               /* 48px */
  --fs-body-lg: 1.0625rem;        /* 17px */
  --fs-body: 1rem;                /* 16px */
  --fs-body-sm: 0.9375rem;        /* 15px */
  --fs-label: 0.6875rem;          /* 11px — eyebrows, buttons, form labels */
  --fs-caption: 0.625rem;         /* 10px */

  /* ---- Font sizes — mobile scale ---- */
  --fs-hero-headline-mobile: 2.5rem; /* 40px */
  --fs-section-headline-mobile: 2.375rem; /* 38px */
  --fs-card-title-mobile: 2rem;   /* 32px */

  /* ---- Letter spacing ---- */
  --ls-label: 0.14em;   /* eyebrows */
  --ls-button: 0.12em;  /* buttons */
  --ls-caption: 0.1em;

  /* ---- Line height ---- */
  --lh-tight: 1.08;
  --lh-headline: 1.15;
  --lh-body: 1.6;
  --lh-body-loose: 1.75;

  /* ---- Spacing scale ---- */
  --space-xs: 0.5rem;   /* 8px */
  --space-sm: 1rem;     /* 16px */
  --space-md: 1.5rem;   /* 24px */
  --space-lg: 2rem;     /* 32px */
  --space-xl: 3rem;     /* 48px */
  --space-2xl: 4rem;    /* 64px */
  --space-3xl: 6rem;    /* 96px */

  /* ---- Layout ---- */
  --page-max-width: 1440px;
  --gutter-desktop: 96px;
  --gutter-mobile: 24px;
  --nav-height: 92px;
  --nav-height-mobile: 76px;

  /* ---- Radius (used only for the portfolio card treatment) ---- */
  --radius-card: 20px;
  --radius-card-mobile: 18px;
}

/* ---- common/styles/base.css ---- */
/* ==========================================================================
   base.css — shared component primitives
   Buttons, eyebrows, dividers, numbered markers used across nav, footer,
   and every homepage section. Reference brand.css tokens only.
   ========================================================================== */

/* Border-box everywhere. Without this, `width`/`height` describe only the
   content box, so any element with both an explicit size and padding or a
   border renders wider than asked for and overflows its container — the
   cause of several bugs on this site (a full-width button spilling 74px
   past the page gutter, panels with padding overflowing their column).
   Setting it once here means those cases just work, rather than needing a
   box-sizing declaration remembered at each call site. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  /* Browsers apply an 8px default margin on body — this was never reset,
     so every full-bleed element on the site has had a ~8px cream sliver on
     all four edges the whole time (most visible against a dark full-bleed
     photo, like the contact page, but this was very likely also the root
     cause of the long-standing "white border on the right side" issue
     noticed earlier on the homepage). */
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--color-ink);
  background: var(--color-paper);
  line-height: var(--lh-body);
  overflow-x: hidden;
  max-width: 100%;
}

/* Nav is fixed/out-of-flow (see navigation.css), so every page's content
   needs top padding to clear it — except the home page, which wants its
   hero photo to bleed up behind the translucent nav (see pages/home/home.css). */
main#main-content {
  padding-top: var(--nav-height);
}

@media (max-width: 768px) {
  main#main-content {
    padding-top: var(--nav-height-mobile);
  }
}

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

a {
  color: inherit;
}

/* Visible keyboard-focus ring, sitewide — the browser default outline still
   works without this, but a branded ring in sage is easier to spot against
   both the dark and light sections. :focus-visible (not :focus) so it only
   shows for keyboard/AT navigation, not on every mouse click. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-sage);
  outline-offset: 3px;
}

/* Sage only passes contrast (3:1 non-text minimum) against the dark ink
   sections it was designed for — against the site's light/paper sections
   it drops to ~2.3:1. Swap to forest (10.8:1 on paper) anywhere the focus
   ring lands on a light background instead. */
.services :focus-visible,
.contact :focus-visible,
.nav--light :focus-visible {
  outline-color: var(--color-forest);
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: var(--lh-headline);
}

h1, h2 {
  letter-spacing: 5px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--color-ink);
  color: var(--color-paper);
  padding: 12px 20px;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-caption);
  text-transform: uppercase;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ---- Eyebrow (small caps label + accent line) ---- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-sans) !important;
  font-weight: 500 !important;
  font-size: var(--fs-label) !important;
  letter-spacing: var(--ls-label) !important;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.eyebrow__line {
  display: inline-block;
  width: 18px;
  height: 1px;
  background: currentColor;
  flex-shrink: 0;
}

/* Eyebrow color context: dark sections use sage, light sections use forest */
.hero .eyebrow,
.portfolio-teaser .eyebrow,
.why-not-ai .eyebrow,
.about .eyebrow,
.contact__info .eyebrow,
.thank-you .eyebrow {
  color: var(--color-sage);
}

.services .eyebrow {
  color: var(--color-forest);
}

/* ---- Divider ---- */

.divider {
  border: none;
  height: 1px;
  width: 48px;
  background: var(--color-border);
  margin: var(--space-lg) 0;
}

.why-not-ai .divider {
  background: rgba(var(--color-paper-rgb), 0.2);
  width: 100%;
  max-width: none;
  margin: var(--space-sm) 0;
}

.about .divider,
.contact__info .divider,
.thank-you .divider {
  background: rgba(var(--color-paper-rgb), 0.2);
}

/* ---- Photo panel with Ken Burns zoom ----
   A full-bleed background photo that slowly zooms (see @keyframes below),
   clipped by a static frame (.photo-bg) so the zoom and the dark vignette
   overlay (::after) never move — only the photo itself does. Originated on
   the homepage quote section; reused wherever a panel wants a "living"
   photo behind its text instead of a flat image. Parent needs
   position: relative (and usually overflow: hidden) for this to fill it. */
.photo-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-color: var(--color-ink);
}

.photo-bg__photo {
  position: absolute;
  inset: 0;
  /* Gradient fallback shows if the photo is ever missing; the inline
     background-image set per-usage paints over it. */
  background-image: linear-gradient(160deg, var(--color-forest), var(--color-ink));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: photo-bg-zoom 10s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes photo-bg-zoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-bg__photo {
    animation: none;
  }
}

.photo-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-ink);
  opacity: 0.75;
  box-shadow: inset 0px -6px 20px 0px rgba(0, 0, 0, 0.25), inset 0px 8px 24px 0px rgba(0, 0, 0, 0.35);
}

/* ---- Numbered markers (about list, service cards) ---- */

.num {
  font-family: var(--font-serif-accent);
  font-style: italic;
  color: var(--color-sage);
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* ---- Buttons ---- */

.btn {
  display: inline-block;
  position: relative;
  z-index: 0;
  overflow: hidden;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-button);
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  padding: 18px 36px;
  border: 1px solid transparent;
  transition: color 0.35s ease, border-color 0.2s ease;
  cursor: pointer;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.btn:hover::before {
  transform: scaleX(1);
}

.btn--primary,
.btn--outline {
  background: var(--color-paper);
  color: var(--color-ink);
  border-color: var(--color-ink);
}

.btn--primary:hover,
.btn--outline:hover {
  color: var(--color-paper);
  border-color: var(--color-sage);
}

/* Transparent with a hairline border and cream text — for sitting over a
   dark photo, where the solid cream fill of .btn--primary would be too
   heavy. Shares the base .btn hover sweep, so the ink fill still wipes in
   from the left on hover; the border brightens to full paper to match. */
.btn--ghost {
  background: transparent;
  color: var(--color-paper);
  border-color: rgba(var(--color-paper-rgb), 0.5);
}

.btn--ghost:hover {
  color: var(--color-paper);
  border-color: var(--color-paper);
}

.btn--link {
  padding: 18px 0;
  color: var(--color-paper);
  border: none;
  position: relative;
}

.btn--link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.btn--link:hover::after {
  opacity: 1;
}

.btn--full {
  display: block;
  width: 100%;
}

.text-link {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-button);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-sage);
  border-bottom: 1px solid rgba(var(--color-sage-rgb), 0.4);
  padding-bottom: 4px;
  transition: border-color 0.2s ease;
}

.text-link:hover {
  border-color: var(--color-sage);
}

/* ---- Section transitions ----
   A soft blurred band straddling the seam between stacked homepage
   sections, so hard background-color/photo edges (e.g. cream -> ink)
   blend rather than cut sharply. Purely decorative — no pointer events. */

.about,
.services,
.portfolio-teaser,
.quote,
.why-not-ai,
.cta,
.gallery {
  position: relative;
}

.about::before,
.services::before,
.portfolio-teaser::before,
.quote::before,
.gallery::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 0;
  right: 0;
  height: 120px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 40%, black 60%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 40%, black 60%, transparent);
  pointer-events: none;
  z-index: 5;
}


/* ---- common/navigation/navigation.css ---- */
/* ---- Navigation (common component) ---- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
  box-sizing: border-box;
  padding: 0 var(--gutter-desktop);
  border-bottom: 1px solid rgba(var(--color-ink-rgb), 0.1);
  box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.22);
}

/* Translucent overlay layer, separated so opacity/blur don't affect the
   logo/links sitting on top of it. Default = dark overlay for sitting on
   top of the hero photo. .nav--light = frosted cream, for sections with
   no photo behind the nav (portfolio, contact). */
.nav::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(var(--color-ink-rgb), 0.88), rgba(var(--color-ink-rgb), 0));
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.nav--light::before {
  background: var(--color-paper);
  opacity: 0.82;
}

.nav__logo {
  display: block;
  line-height: 0;
}

.nav__logo img {
  height: 64px;
  width: auto;
}

.nav__links ul {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav__links a {
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-paper);
  transition: color 0.2s ease;
}

.nav--light .nav__links a {
  color: var(--color-ink);
}

.nav__links a:hover {
  color: var(--color-sage);
}

.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--color-sage);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav__links a[aria-current='page'] {
  color: var(--color-sage);
}

.nav--light .nav__links a[aria-current='page'] {
  color: var(--color-forest);
}

.nav__links a[aria-current='page']::after {
  background: var(--color-sage);
  transform: scaleX(1);
}

.nav--light .nav__links a[aria-current='page']::after {
  background: var(--color-forest);
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--color-paper);
  transition: background 0.2s ease, transform 0.3s ease, opacity 0.2s ease;
}

.nav--light .nav__hamburger span {
  background: var(--color-ink);
}

/* Morph into an X when the mobile menu is open. */
.nav__hamburger[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav__hamburger[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 40px;
  position: fixed;
  top: var(--nav-height-mobile);
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: var(--color-ink);
  padding: var(--space-lg) var(--gutter-mobile);
}

.mobile-menu.open {
  display: flex;
}

/* The nav's drop shadow is meant to lift it off the hero photo behind it —
   with the mobile menu open, that same shadow bleeds onto the menu's solid
   background and reads as a gap. Suppress it while the menu is open. */
.nav:has(~ .mobile-menu.open) {
  box-shadow: none;
}

.mobile-menu a {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-body-sm);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-paper);
}

@media (max-width: 768px) {
  .nav {
    height: var(--nav-height-mobile);
    padding: 0 var(--gutter-mobile);
  }

  /* The mobile nav bar is 76px tall, so the logo can comfortably take ~54px
     and still leave breathing room above and below. At 42px it read as
     undersized next to the hamburger and lost the wordmark's legibility. */
  .nav__logo img {
    height: 54px;
  }

  .nav__links {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }
}

/* ---- common/footer/footer.css ---- */
/* ---- Footer (common component) ---- */

.site-footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-ink);
  padding: var(--space-lg) var(--gutter-desktop);
  border-top: 1px solid rgba(var(--color-paper-rgb), 0.1);
}

.site-footer__logo {
  display: block;
  line-height: 0;
}

.site-footer__logo img {
  height: 44px;
  width: auto;
}

.site-footer__copy {
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  color: var(--color-sage);
}

@media (max-width: 768px) {
  .site-footer {
    padding: var(--space-lg) var(--gutter-mobile);
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  /* Soft blend from the CTA section above into the footer, replacing the
     hard border-top with a gentle blurred seam on mobile. */
  .site-footer {
    border-top: none;
  }

  .site-footer::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 120px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 40%, black 60%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 40%, black 60%, transparent);
    pointer-events: none;
    z-index: 5;
  }
}

/* ---- common/reveal/reveal.css ---- */
/* ---- Scroll reveal (common) ----
   Elements marked [data-reveal] start faded out, slightly lowered, and
   slightly scaled down, then ease up to full size as they scroll into
   view (see reveal.js) — reads as the content gently zooming into place
   rather than just fading. Purely decorative — content is never hidden
   if JS doesn't run. */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px) scale(0.94);
  transition: opacity 1.4s var(--ease-reveal),
    transform 1.4s var(--ease-reveal);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stagger multi-item groups so they cascade in rather than popping
   together all at once. */
.service-card:nth-child(2) {
  transition-delay: 0.12s;
}

.service-card:nth-child(3) {
  transition-delay: 0.24s;
}

.portfolio-card:nth-child(2) {
  transition-delay: 0.08s;
}

.portfolio-card:nth-child(3) {
  transition-delay: 0.16s;
}

.portfolio-card:nth-child(4) {
  transition-delay: 0.24s;
}

.faq-row:nth-child(3) {
  transition-delay: 0.08s;
}

.faq-row:nth-child(4) {
  transition-delay: 0.16s;
}

.field:nth-child(2) {
  transition-delay: 0.05s;
}

.field:nth-child(3) {
  transition-delay: 0.1s;
}

.field:nth-child(4) {
  transition-delay: 0.15s;
}

.field:nth-child(5) {
  transition-delay: 0.2s;
}

.field:nth-child(6) {
  transition-delay: 0.25s;
}

/* (7) is the file upload — previously missed, so it arrived before the
   fields above it. */
.field:nth-child(7) {
  transition-delay: 0.3s;
}

/* The submit button sits below the fold of the form's own scroll container,
   so unlike the fields above it, it's never part of the arrival cascade — it
   reveals only once the user scrolls down to reach it. Making them then sit
   through the full 1.4s fade reads as the button being slow to load. */
.form > .btn--full {
  transition-delay: 0.06s;
  transition-duration: 0.5s;
}

/* No motion for anyone who's asked for it, and no invisible content if JS
   never runs (script removes .no-js from <html> as soon as it executes). */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

/* ---- pages/portfolio/portfolio.css ---- */
/* ---- Portfolio page ---- */

/* Cream header, matching the left-aligned eyebrow/headline/intro stack the
   rest of the site uses. */
.portfolio-header {
  background: var(--color-paper);
  padding: var(--space-3xl) var(--gutter-desktop) var(--space-2xl);
}

.portfolio-header h1 {
  font-size: var(--fs-hero-headline);
  color: var(--color-ink);
  margin: var(--space-md) 0 var(--space-lg);
  max-width: 14em;
}

.portfolio-header__intro {
  font-size: var(--fs-body-sm);
  color: var(--color-muted-on-light);
  line-height: var(--lh-body-loose);
  max-width: 32em;
  margin: 0;
}

/* Dark gallery band — the cards read as lit objects sitting forward off a
   deep background, which is what sells the "popping out" effect more than
   the shadow alone does. */
.gallery {
  background: var(--color-ink);
  padding: var(--space-3xl) var(--gutter-desktop);
}

.gallery__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xl);
}

/* ---- Portfolio card ----
   Sized by aspect-ratio rather than a fixed height so the photo is never
   letterboxed or unpredictably cropped — it matches the source asset's
   920x1200 proportions exactly. */
.portfolio-card {
  position: relative;
  flex: 0 1 400px;
  /* The source photo's own proportions (920x1200), so it fills the card
     without cropping at whatever width the flex-basis above is set to —
     resize the card by changing that one number, not this. */
  aspect-ratio: 920 / 1200;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: visible;
  border-radius: 2px;
  background: var(--color-ink);
  /* Layered shadow: a tight contact shadow plus two progressively wider,
     softer ones. Multiple shadows at different spreads read as a real
     object lifted off the surface; a single large blur just looks like a
     grey haze behind the card. */
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.4),
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 40px 80px rgba(0, 0, 0, 0.35);
  transition: transform 0.5s var(--ease-reveal), box-shadow 0.5s ease;
}

/* Grows and lifts on hover, the same language as the homepage service
   cards — deeper shadow as it rises, photo zooming gently behind the
   still-sharp text. */
.portfolio-card:hover {
  transform: scale(1.04);
  z-index: 2;
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.45),
    0 30px 60px rgba(0, 0, 0, 0.55),
    0 60px 110px rgba(0, 0, 0, 0.45);
}

/* Clipping lives here, not on the card — the card has to stay
   overflow: visible or its drop shadow would be cut off. */
.portfolio-card__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
}

.portfolio-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.portfolio-card:hover .portfolio-card__media img {
  transform: scale(1.06);
}

/* Two-part scrim over the photo. The flat ink wash is the site's standard
   photo overlay (same treatment as .service-card--photo and .photo-bg);
   the gradient layered on top deepens toward the bottom so the copy sits
   on near-solid ink and clears WCAG contrast no matter what the photo is
   doing behind it. */
.portfolio-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(var(--color-ink-rgb), 0) 30%,
      rgba(var(--color-ink-rgb), 0.75) 70%,
      rgba(var(--color-ink-rgb), 0.94) 100%
    ),
    rgba(var(--color-ink-rgb), 0.45);
}

/* Pill tag, top-left — cream on ink, the inverse of the site's buttons. */
.portfolio-card__tag {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 2;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: 100px;
}

.portfolio-card__text {
  position: relative;
  z-index: 1;
  padding: var(--space-lg);
  color: var(--color-paper);
}

.portfolio-card__category {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--color-sage);
  margin: 0 0 var(--space-sm);
}

/* letter-spacing: normal overrides the 5px tracking base.css puts on all
   h2s — at card-title size on a photo, that tracking reads as broken
   rather than editorial. */
.portfolio-card__text h2 {
  font-size: var(--fs-card-title);
  letter-spacing: normal;
  color: var(--color-paper);
  margin: 0 0 var(--space-sm);
}

/* Stretched link: the <a> wraps only the title (so its accessible name is
   the project name), but its ::after covers the whole card, making the
   entire card clickable. Cards without an href render plain text instead
   and stay non-interactive. */
.portfolio-card__link {
  text-decoration: none;
  color: inherit;
}

.portfolio-card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
}

/* The focus ring goes on the stretched box, not the text, so keyboard
   focus outlines the whole card — matching where a click would land. */
.portfolio-card__link:focus-visible {
  outline: none;
}

.portfolio-card__link:focus-visible::after {
  outline: 2px solid var(--color-sage);
  outline-offset: 4px;
}

.portfolio-card__desc {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body);
  color: var(--color-muted-on-dark);
  margin: 0;
}

.gallery__caption {
  text-align: center;
  font-family: var(--font-serif-accent);
  font-style: italic;
  font-size: var(--fs-body);
  color: var(--color-muted-on-dark);
  margin: var(--space-2xl) 0 0;
}

/* The hover growth is decorative — anyone who's asked for reduced motion
   gets the shadow change only, with no movement. */
@media (prefers-reduced-motion: reduce) {
  .portfolio-card,
  .portfolio-card__media img {
    transition: box-shadow 0.5s ease;
  }

  .portfolio-card:hover,
  .portfolio-card:hover .portfolio-card__media img {
    transform: none;
  }
}

@media (max-width: 768px) {
  .portfolio-header {
    padding: var(--space-xl) var(--gutter-mobile);
  }

  .portfolio-header h1 {
    font-size: var(--fs-hero-headline-mobile);
  }

  .gallery {
    padding: var(--space-xl) var(--gutter-mobile);
  }

  .portfolio-card {
    flex-basis: 100%;
  }

  /* The photo's scale is driven directly by scroll position on mobile (see
     initCardScrollScale in reveal.js) — no transition, so it tracks the
     scroll 1:1 instead of lagging behind it. */
  .portfolio-card__media img {
    transition: none;
  }

  .portfolio-card__text {
    padding: var(--space-md);
  }
}
