:root {
  --bg-start: #fdf1e2;
  --bg-end: #f5c6c2;
  --bg: #fbe3da;
  --fg: #33513f;
  --muted: #8a9182;
  --accent: #33513f;
  --marquee-color: #e8628f;
  --card-bg: #fffdf9;
  --about-line: #c96ca4; /* matched to the pink shorts in me.JPEG */
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end)) fixed;
  color: var(--fg);
  font-family: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  position: relative;
  overflow-x: hidden;
}

/* Reactive background glow */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(
    38vw circle at var(--mx, 50%) var(--my, 35%),
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0) 65%
  );
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 8vw;
  border-bottom: 1px solid rgba(51, 81, 63, 0.18);
}

.site-logo {
  height: 4rem;
  width: auto;
  display: block;
  mix-blend-mode: multiply;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 3.25rem;
}

.site-nav a {
  color: var(--fg);
  text-decoration: none;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.site-nav a:hover {
  opacity: 1;
}

/* Bio */
.bio {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 8vw;
}

.bio-heading {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.bio-eyebrow {
  margin: 0;
  font-size: clamp(1.82rem, 3.64vw, 2.66rem);
  font-weight: 400;
  color: var(--fg);
}

.bio-name {
  font-size: clamp(9rem, 28.5vw, 21rem);
  font-weight: 500;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: -0.05em 0 1.5rem;
  color: var(--fg);
}

.bio-text {
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--fg);
  opacity: 0.75;
  margin: 2.5rem 0 0;
}

/* Marquee */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  padding: 0.85rem 0;
}

.marquee-track {
  display: inline-flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}

.marquee-track--reverse {
  animation-name: marquee;
  animation-duration: 44s;
  animation-direction: reverse;
}

.marquee-track span {
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 1.5rem;
  color: var(--marquee-color);
}

.marquee-track span:not(:last-child)::after {
  display: none;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Heart line */
.heart-line {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  min-height: 40vh;
  padding: 4rem 8vw 5rem;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
  border-radius: 0 0 56px 56px;
}

.heart-line-content {
  width: 100%;
  border-bottom: 1px solid rgba(51, 81, 63, 0.18);
  padding-bottom: 1.5rem;
}

.heart-line p {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-size: clamp(1.2rem, 2.1vw, 1.6rem);
  font-style: italic;
  color: var(--fg);
}

.heart-line-arrow {
  font-style: normal;
  font-size: 1.3rem;
  animation: heart-line-arrow-bounce 2s ease-in-out infinite;
}

@keyframes heart-line-arrow-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

/* Dark section (everything beneath the marquee) */
.dark-section {
  margin-top: -56px;
  background: #000;
  color: #f5f2ec;
}

/* Projects */
.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  padding: 5rem 8vw;
}

/* Small credit line under the project grid (grid sits on a dark section) */
.built-credit {
  margin: -2.5rem 0 0;
  padding: 0 8vw 4rem;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: rgba(245, 242, 236, 0.5);
}

.project-card {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.project-media {
  position: relative;
  height: 45vh;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-media {
  transform: scale(1.02);
}

.project-card:hover .project-media::after {
  opacity: 1;
}

.project-card-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.project-card:hover .project-card-info {
  opacity: 1;
  transform: translateY(0);
}

/* Touch devices (no mouse to hover, e.g. phones): the title + tags can't be
   revealed on hover, so show them — and their dark scrim — permanently. */
@media (hover: none) {
  .project-media::after {
    opacity: 1;
  }
  .project-card-info {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card-info h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  color: #fff;
}

.project-card-tags {
  margin: 0.6rem 0 0;
  font-size: 1.05rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
}

.project-card-tags span {
  margin-left: 1.5rem;
}

.placeholder-media {
  background: repeating-linear-gradient(
    45deg,
    #1c1c1c,
    #1c1c1c 12px,
    #262626 12px,
    #262626 24px
  );
}

.cover-image {
  background-size: cover;
  background-position: center;
}

/* "Coming soon" teaser card — not clickable, always shows its message. */
.project-card--soon {
  cursor: default;
}

.project-soon-media {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background: #faf6f0;
  border: 2px dashed rgba(0, 0, 0, 0.2);
}

/* Neutralise the hover behaviours the other cards use. */
.project-card--soon:hover .project-media {
  transform: none;
}
.project-soon-media::after {
  display: none;
}

.project-soon-content {
  max-width: 24rem;
}

.project-soon-eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--marquee-color);
  margin-bottom: 1rem;
}

.project-soon-media h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  color: #111;
}

