/* Preserve the supplied desktop design; refine small-screen reading and touch. */
.responsive-image { display: block; min-width: 0; }
.responsive-image > img { display: block; }
.hero > .responsive-image { width: 100%; }
.work > .responsive-image > img,
.project-cover { height: auto; }
.gallery-grid > .responsive-image { width: 100%; }
a:focus-visible,
summary:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }

/* Overlap boundaries deliberately; later desktop/mobile rules win at endpoints. */
@media (max-width: 1024px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 28px; }
}
@media (min-width: 1024px) {
  .projects { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 35px; }
}

@media (pointer: coarse) {
  header .brand { display: inline-flex; align-items: center; min-height: 44px; gap: 6px; }
  nav a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; font-size: 13px; }
  .link { display: inline-flex; align-items: center; min-height: 44px; }
  .gallery summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
}

@media (max-width: 700px) {
  header { gap: 4px; padding: 12px 20px 16px; }
  header .brand { display: inline-flex; align-items: center; min-height: 44px; gap: 6px; }
  nav { gap: 0 18px; align-items: center; }
  nav a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; font-size: 13px; letter-spacing: .02em; }

  .hero { min-height: 0; padding: 24px 20px 56px; gap: 24px; }
  .hero > .responsive-image { order: -1; }
  .hero img { height: clamp(240px, 38svh, 320px); }
  .hero h1 { font-size: clamp(60px, 17vw, 76px); line-height: .98; letter-spacing: -.04em; margin: 14px 0; }
  .hero .subtitle { font-size: 12px; line-height: 1.6; letter-spacing: .1em; }
  .hero .intro { font-size: 16px; line-height: 1.75; margin: 24px 0 18px; }
  .hero .eyebrow { font-size: 11px; }
  .link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 0; font-size: 12px; line-height: 1.5; letter-spacing: .07em; }

  .section, .contact { padding: 56px 20px; }
  .section-head { padding-top: 20px; margin-bottom: 32px; }
  .section-head h2 { font-size: clamp(36px, 10vw, 48px); line-height: 1.08; letter-spacing: -.035em; }
  .bio { gap: 28px; }
  .bio h3 { font-size: 30px; }
  .bio p, .work p, .project p { font-size: 16px; line-height: 1.75; }
  .bio p { margin-bottom: 20px; }
  .works { gap: 56px; }
  .work h3 { font-size: 30px; line-height: 1.14; }
  .work > .responsive-image + h3 { margin-top: 16px; }
  .work p { margin: 16px 0; }
  .projects { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .project { padding-top: 20px; }
  .project-cover { margin-bottom: 20px; }
  .project h3 { font-size: 28px; line-height: 1.2; margin: 0 0 16px; }

  .gallery { margin-top: 24px; padding-top: 0; }
  .gallery summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 10px 0; font-size: 12px; line-height: 1.5; letter-spacing: .08em; }
  .gallery summary::-webkit-details-marker { display: none; }
  .gallery summary::after { content: "+"; font-size: 20px; line-height: 1; }
  .gallery[open] summary::after { content: "−"; }
  .gallery-grid { gap: 14px; margin: 12px 0 0; }
  .gallery-grid img { background: transparent; }
  .light .gallery-grid img { background: transparent; }

  .contact h2 { font-size: clamp(40px, 11vw, 60px); line-height: 1.1; letter-spacing: -.035em; margin: 0; }
  .contact-links { flex-direction: column; align-items: flex-start; gap: 16px; margin: 28px 0 48px; }
  footer { line-height: 1.6; gap: 8px; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery-grid img,
  .project .gallery-grid img { height: auto; max-height: none; aspect-ratio: auto; object-fit: contain; }
  /* Override the supplied portrait rules so full photographs stay visible. */
  .gallery-grid .portrait-photo,
  .project .gallery-grid .portrait-photo { height: auto !important; max-height: 460px !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
