:root {
  --ink: #181817;
  --paper: #b7bfc5;
  --line: #d9d7ce;
}

* {
  box-sizing: border-box;
}

img,
video {
  max-width: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Mono", monospace;
}

html { scroll-behavior: smooth; }

main {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: Caveat, cursive;
  font-size: clamp(4.5rem, 11vw, 8.5rem);
  font-weight: 600;
  line-height: 0.8;
  letter-spacing: -0.06em;
}

.about {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: center;
  margin-top: 0; /* header uses its own spacing now */
}

.intro-row {
  display: flex;
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
  justify-content: space-between;
  margin-top: 2.25rem;
}

.intro-text {
  flex: 1 1 60%;
}

.work-row {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
  margin-top: 1.75rem;
}

.work-text {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.work-text p { margin-bottom: 0; font-size: 1.2rem; }

.work-image {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 160px;
}

#work-media-container {
  width: 160px;
  height: 160px;
  flex: 0 0 160px;
  overflow: hidden;
  border-radius: 8px;
  background: #e9e6dc;
}

#work-media-container img,
#work-media-container video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.centered { justify-content: center; }

.arrow-row { display: flex; justify-content: center; margin-top: 1rem; }

.portrait {
  width: 320px;
  height: 320px;
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
  border: none;
  flex: 0 0 320px;
}

.about p {
  max-width: 44rem;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  line-height: 1.75;
}

.intro-text p {
  max-width: none;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  margin-bottom: 0.9rem;
}

.work-row .current-work {
  margin: 0;
}

.cta-row {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  padding: 0.6rem 1rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.current-work {
  margin-top: 1.6rem;
  font-size: 1.2rem;
}

.current-work p {
  margin-bottom: 0.9rem;
}

.project-link-inline {
  color: #0967d2;
  text-decoration: underline;
}

.down-arrow-wrap {
  margin-top: 1.8rem;
  display: flex;
  justify-content: center;
}

.down-arrow svg {
  color: var(--ink);
  opacity: 0.95;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.down-arrow:hover svg {
  transform: translateY(4px);
  opacity: 0.8;
}

section {
  margin-top: 7rem;
}

h2 {
  margin-bottom: 1.4rem;
  font-size: 4rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

/* Paragraph spacing for non-home pages */
body:not(.home) p {
  margin-bottom: 1.25rem;
}

body:not(.home) p:last-child {
  margin-bottom: 0;
}

.project {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
}

.project-favorite-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: visible;
}

.project-favorite-wrap .project {
  width: 100%;
  height: 100%;
}

.project-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.favorite-callout {
  position: absolute;
  left: max(
    -11.5rem,
    calc((min(1120px, calc(100vw - 2rem)) - 100vw) / 2 + 0.5rem)
  );
  top: 2.4rem;
  width: 12rem;
  pointer-events: none;
  z-index: 2;
  transform: rotate(-12deg);
  opacity: 0.9;
}

.favorite-callout span {
  display: block;
  font-family: "Caveat", cursive;
  font-size: clamp(1.7rem, 2.3vw, 2.6rem);
  line-height: 1;
  color: rgba(24, 24, 23, 0.92);
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
  margin-left: 0.2rem;
  letter-spacing: 0.02em;
}

.favorite-callout svg {
  display: block;
  width: 100%;
  height: 6.5rem;
  margin-top: -0.35rem;
  overflow: visible;
}

.favorite-callout path {
  fill: none;
  stroke: rgba(24, 24, 23, 0.95);
  stroke-width: 2.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.favorite-callout .arrow-tip {
  fill: rgba(24, 24, 23);
  stroke: rgba(24, 24, 23);
  stroke-width: 1.5;
}

@media (max-width: 720px) {
  .favorite-callout {
    display: none;
  }
}

.placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #e9e6dc;
  color: #79766c;
  font-size: 0.74rem;
  letter-spacing: 0.11em;
}

.project-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.project-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1.35rem;
  color: white;
  text-align: center;
  background: rgba(24, 24, 23, 0.9);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.project:hover .project-image,
.project:focus-within .project-image {
  transform: scale(1.04);
}

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

.project-info h3 {
  margin-bottom: 1.5rem;
  font-size: clamp(1.45rem, 2.3vw, 2.1rem);
}

.project-info p {
  font-size: 1.4rem;
  line-height: 1.7;
}

/* Applied Invention page */

.project-page {
  max-width: 1320px;
  width: min(1320px, calc(100% - 1rem));
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.25rem;
  text-decoration-thickness: 0.12em;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.back-link:hover {
  transform: scale(1.04);
  opacity: 0.8;
}

.project-page-header {
  margin: 4rem auto 4rem;
  text-align: center;
  max-width: 100%;
}

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 3rem;
  align-items: start;
}

.project-copy {
  max-width: 760px;
  margin-left: 0;
}

.project-gallery {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding-top: 3.6rem;
}

.gallery-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.gallery-block h3 {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(24, 24, 23, 0.8);
}

.gallery-placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.14);
  color: rgba(24, 24, 23, 0.7);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-placeholder.muted {
  min-height: 180px;
  opacity: 0.75;
}

.gallery-media {
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
}

.video-media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.project-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #ddd;
}