.project-soon-media p {
  margin: 0;
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.6);
}

/* Gentle pulsing dots — a quiet "in progress" cue. */
.project-soon-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
}

.project-soon-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--marquee-color);
  opacity: 0.35;
  animation: soon-pulse 1.4s ease-in-out infinite;
}

.project-soon-dots span:nth-child(2) {
  animation-delay: 0.2s;
}
.project-soon-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes soon-pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* Contact */
.contact {
  padding: 6rem 8vw 8rem;
}

.contact h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(245, 242, 236, 0.6);
  margin: 0 0 1.5rem;
}

.contact-link {
  font-size: clamp(2rem, 6vw, 4rem);
  color: #fff;
  text-decoration: none;
  border-bottom: 2px solid #fff;
}

/* Case study (project detail takeover) */
.case-study {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
}

.case-study.open {
  opacity: 1;
  visibility: visible;
}

.case-scroll {
  height: 100%;
  overflow-y: auto;
  padding-top: 7.5rem;
  color: #f5f2ec;
}

.case-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 8vw;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(245, 242, 236, 0.15);
  z-index: 10;
}

.case-logo-link {
  display: block;
  line-height: 0;
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.case-logo-link:hover {
  opacity: 0.75;
}

.case-logo {
  height: 4rem;
  width: auto;
  display: block;
  filter: invert(1) brightness(1.6);
}

.case-topbar-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.case-topbar .site-nav a {
  color: #f5f2ec;
}

.case-hero {
  height: 70vh;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  transition: transform 1.1s ease;
}

.case-study.open .case-hero {
  transform: scale(1);
}

.case-header {
  max-width: 68ch;
  padding: 3.5rem 8vw 2.5rem;
}

.case-header h2 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
  color: #f5f2ec;
}

.case-meta {
  margin: 0 0 1.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(245, 242, 236, 0.6);
}

.case-overview {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.6;
  color: rgba(245, 242, 236, 0.75);
}

/* Story layout (art-directed project breakdown) */
.case-story {
  padding: 0 8vw 6rem;
}

.case-story-row {
  margin-bottom: 2.5rem;
}

.case-story-row img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

.case-arch {
  border-radius: 32px;
  overflow: hidden;
}

/* Round the image itself too, so the arched corners stay visible even when an
   image is scaled down with `zoom` (a transform that insets the image inside
   its wrapper, leaving the wrapper's rounded corners in the empty margin). */
.case-arch img {
  border-radius: 32px;
}

/* Row: intro (title + tags + text on the left, image on the right) */
.case-story-intro {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 4vw;
  align-items: stretch;
  padding-top: 1.5rem;
}

.case-story-intro-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.case-story-intro-text h2 {
  font-size: clamp(2.7rem, 6.1vw, 4.4rem);
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
  color: #f5f2ec;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.case-tag {
  padding: 0.4rem 1.1rem;
  font-size: 0.85rem;
  border: 1px solid rgba(245, 242, 236, 0.4);
  border-radius: 999px;
  color: rgba(245, 242, 236, 0.85);
}

.case-story-intro-text p {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  line-height: 1.6;
  color: rgba(245, 242, 236, 0.7);
}

.case-story-intro-text-bold {
  font-weight: 700;
  color: rgba(245, 242, 236, 0.9) !important;
}

/* Hero image stretches to exactly match the text column's height, so the
   title lines up with the top of the image and the last paragraph lines up
   with the bottom — consistent on every screen size and both projects. */
.case-story-intro-image {
  position: relative;
  align-self: stretch;
  min-height: 55vh;
}

.case-story-intro-image > a {
  position: absolute;
  inset: 0;
  display: block;
}

