/* ==========================================================================
   ERIK HELMERS — PORTFOLIO STYLES
   --------------------------------------------------------------------------
   Contents
      1. Theme tokens ........... colors, fonts, type scale, spacing  (EDIT ME)
      2. Section themes ......... dark / light surfaces
      3. Base
      4. Layout + type helpers
      5. Components ............. buttons, tags, images, icon buttons
      6. Navigation
      7. Hero
      8. About
      9. Projects
     10. Photography
     11. Experience
     12. Contact + footer
     13. Project detail dialog
     14. Photo lightbox
     15. Motion ................. scroll reveals, reduced motion
   ========================================================================== */


/* ==========================================================================
   1. THEME TOKENS  (EDIT ME)
   Change these values to retheme the whole site.
   If you change the accent, keep --color-accent-ink dark enough to read on
   --color-paper (4.5:1 contrast). Also update the matching colors in 404.html
   and the theme-color meta tag in index.html.
   ========================================================================== */
:root {
  /* Palette */
  --color-ink: #0b0b0a;            /* near-black: dark sections, text on light */
  --color-ink-raised: #171715;     /* image backgrounds on dark */
  --color-paper: #f5f3ee;          /* off-white: light sections, text on dark */
  --color-paper-raised: #e9e6df;   /* image backgrounds on light */
  --color-accent: #a8998a;         /* "Stone": buttons + highlights on dark */
  --color-accent-ink: #6e6253;     /* deeper Stone: accent text on light */
  --color-muted-on-dark: #a3a19b;  /* secondary text on dark */
  --color-muted-on-light: #5e5c57; /* secondary text on light */

  /* Fonts (loaded from Google Fonts in index.html; system fonts used offline) */
  --font-display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* Type scale: clamp(smallest, grows with screen width, largest) */
  --text-hero: clamp(3.25rem, 1.5rem + 7.5vw, 10rem);
  --text-display: clamp(2.5rem, 1.4rem + 4.8vw, 6.75rem);
  --text-title: clamp(1.75rem, 1.35rem + 1.6vw, 2.75rem);
  --text-lead: clamp(1.1875rem, 1rem + 0.8vw, 1.75rem);
  --text-body: 1.0625rem;
  --text-small: 0.9375rem;
  --text-tiny: 0.8125rem;

  --weight-display: 600;
  --tracking-hero: -0.045em;      /* tighter = more negative */
  --tracking-display: -0.035em;
  --tracking-title: -0.025em;

  /* Spacing */
  --gutter: clamp(1rem, 0.4rem + 2.6vw, 3rem);       /* page side margins */
  --section-pad: clamp(6rem, 3rem + 9vw, 11rem);      /* space above + below sections */
  --stack-lg: clamp(3rem, 2rem + 4vw, 6rem);          /* gap between large blocks */
  --stack-md: clamp(1.5rem, 1rem + 1.5vw, 2.5rem);    /* gap between medium blocks */
  --max-width: 90rem;                                 /* content width (1440px) */
  --measure: 42rem;                                   /* comfortable line length */

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --reveal-duration: 1.1s;
  --reveal-distance: 2.5rem;

  --nav-height: 3.5rem;
}


/* ==========================================================================
   2. SECTION THEMES
   Add class="theme-dark" or class="theme-light" to any section.
   Components below read these variables, so they adapt automatically.
   ========================================================================== */
.theme-dark {
  --bg: var(--color-ink);
  --bg-raised: var(--color-ink-raised);
  --fg: var(--color-paper);
  --muted: var(--color-muted-on-dark);
  --accent-text: var(--color-accent);
  --line: color-mix(in srgb, var(--color-paper) 14%, transparent);
  color-scheme: dark;
  background-color: var(--bg);
  color: var(--fg);
}

.theme-light {
  --bg: var(--color-paper);
  --bg-raised: var(--color-paper-raised);
  --fg: var(--color-ink);
  --muted: var(--color-muted-on-light);
  --accent-text: var(--color-accent-ink);
  --line: color-mix(in srgb, var(--color-ink) 12%, transparent);
  color-scheme: light;
  background-color: var(--bg);
  color: var(--fg);
}


/* ==========================================================================
   3. BASE
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html.is-locked {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-ink);
  color: var(--color-paper);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--accent-text, var(--color-accent));
  outline-offset: 3px;
}

[tabindex="-1"]:focus {
  outline: none;
}


/* ==========================================================================
   4. LAYOUT + TYPE HELPERS
   ========================================================================== */