.video-media .project-media {
  transform: scale(1.32);
  transform-origin: center 36%;
  object-position: center 38%;
}

.gallery-small-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* Extended simulation grid: 3 columns for multiple items */
.simulation-grid {
  /* Vertical two-column flow using CSS multi-column so items stack vertically */
  column-count: 2;
  column-gap: 0.8rem;
}

/* Each item becomes an inline-block so it flows into columns; keep full width inside column */
.simulation-grid .gallery-small-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 0.8rem;
  break-inside: avoid;
}

.simulation-grid .gallery-small-image { width: 100%; height: 150px; object-fit: cover; }
.simulation-grid .gallery-small-image.tall { height: 230px; object-fit: contain; }
.simulation-grid .gallery-small-image.small { height: 120px; object-fit: cover; }
.simulation-grid video.gallery-small-image { width: 100%; height: 150px; object-fit: cover; }

/* Two explicit column layout for simulation gallery */
.simulation-columns {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.simulation-columns .col {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.simulation-columns .gallery-small-item { margin: 0; }
.simulation-columns .gallery-small-image { width: 100%; height: 150px; object-fit: cover; }
.simulation-columns .gallery-small-image.tall { height: 230px; object-fit: contain; }
.simulation-columns .gallery-small-image.small { height: 120px; object-fit: cover; }
.simulation-columns video.gallery-small-image { width: 100%; height: 150px; object-fit: cover; }

/* Center the simulation gallery against the tall copy column beside it */
.project-gallery.simulation-extended {
  padding-top: 0;
  margin-top: 0;
  align-self: center;
}

/* V1 gallery starts flush with the section label, which lives in the copy
   column so both columns share a top edge */
.project-gallery.v1-gallery {
  padding-top: 0;
}

.project-gallery.v1-gallery > :first-child {
  margin-top: 0;
}

/* Final simulation spans both columns and is larger */
.final-simulation {
  margin-top: 1rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.final-simulation .final-sim-video {
  width: min(100%, 920px);
  height: 420px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #000;
}
.final-sim-caption {
  font-size: 0.85rem;
  color: rgba(24,24,23,0.78);
  text-transform: uppercase;
}

.first-jump {
  margin-top: 0.35rem;
}

.first-jump .final-sim-video {
  width: min(100%, 860px);
  height: 360px;
  object-fit: cover;
  background: #000;
}

/* Make the 'Both' simulation smaller and fully visible (no side-cropping) */
.both-simulation .final-sim-video {
  width: min(100%, 760px);
  height: auto;
  max-height: 480px;
  object-fit: contain;
  background: #000;
}

.gallery-small-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Single-column gallery: images run full width of the column and keep their
   own aspect ratio instead of being cropped into a fixed-height tile */
.gallery-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.gallery-column .gallery-small-image {
  height: auto;
  object-fit: contain;
  object-position: center;
}

/* Very tall source images get cropped to a readable strip instead of
   stretching the column */
.gallery-column .gallery-small-image.crop-short {
  height: 240px;
  object-fit: cover;
  object-position: center top;
}

/* Two-column screenshot grid inside the side gallery column */
.gallery-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  width: 100%;
}

.gallery-grid-2 .gallery-small-image {
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}

.gallery-grid-2.ratio-4-3 .gallery-small-image {
  aspect-ratio: 4 / 3;
}

.gallery-grid-2.ratio-3-4 .gallery-small-image {
  aspect-ratio: 3 / 4;
}

.gallery-grid-2.ratio-1-1 .gallery-small-image {
  aspect-ratio: 1;
}

/* Gallery whose top edge lines up with the section label, which lives in the
   copy column so both grid columns share a top edge */
.project-gallery.gallery-flush-top {
  padding-top: 0;
}

.project-gallery.gallery-flush-top > :first-child {
  margin-top: 0;
}

/* Gallery centered against the copy column beside it */
.project-gallery.gallery-center {
  padding-top: 0;
  align-self: center;
}

/* Media embedded in the copy column, under the text */
.copy-embed {
  margin: 2rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.copy-embed figcaption {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(24, 24, 23, 0.78);
}

.gallery-embed {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #000;
  overflow: hidden;
}

.gallery-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Large centered poster / single hero image */
.poster-figure {
  margin: 0 auto;
  width: min(100%, 900px);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.poster-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.poster-figure figcaption {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(24, 24, 23, 0.78);
}

/* Two overlapping photos sharing a single caption */
.photo-collage {
  margin: 0;
}

.collage-frame {
  position: relative;
}

.collage-back,
.collage-front,
.collage-third {
  display: block;
  height: auto;
  border: 1px solid var(--line);
  background: #f6f4f1;
}

.collage-back {
  position: relative;
  z-index: 1;
  width: 82%;
  margin: 0;
}

.collage-front {
  position: relative;
  z-index: 2;
  width: 74%;
  margin: -2.4rem -0.5rem 0 auto;
}

/* Three-photo variant: tighter overlaps so the stack stays compact */
.collage-trio .collage-back {
  width: 70%;
}

.collage-trio .collage-front {
  width: 48%;
  margin: -14% -0.5rem 0 auto;
}

.collage-trio .collage-third {
  position: relative;
  z-index: 3;
  width: 68%;
  margin: -12% auto 0 0;
}

.collage-caption {
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(24, 24, 23, 0.78);
}

.gallery-small-image {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: center 28%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.1);
}

.gallery-small-image.tall {
  height: 230px; 
  object-fit: contain;
}

.greenhouse-crop {
  object-position: center 18%;
}

.gallery-small-item figcaption {
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(24, 24, 23, 0.78);
}

.gallery-caption {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
  color: rgba(24, 24, 23, 0.8);
}

.tech-gallery-header {
  margin: 0.8rem 0 0.15rem;
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2d3d43;
  font-weight: 600;
}

.project-detail-list {
  margin: 1.25rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.55rem;
  line-height: 1.7;
}

.project-sub-list {
  margin: 0.45rem 0 0.1rem;
  padding-left: 1.5rem;
  display: grid;
  gap: 0.35rem;
  line-height: 1.6;
}

.project-link-disabled {
  cursor: default;
  pointer-events: none;
}

.project-section-divider {
  border-top: 1px solid var(--line);
  margin-top: 2.5rem;
  padding-top: 2rem;
}

.project-section-label {
  margin: 0 0 1.2rem;
  font-size: clamp(0.9rem, 1.4vw, 1.5rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(24, 24, 23, 0.82);
}

.project-copy h3 {
  margin: 2rem 0 0.8rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(24, 24, 23, 0.8);
}

.subsection-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 3rem;
  align-items: start;
}

.prototype-stack {
  position: relative;
}

.prototype-media-frame {
  min-height: 0;
}

.prototype-image,
.prototype-video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.prototype-image {
  position: relative;
  z-index: 1;
  width: 76%;
  margin: 0.5rem 0 0 0.5rem;
  border: 1px solid var(--line);
  background: #f6f4f1;
}

.prototype-video {
  position: relative;
  right: auto;
  bottom: auto;
  z-index: 2;
  width: 70%;
  margin: -1.7rem -0.7rem 0 auto;
  border: 1px solid var(--line);
  background: #000;
  transform: rotate(0deg);
}

.prototype-gallery {
  padding-top: 0;
  margin-top: -2.5rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.prototype-stack {
  margin: 0;
}

.prototype-caption {
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(24, 24, 23, 0.78);
}

.prototype-media-frame {
  width: min(100%, 240px);
  margin-left: auto;
  margin-right: auto;
}


/* Header layout with company logo to the right */
.project-header-with-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  margin-left: -2rem;
}

.project-header-with-logo .project-header-text {
  flex: 0 0 auto;
  min-width: 0;
}

.project-header-with-logo .company-logo {
  flex: 0 0 96px;
  width: 96px;
  max-width: 96px;
  height: auto;
  margin: 0;
  object-fit: contain;
  align-self: center;
}

.work-list {
  margin: 1.5rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.6rem;
  font-size: 1rem;
  line-height: 1.7;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.2rem;
}

.tech-item {
  display: block;
  width: 100%;
  height: 78px;
  object-fit: contain;
  object-position: center;
  padding: 0.65rem;
  border: 1px solid var(--line);
  background: #ffffff;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(24, 24, 23, 0.82);
}

@media (max-width: 720px) {
  .project-page {
    width: min(100% - 1rem, 1320px);
  }

  .project-header-with-logo {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-header-with-logo .company-logo {
    width: min(320px, 100%);
    margin-left: 0;
    margin-top: 1rem;
  }

  .project-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-gallery {
    padding-top: 0;
  }

}

@media (max-width: 480px) {
  .gallery-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Project page subtitle under the header */
.project-page-header .project-subtitle {
  font-size: clamp(0.9rem, 3.2vw, 1.7rem);
  line-height: 1.2;
  margin: 0.6rem 0 0;
  font-weight: 600;
}

.company-logo {
  display: block;
  width: min(260px, 100%);
  max-height: 100px;
  margin-bottom: 2.5rem;
  object-fit: contain;
  object-position: left;
}

.project-page-header h1 {
  font-size: clamp(4rem, 10vw, 7rem);
}

.project-page-header p {
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.luxo-page .project-page-header {
  text-align: left;
  margin: 3rem auto 2.5rem;
}

.luxo-header-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 1.4fr);
  gap: 1.5rem;
  align-items: center;
  margin-left: 0;
}

.luxo-header-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  margin-left: 0.8rem;
}

.luxe-header-text {
  flex: 0 0 auto;
  min-width: 0;
}

.luxe-header-text h1 {
  margin: 0;
  text-align: left;
}

.luxo-header-image-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.luxo-header-media-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.luxo-header-video {
  width: min(100%, 620px);
  max-width: 620px;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  background: #000;
}

.luxo-header-caption {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(24, 24, 23, 0.78);
}

.company-logo.luxe-logo {
  width: min(100%, 620px);
  max-width: 620px;
  max-height: none;
  height: auto;
  margin: 0;
  object-fit: contain;
  display: block;
}

.luxe-subtitle {
  margin: 0.6rem 0 0;
  text-align: left;
}

.project-page-section {
  margin-top: 3.5rem;
}

.project-page-section h2 {
  margin-bottom: 1.2rem;
  font-size: 1rem;
}

.project-page-section p {
  font-size: 1rem;
  line-height: 1.8;
}

#projects-title {
  margin-bottom: 2.6rem;
}

/* 404 page */
.error-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.error-page h1 {
  font-size: clamp(6rem, 20vw, 12rem);
  line-height: 0.9;
}

.error-page .error-lead {
  margin-top: 1rem;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
}

.error-page p {
  max-width: 34rem;
}

/* About page — full-bleed banner over a wide two-column layout */
.about-banner {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.about-banner img {
  display: block;
  width: 100%;
  height: clamp(180px, 26vw, 420px);
  object-fit: cover;
  object-position: center;
}

.about-main {
  width: min(1440px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 0 0 4rem;
}

.about-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(1.5rem, 3vw, 2.75rem);
  align-items: center;
  margin-top: 1.25rem;
}

.about-back-link {
  margin-top: 3.5rem;
}

.about-media {
  width: min(100%, 440px);
  margin-left: auto;
}

.about-copy h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(3.5rem, 8vw, 6rem);
}

.about-copy p {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.7;
  margin-bottom: 1.1rem;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .about-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
  }

  .about-media {
    max-width: 420px;
  }
}

/* Small tablets / landscape phones: three square cards get too narrow for the
   hover copy, so drop to two. */
@media (max-width: 900px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-info {
    padding: 1.25rem 1rem;
  }

  .project-info p {
    font-size: clamp(0.95rem, 2.4vw, 1.4rem);
    line-height: 1.5;
  }
}

@media (max-width: 620px) {
  main {
    width: min(100% - 2rem, 1120px);
    padding-top: 2rem;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2.5rem;
  }

  .intro-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .work-row { flex-direction: column; align-items: flex-start; }

  .intro-row .portrait {
    width: min(100%, 320px);
    height: auto;
    flex: 0 1 auto;
    align-self: center;
    aspect-ratio: 1;
  }

  section {
    margin-top: 5rem;
  }

  h2 {
    font-size: 2.4rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  /* Keep the square framing the photos were cropped for — a 16/9 card would
     slice a thin band out of the portrait/square source images. */
  .project,
  .project-favorite-wrap {
    aspect-ratio: 1;
  }

  .project-info {
    opacity: 1 !important;
    transform: none !important;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.6) 100%);
    align-items: flex-start;
    justify-content: flex-end;
    text-align: left;
    padding: 0.85rem;
  }

  .project-info h3 {
    font-size: clamp(1rem, 3.6vw, 1.25rem);
    margin-bottom: 0.4rem;
  }

  .project-info p {
    font-size: clamp(0.85rem, 3vw, 1rem);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}