/* Row: pair (two images side by side) */
.case-story-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.case-story-pair > div {
  height: 55vh;
}

.case-story-pair--tall > div {
  height: auto;
  aspect-ratio: 3 / 4;
}

/* Row: solo landscape image */
.case-story-solo {
  height: 60vh;
}

/* Row: flexible multi-column layout. Images size to their natural aspect and
   the columns top-align, so there's no letterbox/blank space and every column's
   top edge lines up. Match two images' heights by tuning their column "flex". */
.case-story-columns {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.case-story-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.case-story-col-cell > a {
  height: auto !important; /* override buildStoryImage's inline height:100% */
}

.case-story-columns .case-story-col-cell img {
  height: auto; /* natural aspect — no cover-crop, no letterboxing */
  object-fit: contain;
}

.case-story-col-text-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-story-col-text {
  margin: 0;
  padding: 0 0.25rem;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(245, 242, 236, 0.6);
}

/* Row: feature (explanatory text on the left, one important image on the
   right shown large at its natural aspect, text vertically centred beside it) */
.case-story-feature {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 4vw;
  align-items: center;
}

.case-story-feature-text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.case-story-feature-heading {
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #f5f2ec;
  margin: 0;
}

.case-story-feature-text p {
  font-size: 1.3rem;
  line-height: 1.6;
  color: rgba(245, 242, 236, 0.7);
  margin: 0;
}

.case-story-feature-image > a {
  display: block;
  height: auto !important; /* natural aspect, not the forced 100% */
}

.case-story-feature .case-story-feature-image img {
  height: auto;
  object-fit: contain;
}

/* Row: filler text spacer */
.case-story-text {
  max-width: 90ch;
  margin: 4rem auto;
  padding: 0 2rem;
  text-align: center;
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.7;
  color: rgba(245, 242, 236, 0.6);
}

.case-story-link {
  color: #e8628f;
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 98, 143, 0.5);
  padding-bottom: 2px;
  font-style: normal;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.case-story-link:visited {
  color: #e8628f;
}

.case-story-link:hover {
  color: #f083a6;
  border-color: #f083a6;
}

/* Row: inline, responsive YouTube embed */
.case-story-embed {
  display: flex;
  justify-content: center;
}

.case-embed-frame {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
}

.case-embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Row: looping video with its black background blended out to transparent */
.case-story-video {
  position: relative;
  display: flex;
  justify-content: center;
}

.case-story-video video {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 495px;
  height: auto;
}

/* Decorative reformer springs in the blank space either side of the phone */
.case-story-springs {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2.4rem;
  color: #f5f2ec;
  pointer-events: none;
  overflow: hidden;
}
.case-story-springs--left {
  left: 0;
  right: calc(50% + 275px);
}
.case-story-springs--right {
  right: 0;
  left: calc(50% + 275px);
}
.case-story-springs .spring {
  opacity: 0.15;
  animation: spring-breathe 6.5s ease-in-out infinite;
}
/* springs reach toward the phone: left ones grow rightward, right ones leftward */
.case-story-springs--left .spring {
  transform-origin: right center;
}
.case-story-springs--right .spring {
  transform-origin: left center;
}
@keyframes spring-breathe {
  0%,
  100% {
    transform: scaleX(0.9);
    opacity: 0.12;
  }
  50% {
    transform: scaleX(1.12);
    opacity: 0.2;
  }
}
@media (max-width: 860px) {
  .case-story-springs {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .case-story-springs .spring {
    animation: none;
  }
}

.case-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 12vw;
  gap: 0.75rem;
  padding: 0 8vw 6rem;
}

.case-gallery a {
  display: block;
  overflow: hidden;
  border-radius: 4px;
}

.case-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.4s ease;
}

.case-gallery a:hover img {
  transform: scale(1.05);
}

.case-gallery a:nth-child(6n + 1) {
  grid-column: span 4;
  grid-row: span 2;
}

.case-gallery a:nth-child(6n + 2) {
  grid-column: span 2;
  grid-row: span 1;
}

.case-gallery a:nth-child(6n + 3) {
  grid-column: span 2;
  grid-row: span 1;
}