.container {
  width: min(100% - 2 * var(--gutter), var(--max-width));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-pad);
}

/* Two dark sections in a row share one gap instead of two. */
.section.theme-dark + .section.theme-dark {
  padding-top: 0;
}

.section-head {
  max-width: 62rem;
  margin-bottom: var(--stack-lg);
}

.section-head .lead {
  margin-top: var(--stack-md);
}

.eyebrow {
  margin-bottom: 1rem;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--accent-text);
}

.display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display);
  line-height: 1;
  text-wrap: balance;
}

.lead {
  max-width: var(--measure);
  font-size: var(--text-lead);
  line-height: 1.45;
  color: var(--muted);
  text-wrap: pretty;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  color: var(--color-ink);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: none;
}

.noscript {
  color: var(--muted);
}


/* ==========================================================================
   5. COMPONENTS
   ========================================================================== */

/* Icons (inline SVG) */
.icon {
  flex: none;
  width: 1.125em;
  height: 1.125em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn--lg {
  min-height: 3.5rem;
  padding: 1rem 2rem;
  font-size: 1.0625rem;
}

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

.btn--accent:hover {
  background: color-mix(in srgb, var(--color-accent) 78%, var(--color-paper));
}

.btn--solid {
  background: var(--fg);
  color: var(--bg);
}

.btn--solid:hover {
  background: color-mix(in srgb, var(--fg) 82%, var(--bg));
}

.btn-note {
  font-size: 0.875em;
  opacity: 0.6;
}

/* Tags (stack, skills) */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.tags li {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: var(--text-tiny);
  line-height: 1.4;
  color: var(--muted);
}

/* Images. Every image sits in a .media wrapper. If the file is missing,
   main.js adds .is-missing and the wrapper shows its data-label
   (the exact path + size to drop in). */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--bg-raised);
}

/* --focus picks which part of a cropped photo stays in frame ("x% y%",
   0% 0% = top-left). Set per photo in main.js, or inline on the hero. */
.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
}

/* coverFit: "contain" (set per project in main.js): show the whole image and
   fill the leftover space with a blurred, darkened copy of it. */
.media--contain img {
  position: relative;
  object-fit: contain;
}

.media-backdrop {
  position: absolute;
  inset: -12%;
  background-position: center;
  background-size: cover;
  filter: blur(28px) brightness(0.55) saturate(1.15);
}

.media.is-missing {
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 12px,
    color-mix(in srgb, var(--fg) 5%, transparent) 12px 13px
  );
}

.media.is-missing img {
  visibility: hidden;
}

.media.is-missing::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: var(--text-tiny);
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Round icon buttons (close, previous, next) */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--fg) 12%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.icon-btn:hover {
  background: color-mix(in srgb, var(--fg) 22%, transparent);
}

.icon-btn .icon {
  width: 1.25rem;
  height: 1.25rem;
}


/* ==========================================================================
   6. NAVIGATION
   Transparent over the hero, translucent once you scroll. Slides away while
   scrolling down, returns when scrolling up.
   ========================================================================== */
.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-height);
  color: var(--color-paper);
  transition: transform 0.45s var(--ease-out);
}

/* The blur lives on a pseudo-element so the mobile menu can still cover the
   full screen (backdrop-filter would otherwise trap it inside the bar). */
.site-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--color-ink) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--color-paper) 8%, transparent);
  transition: opacity 0.3s ease;
}

.site-nav.is-top::before {
  opacity: 0;
}

.site-nav.is-hidden {
  transform: translateY(-100%);
}

.site-nav:focus-within {
  transform: none;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  color: color-mix(in srgb, var(--color-paper) 72%, transparent);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current] {
  color: var(--color-paper);
}

.nav-toggle {
  display: none;
}

/* Phones: links move into a full-screen menu */
@media (max-width: 47.99rem) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 0.25rem;
    border: 0;
    background: none;
    font-size: var(--text-small);
    cursor: pointer;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    z-index: -1;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
    padding: var(--nav-height) var(--gutter) var(--gutter);
    background: var(--color-ink);
    opacity: 0;
    visibility: hidden;
    /* Hide after the fade out; show instantly so links can take focus. */
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  }

  .nav-links a {
    display: block;
    padding-block: 0.4rem;
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 10vw, 3.25rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--color-paper);
  }

  .site-nav.is-open .nav-links {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s;
  }
}