.case-gallery a:nth-child(6n + 4) {
  grid-column: span 3;
  grid-row: span 1;
}

.case-gallery a:nth-child(6n + 5) {
  grid-column: span 3;
  grid-row: span 2;
}

.case-gallery a:nth-child(6n + 6) {
  grid-column: span 6;
  grid-row: span 1;
}

/* Showcase sections (bento-style project breakdown) */
.case-sections {
  padding: 1rem 8vw 6rem;
}

.case-section {
  padding: 3.5rem 0;
  border-top: 1px solid rgba(245, 242, 236, 0.12);
}

.case-section:first-child {
  border-top: none;
}

.case-section-title {
  display: inline-block;
  margin: 0 0 1.25rem;
  padding: 0.4rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #000;
  background: var(--marquee-color);
  border-radius: 999px;
}

.case-section-text {
  max-width: 60ch;
  margin: 0 0 2rem;
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.6;
  color: rgba(245, 242, 236, 0.65);
}

.case-bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 11vw;
  gap: 1rem;
}

.case-bento-item {
  display: block;
  grid-column: span 2;
  grid-row: span 1;
  overflow: hidden;
  border-radius: 18px;
  background: #f5f2ec;
  padding: clamp(0.9rem, 1.8vw, 1.75rem);
}

.case-bento-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transition: transform 0.4s ease;
}

.case-bento-item:hover img {
  transform: scale(1.04);
}

/* Full-bleed photographic tiles */
.case-bento-item--cover {
  padding: 0;
  background: #000;
}

.case-bento-item--cover img {
  object-fit: cover;
}

.case-bento-item:nth-child(5n + 1) {
  grid-column: span 4;
  grid-row: span 2;
}

.case-bento-item:nth-child(5n + 4) {
  grid-column: span 2;
  grid-row: span 2;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 88vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
}