/* ==========================================================================
   7. HERO
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: calc(var(--nav-height) + 2rem) clamp(5.5rem, 4rem + 6vh, 8.5rem);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: 0;
  animation: hero-settle 2.4s var(--ease-out) both;
}

.hero-media img {
  will-change: transform;
}

.hero-media.is-missing::after {
  place-items: start center;
  padding-top: calc(var(--nav-height) + 2rem);
}

/* Darkens the top (for the nav) and bottom (for the headline) of the photo */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--color-ink) 60%, transparent) 0%,
    transparent 22%,
    transparent 42%,
    color-mix(in srgb, var(--color-ink) 88%, transparent) 100%
  );
}

.hero-content > * {
  animation: rise 1.2s var(--ease-out) both;
}

.hero-content > :nth-child(2) {
  animation-delay: 0.12s;
}

.hero-content > :nth-child(3) {
  animation-delay: 0.24s;
}

.hero-title {
  max-width: 11ch;
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-hero);
  line-height: 0.95;
  text-wrap: balance;
}

.hero-sub {
  max-width: 34rem;
  margin-top: var(--stack-md);
  font-size: var(--text-lead);
  line-height: 1.45;
  color: color-mix(in srgb, var(--color-paper) 78%, transparent);
}

.scroll-cue {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  width: 2.75rem;
  height: 3.5rem;
  overflow: hidden;
  translate: -50% 0;
}

.scroll-cue::before,
.scroll-cue::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 1px;
}

.scroll-cue::before {
  inset-block: 0;
  background: color-mix(in srgb, var(--color-paper) 25%, transparent);
}

.scroll-cue::after {
  top: 0;
  height: 40%;
  background: var(--color-paper);
  animation: cue 2.2s var(--ease-out) infinite;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.75rem);
  }
}

@keyframes hero-settle {
  from {
    opacity: 0.35;
    transform: scale(1.08);
  }
}

@keyframes cue {
  0% { transform: translateY(-100%); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(250%); opacity: 0; }
}


/* ==========================================================================
   8. ABOUT
   ========================================================================== */
.about-grid {
  display: grid;
  gap: var(--stack-lg);
}

.about-copy p {
  font-size: var(--text-lead);
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

/* Phrases wrapped in <strong> show in full-strength color */
.about-copy strong {
  font-weight: 500;
  color: var(--fg);
}

.facts {
  display: grid;
  align-content: start;
  border-bottom: 1px solid var(--line);
}

.facts > div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
}

.facts dt {
  font-size: var(--text-small);
  color: var(--muted);
}

.about-photo {
  aspect-ratio: 4 / 5;
  max-width: 26rem;
}

@media (min-width: 60rem) {
  .about-grid {
    grid-template-columns: 7fr 5fr;
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(3rem, 6vw, 8rem);
  }

  .about-head {
    grid-column: 1 / -1;
  }

  .about-copy,
  .facts {
    grid-column: 1;
  }

  /* Photo fills the right column beside the paragraph and facts. The last
     row stretches to fit it, so the facts stay right under the paragraph. */
  .about-photo {
    grid-column: 2;
    grid-row: 2 / span 2;
    max-width: none;
  }

  .facts {
    align-self: start;
  }
}


/* ==========================================================================
   9. PROJECTS
   ========================================================================== */
.project-grid {
  display: grid;
  gap: clamp(3.5rem, 2.5rem + 3vw, 6rem) clamp(1.5rem, 1rem + 2vw, 3rem);
  padding: 0;
  list-style: none;
}

@media (min-width: 56rem) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.project-link {
  display: block;
  border-radius: var(--radius-lg);
  text-decoration: none;
}

.project-link:focus-visible {
  outline-offset: 8px;
}

.project-card .media {
  aspect-ratio: 16 / 9;
}

.project-card .media img {
  transition: transform 1.2s var(--ease-out);
}

.project-link:hover .media img {
  transform: scale(1.03);
}

.project-body {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
  padding-top: 1.75rem;
}

.project-title {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-title);
  line-height: 1.05;
}

.project-meta {
  font-size: var(--text-small);
  color: var(--muted);
}

.project-summary {
  max-width: 36rem;
  color: color-mix(in srgb, var(--fg) 86%, transparent);
}

.project-body .tags {
  margin-top: 0.25rem;
}

.project-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--accent-text);
}

.project-more .icon {
  transition: transform 0.3s var(--ease-out);
}

.project-link:hover .project-more .icon {
  transform: translateX(4px);
}


/* ==========================================================================
   10. PHOTOGRAPHY
   Grid with 2 / 3 / 4 columns. "wide" photos span 2 columns, "tall" span
   2 rows (set per photo in main.js).
   ========================================================================== */
.gallery {
  --cols: 2;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  grid-auto-rows: clamp(9rem, 17vw, 26rem);
  grid-auto-flow: dense;
  gap: clamp(0.375rem, 0.2rem + 0.5vw, 0.75rem);
  width: min(100% - 2 * var(--gutter), 150rem);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .gallery { --cols: 3; }
}

@media (min-width: 72rem) {
  .gallery { --cols: 4; }
}

.gallery-item {
  min-width: 0;
  min-height: 0;
}

.gallery-item--wide {
  grid-column: span 2;
}

.gallery-item--tall {
  grid-row: span 2;
}

.gallery-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  cursor: zoom-in;
}

.gallery-btn .media {
  height: 100%;
  border-radius: var(--radius-md);
}

/* --zoom (set per photo in main.js) crops in tighter around --focus. */
.gallery-btn img {
  transform: scale(var(--zoom, 1));
  transform-origin: var(--focus, 50% 50%);
  transition: transform 0.9s var(--ease-out);
}

.gallery-btn:hover img {
  transform: scale(calc(var(--zoom, 1) * 1.04));
}


/* ==========================================================================
   11. EXPERIENCE
   ========================================================================== */
.section-head--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--stack-md) 2rem;
  max-width: none;
}

.timeline {
  display: grid;
  gap: var(--stack-lg);
}

.tl-group {
  display: grid;
  gap: 0.5rem 3rem;
}

@media (min-width: 60rem) {
  .tl-group {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
}

.tl-heading {
  padding-top: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: var(--weight-display);
  letter-spacing: -0.02em;
}

.tl-list {
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.tl-item {
  display: grid;
  gap: 0.35rem 2rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 44rem) {
  .tl-item {
    grid-template-columns: 11rem minmax(0, 1fr);
  }
}

.tl-date {
  padding-top: 0.2rem;
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.tl-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: var(--weight-display);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.tl-sub {
  color: var(--muted);
}

.tl-points {
  display: grid;
  gap: 0.5rem;
  max-width: var(--measure);
  margin-top: 0.85rem;
  padding-left: 1.1rem;
}

.tl-points li::marker {
  color: var(--accent-text);
}

.tl-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--accent-text);
  text-decoration: none;
}

.tl-link:hover {
  text-decoration: underline;
}

.tl-item .tags li {
  color: var(--fg);
}


/* ==========================================================================
   12. CONTACT + FOOTER
   ========================================================================== */
.section--contact {
  display: flex;
  align-items: center;
  min-height: 85vh;
  min-height: 85svh;
}

.section--contact .lead {
  margin-top: var(--stack-md);
}

.contact-links {
  margin-top: var(--stack-lg);
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.contact-links a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding-block: clamp(1.25rem, 0.9rem + 1.2vw, 2rem);
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.cl-label {
  grid-column: 1 / -1;
  font-size: var(--text-small);
  color: var(--muted);
}

.cl-value {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 0.9rem + 2.6vw, 3.25rem);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-title);
  line-height: 1.15;
  overflow-wrap: anywhere;
  transition: color 0.25s ease;
}

.cl-arrow {
  width: clamp(1.5rem, 1.2rem + 1vw, 2.25rem);
  height: clamp(1.5rem, 1.2rem + 1vw, 2.25rem);
  color: var(--muted);
  transition: transform 0.35s var(--ease-out), color 0.25s ease;
}

.contact-links a:hover .cl-value,
.contact-links a:hover .cl-arrow {
  color: var(--accent-text);
}

.contact-links a:hover .cl-arrow {
  transform: translate(3px, -3px);
}

@media (min-width: 48rem) {
  .contact-links a {
    grid-template-columns: 9rem minmax(0, 1fr) auto;
  }

  .cl-label {
    grid-column: auto;
  }
}

.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  font-size: var(--text-small);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--fg);
}


/* ==========================================================================
   13. PROJECT DETAIL DIALOG
   ========================================================================== */
dialog {
  padding: 0;
  border: 0;
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.6);
}

.project-dialog,
.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
}

.project-dialog {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.project-dialog[open] {
  animation: sheet-in 0.6s var(--ease-out);
}

.pd-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: 1rem var(--gutter);
  pointer-events: none;
}