.lightbox-close {
  top: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.4rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  font-size: 1.75rem;
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

@media (max-width: 1000px) {
  .projects {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Scale the hero word down so it stops overflowing on tablets. The
     desktop clamp has a 9rem floor that is far too large below ~1000px. */
  .bio-name {
    font-size: clamp(5.5rem, 19vw, 15rem);
  }

  .bio-text {
    font-size: 1.3rem;
  }
}

@media (max-width: 700px) {
  /* Make the Work / About Me nav clearer and easier to tap on phones */
  .site-header {
    padding: 1rem 5vw;
    gap: 0.75rem;
  }

  .site-logo {
    height: 2.5rem;
  }

  .site-nav {
    gap: 1rem;
    flex-shrink: 0;
  }

  .site-nav a {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 1;
    white-space: nowrap;
  }

  /* Hero: shrink the giant "Portfolio" word so it fits within the
     viewport instead of spilling off both edges, and tighten spacing. */
  .bio {
    min-height: 72vh;
    padding: 2.5rem 6vw 1rem;
  }

  .bio-eyebrow {
    font-size: clamp(1.4rem, 6vw, 2rem);
  }

  .bio-name {
    font-size: clamp(3.75rem, 18vw, 8rem);
    margin-bottom: 1rem;
  }

  .bio-text {
    font-size: 1.2rem;
    margin-top: 2rem;
  }

  .marquee {
    padding: 0.6rem 0;
  }

  .marquee-track span {
    padding: 0 1rem;
  }

  .heart-line {
    min-height: 32vh;
    padding: 3rem 6vw 3.5rem;
    border-radius: 0 0 40px 40px;
  }

  .projects {
    grid-template-columns: 1fr;
    padding: 3rem 6vw;
  }

  .case-hero {
    height: 40vh;
  }

  .case-header {
    padding: 2.5rem 6vw 2rem;
  }

  .case-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 32vw;
    padding: 0 6vw 4rem;
  }

  .case-gallery a:nth-child(6n + 1),
  .case-gallery a:nth-child(6n + 5) {
    grid-column: span 2;
    grid-row: span 1;
  }

  .case-gallery a:nth-child(6n + 2),
  .case-gallery a:nth-child(6n + 3),
  .case-gallery a:nth-child(6n + 4),
  .case-gallery a:nth-child(6n + 6) {
    grid-column: span 1;
  }

  .case-topbar {
    padding: 1rem 6vw;
  }

  .case-topbar-right {
    gap: 1rem;
  }

  .case-topbar .site-nav {
    gap: 1.25rem;
  }

  .case-topbar .site-nav a {
    font-size: 0.85rem;
  }

  .case-scroll {
    padding-top: 6rem;
  }

  .case-story {
    padding: 0 6vw 4rem;
  }

  .case-story-intro {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .case-story-intro-text {
    height: auto;
  }

  .case-story-intro-image {
    height: 45vh;
    min-height: 0;
    order: -1;
  }

  .case-story-pair {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .case-story-pair > div {
    height: 40vh;
  }

  .case-story-pair--tall > div {
    height: auto;
    aspect-ratio: 3 / 4;
  }

  .case-story-solo {
    height: 35vh;
  }

  .case-story-columns {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .case-story-feature {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .case-story-feature-image {
    order: -1;
  }

  .case-story-col {
    transform: none !important;
  }

  .case-arch {
    border-radius: 20px;
  }

  .case-sections {
    padding: 1rem 6vw 4rem;
  }

  .case-bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 38vw;
  }

  .case-bento-item,
  .case-bento-item:nth-child(5n + 1),
  .case-bento-item:nth-child(5n + 4) {
    grid-column: span 1;
    grid-row: span 1;
  }

  .lightbox-nav {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.4rem;
  }
}

/* Extra-small phones: keep the header on one line and the hero readable */
@media (max-width: 400px) {
  .site-header {
    padding: 0.9rem 4vw;
    gap: 0.5rem;
  }

  .site-logo {
    height: 2rem;
  }

  .site-nav {
    gap: 0.6rem;
  }

  .site-nav a {
    font-size: 0.95rem;
    letter-spacing: 0.02em;
  }

  .bio-name {
    font-size: clamp(3rem, 17vw, 5rem);
  }

  .bio-text {
    font-size: 1.1rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   About Me page
   ───────────────────────────────────────────────────────────── */
.site-nav a.is-current {
  border-bottom: 2px solid var(--fg);
  padding-bottom: 2px;
}

/* Hero photo with the interactive story line drawn over it */
.about-hero {
  position: relative;
  width: 100%;
  height: 82vh;
  min-height: 520px;
  overflow: hidden;
}

.about-hero-photo {
  position: absolute;
  inset: 0;
  background:
    url("../me.JPEG") center 42% / cover no-repeat,
    linear-gradient(135deg, #efd9c6, #e7bfb4);
}

.about-wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.about-wave path {
  fill: none;
  stroke: var(--about-line);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

/* "Start here :)" cue, top-right, pointing to where the line begins */
.about-start {
  position: absolute;
  top: 7%;
  right: 6%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.about-start-arrow {
  width: clamp(46px, 5vw, 72px);
  height: auto;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35));
}

/* Invisible hover zones that sit on the line (no visible dots) */
.about-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Zero-size point anchored exactly on the line; everything positions from it */
.about-dot {
  position: absolute;
  width: 0;
  height: 0;
}

.about-dot-hit {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  width: 134px;
  height: 134px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
}

/* Thin leader line connecting the line to its label box (as in ab3) */
.about-dot::before {
  content: "";
  position: absolute;
  left: 0;
  width: 2px;
  height: 45px;
  background: var(--about-line);
  transform: translateX(-50%) scaleY(0);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.about-dot--top::before {
  bottom: 0;
  transform-origin: bottom;
}

.about-dot--bottom::before {
  top: 0;
  transform-origin: top;
}

.about-dot:hover::before {
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
}

/* Black label box with warm cream text */
.about-dot-label {
  position: absolute;
  left: 0;
  transform: translateX(-50%) translateY(6px);
  width: max-content;
  max-width: 15rem;
  text-align: center;
  line-height: 1.25;
  background: #111;
  color: #f3e6cf;
  padding: 0.95rem 1.6rem;
  border-radius: 5px;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.about-dot-label--top {
  bottom: 48px;
}

.about-dot-label--bottom {
  top: 48px;
}

.about-dot:hover .about-dot-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Auto-revealed state (used on touch devices, driven by js in sequence) —
   mirrors the hover reveal so a phone shows the same line-following effect. */
.about-dot.is-revealed::before {
  opacity: 1;
  transform: translateX(-50%) scaleY(1);
}

.about-dot.is-revealed .about-dot-label {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Touch/small-screen fallback for the hover-only hero traits. Hidden by
   default (desktop uses the interactive line); revealed as chips below. */
.about-traits {
  display: none;
  margin: 0;
}

/* Intro text */
.about-intro {
  max-width: none;
  margin: 0 auto;
  padding: 6rem 8vw 5rem;
}

.about-intro h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 600;
  margin: 0 0 1.5rem;
}

.about-intro p {
  font-size: 1.9rem;
  line-height: 1.7;
  color: var(--fg);
  margin: 0 0 1.6rem;
}

/* Let's Connect — dark closing block (echoes the site's dark sections) */
.about-connect {
  background: #000;
  color: #f5f2ec;
  padding: 6rem 8vw 8rem;
}

.about-connect-lead {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin: 0;
  color: rgba(245, 242, 236, 0.75);
  font-style: italic;
}

.about-connect h2 {
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 600;
  margin: 0.2rem 0 2.5rem;
}

.about-connect-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2.5rem;
}

.about-connect-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  text-decoration: none;
  font-size: 1.5rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.about-connect-link:hover {
  border-bottom-color: #fff;
}

.about-connect-link svg {
  width: 1.9rem;
  height: 1.9rem;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .about-hero {
    height: 52vh;
    min-height: 340px;
  }

  .about-start {
    top: 5%;
    font-size: 1.2rem;
  }

  .about-dot-label {
    font-size: 1.5rem;
  }

  .about-intro {
    padding: 3.5rem 6vw 3rem;
  }

  .about-intro h1 {
    font-size: clamp(2.2rem, 9vw, 3.2rem);
  }

  .about-intro p {
    font-size: 1.25rem;
    line-height: 1.65;
  }

  .about-connect {
    padding: 4rem 6vw 6rem;
  }

  .about-connect-links {
    gap: 1.25rem;
  }

  .about-connect-link {
    font-size: 1.3rem;
  }
}

/* Narrow, mouse-driven windows (a desktop browser shrunk small): the hover
   line still works but is cramped, so fall back to a simple chip list. Touch
   devices are handled separately below, so exclude them here. */
@media (max-width: 700px) {
  html:not(.is-touch) .about-hero .about-start {
    display: none;
  }

  html:not(.is-touch) .about-dots {
    display: none;
  }

  html:not(.is-touch) .about-traits {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    max-width: 640px;
    margin: 2.25rem auto -1rem;
    padding: 0 6vw;
    list-style: none;
  }

  html:not(.is-touch) .about-traits li {
    padding: 0.4rem 1.05rem;
    font-size: 1.05rem;
    color: var(--about-line);
    border: 1px solid var(--about-line);
    border-radius: 999px;
    white-space: nowrap;
  }
}

/* Touch devices (phones): no mouse to hover, so js auto-plays the labels along
   the line in sequence. Keep the line + dots, drop the "Start here" hint and
   the chip fallback, and stop the invisible hit zones grabbing taps. */
html.is-touch .about-hero .about-start {
  display: none;
}

html.is-touch .about-traits {
  display: none;
}

html.is-touch .about-dot-hit {
  pointer-events: none;
}

/* Taller hero + smaller label boxes on touch so the auto-revealed words have
   room above/below the line instead of clipping against the hero edges. */
html.is-touch .about-hero {
  height: 64vh;
  min-height: 500px;
}

html.is-touch .about-dot-label {
  font-size: 1.15rem;
  padding: 0.6rem 1rem;
  max-width: 12rem;
}

@media (max-width: 400px) {
  .about-connect-link {
    font-size: 1.15rem;
  }

  .about-traits li {
    font-size: 0.95rem;
    padding: 0.35rem 0.85rem;
  }
}