.pd-bar .icon-btn {
  pointer-events: auto;
}

.pd-body {
  padding-bottom: var(--section-pad);
}

.pd-head {
  display: grid;
  justify-items: start;
  gap: 1.5rem;
  max-width: 64rem;
  margin-bottom: var(--stack-lg);
}

.pd-head .eyebrow {
  margin-bottom: -0.5rem;
}

.pd-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
}

.pd-facts dt {
  margin-bottom: 0.2rem;
  font-size: var(--text-tiny);
  color: var(--muted);
}

.pd-cta {
  margin-top: 0.5rem;
}

.pd-download {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
}

.pd-download-note {
  font-size: var(--text-small);
  color: var(--muted);
}

.pd-cover {
  aspect-ratio: 16 / 9;
  margin-bottom: var(--stack-lg);
}

.pd-columns {
  display: grid;
  gap: 1.5rem 3rem;
}

@media (min-width: 60rem) {
  .pd-columns {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
}

.pd-subtitle {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: var(--weight-display);
  letter-spacing: -0.02em;
}

.pd-bullets {
  display: grid;
  gap: 1.25rem;
  max-width: 46rem;
  padding-left: 1.25rem;
  font-size: 1.125rem;
  line-height: 1.65;
}

.pd-bullets li::marker {
  color: var(--accent-text);
}

.pd-summary {
  max-width: 46rem;
  font-size: 1.125rem;
  color: var(--muted);
}

.pd-shots {
  display: grid;
  gap: clamp(0.75rem, 0.5rem + 1vw, 1.5rem);
  margin-top: var(--stack-lg);
}

@media (min-width: 48rem) {
  .pd-shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pd-shots .media {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
}

.pd-next {
  display: grid;
  justify-items: start;
  gap: 0.35rem;
  margin-top: var(--stack-lg);
  padding-top: var(--stack-md);
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.pd-next-label {
  font-size: var(--text-small);
  color: var(--muted);
}

.pd-next-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-title);
  transition: color 0.25s ease;
}

.pd-next:hover .pd-next-title {
  color: var(--accent-text);
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
}


/* ==========================================================================
   14. PHOTO LIGHTBOX
   ========================================================================== */
.lightbox {
  background: color-mix(in srgb, var(--color-ink) 97%, transparent);
}

.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: fade-in 0.3s ease;
}

.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--gutter);
}

.lb-count {
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.lb-stage {
  position: relative;
  min-height: 0;
  touch-action: pan-y;
  user-select: none;
}

/* The photo box fills the stage; object-fit: scale-down then shows the WHOLE
   photo, as large as fits but never stretched past its real size.
   Grid framing (focus/zoom) never applies here. */
.lb-media {
  position: absolute;
  inset: 0 var(--gutter);
  border-radius: 0;
  background: none;
}

.lb-media img {
  object-fit: scale-down;
  object-position: 50% 50%;
  transition: opacity 0.35s ease;
}

.lb-media img.is-loading {
  opacity: 0;
}

.lb-media.is-missing {
  inset: 50% auto auto 50%;
  width: min(100% - 2 * var(--gutter), 64rem);
  aspect-ratio: 3 / 2;
  max-height: 100%;
  border-radius: var(--radius-md);
  background-color: var(--bg-raised);
  transform: translate(-50%, -50%);
}

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
}

.lb-prev {
  left: var(--gutter);
}

.lb-next {
  right: var(--gutter);
}

.lb-caption {
  min-height: 4rem;
  padding: 1rem var(--gutter) 1.5rem;
  font-size: var(--text-small);
  color: var(--muted);
  text-align: center;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}


/* ==========================================================================
   15. MOTION
   main.js adds .has-reveal to <html> only when motion is allowed, so content
   is never hidden if JavaScript is off or the visitor prefers less motion.
   ========================================================================== */
.has-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--reveal-duration) var(--ease-out),
    transform var(--reveal-duration) var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}

.has-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Project images settle in from a slight zoom as they appear */
.has-reveal .project-card .media img {
  transform: scale(1.12);
}

.has-reveal .project-card.is-visible .media img {
  transform: none;
}

.has-reveal .project-card.is-visible .project-link:hover .media img {
  transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .scroll-cue::after {
    display: none;
  }
}

@media print {
  .has-reveal [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .site-nav,
  .scroll-cue {
    display: none;
  }
}
