/* ========================
   Main Styles
   ======================== */
@import "base.css";

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  background: #fff;
}

/* ========================
   Layout / Panels
   ======================== */
.snap-container {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory; /* enables snap scrolling */
}

.panel {
  /* Force panels to match the viewport height and prevent internal
     overflow so a single scroll moves past the panel (avoids multi-step
     scroll behavior when children extend beyond the viewport). */
  height: 100vh;
  max-height: 100vh;
  width: 100%;
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
  scroll-snap-align: start;
}

.container {
  width: min(var(--max-w), 90vw);
  margin: 0 auto;
}

.narrow {
  width: min(1000px, 90vw);
}

/* ========================
   Text Content Animation
   ======================== */
/* Apply fade-in to main content elements */
.brand,
.hero-nav,
.hero-cta__arrow,
.hero__aside {
  animation: fadeIn 1.5s ease-out forwards;
  opacity: 0;
}

/* Staggered delays for hero section */
.brand {
  animation-delay: 0.1s;
}

.hero-nav {
  animation-delay: 0.2s;
}

.hero-cta__arrow {
  animation-delay: 0.25s;
}

.hero__aside {
  animation-delay: 0.3s;
}

/* Scroll-triggered animation for elements below hero */
.fade-on-scroll {
  opacity: 0;
  transition: opacity 0.8s ease-out;
}

.fade-on-scroll.visible {
  opacity: 1;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  .brand,
  .hero-nav,
  .hero-cta__arrow,
  .hero__aside {
    animation: none;
    opacity: 1;
  }

  .fade-on-scroll {
    opacity: 1;
    transition: none;
  }
}

/* ========================
   Section: Hero
   ======================== */
.hero {
  color: var(--ink);
  background-color: #000;
  background-image: url("../content/hero-texture.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  isolation: isolate;
}

@supports (-webkit-touch-callout: none) {
  .hero {
    /* iOS Safari loses the hero background after scroll when attachment is fixed. */
    background-attachment: scroll;
  }
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6));
  z-index: 0;
}

.hero__inner {
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 4vw, 48px);
  padding-block: clamp(48px, 9vh, 120px);
  align-items: center; /* vertically center both grid columns */
}

.logo {
  margin: 0 0 0.25rem 0;
  line-height: 0.9;
  letter-spacing: 0.02em;
  font-family:
    "Black Mango", "Noto Serif Display", "Noto Serif Display ExtraCondensed",
    "Playfair Display", Georgia, serif;
  font-weight: 500;
  font-size: clamp(70px, 8vw, 96px);
  text-transform: uppercase;
}

.logo span {
  display: block;
}

.tag {
  margin: 0.25rem 0 0 0;
  font-size: clamp(10px, 1.5vw, 14px);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* for brands who want clarity */
.hero__aside {
  align-self: center; /* center vertically to match other panels */
  /* text-align: right; */
  font-weight: normal;
  font-family: "Playfair Display", Georgia, serif;
  text-transform: uppercase;
}

.aside-big {
  margin: 0 0 0.35rem 0;
  /* increased responsive size so the aside reads larger on most viewports */
  font-size: clamp(18px, 3vw, 32px);
  font-weight: normal;
}

.aside-small {
  margin: 0;
  font-size: clamp(14px, 1.8vw, 18px);
  font-family:
    "Montserrat",
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  opacity: 0.9;
}

/* Hero navigation container */
.hero-nav {
  position: absolute;
  left: 50%;
  /* position above the arrow */
  bottom: clamp(120px, 13vh, 200px);
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  justify-content: center;
}

/* Hero centered CTA placed between the brand and the bottom */
.hero-cta {
  position: static;
  text-decoration: none;
  color: #fff;
  display: inline-block;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  font-size: clamp(14px, 2.5vw, 20px);
  opacity: 0.95;
}

/* Lift the nav above iOS Safari's bottom bar/notch safe area */
.hero-nav {
  bottom: calc(clamp(96px, 10vh, 160px) + env(safe-area-inset-bottom));
}

@supports (
  bottom: calc(clamp(96px, 10vh, 160px) + constant(safe-area-inset-bottom))
) {
  .hero-nav {
    bottom: calc(clamp(96px, 10vh, 160px) + constant(safe-area-inset-bottom));
  }
}

/* Make the label slightly transparent */
.hero-cta > span {
  opacity: 0.72;
}

.hero-cta:hover > span {
  opacity: 1;
}

.hero-cta__arrow {
  position: absolute;
  left: 50%;
  /* Position halfway between the nav and the bottom */
  bottom: clamp(48px, 5vh, 80px);
  transform: translateX(-50%);
  z-index: 2;
  opacity: 1;
  color: #fff;
  display: block;
  font-size: clamp(24px, 4vw, 28px);
  line-height: 1;
  transition: transform 320ms ease;
  /* subtle up-down animation to draw attention */
  animation: heroArrowFloat 2.4s ease-in-out infinite;
}

@keyframes heroArrowFloat {
  0% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(6px);
  }
  100% {
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 640px) {
  .hero-nav {
    flex-wrap: wrap;
    gap: clamp(16px, 3vw, 24px);
    max-width: 90vw;
  }

  .hero-cta {
    font-size: clamp(12px, 3.2vw, 18px);
  }
}

@media (max-width: 480px) {
  .hero-nav {
    flex-direction: column;
    gap: clamp(12px, 2.5vw, 18px);
  }

  .hero-cta {
    font-size: clamp(14px, 3.6vw, 18px);
  }
}

/* ========================
   Section: Manifesto
   ======================== */
.manifesto {
  background: #7a0f0f
    linear-gradient(180deg, var(--wine) 0%, var(--wine-deep) 100%);
  color: #fff;
}

.manifesto__grid {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: clamp(24px, 5vw, 64px);
  padding-block: clamp(48px, 9vh, 120px);
  align-items: center; /* vertically center manifesto columns to match other sections */
}

.manifesto__quote {
  margin: 0;
  font-style: italic;
  font-family:
    "Playfair Display", Georgia, serif; /* substitute for Black Mango */
  font-weight: 600;
  font-size: clamp(41.4px, 9.2vw, 92px);
  line-height: 1.06;
}

.manifesto__quote span {
  display: block;
}
.manifesto__copy p {
  margin: 0 0 1rem 0;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.6;
}

.manifesto__copy {
  align-self: center; /* center the copy block vertically within the grid */
  width: 100%;
  max-width: 55ch; /* narrower measure so text wraps sooner */
}

.rule {
  width: 70%;
  height: 1px;
  border: 0;
  background: rgba(255, 255, 255, 0.35);
  margin-top: 2rem;
}

/* ========================
   Section: Services
   ======================== */
.services {
  background: #fff;
  color: var(--text);
}

.section-head {
  text-align: center;
  margin-bottom: clamp(48px, 8vh, 80px);
  color: #0d1747;
}

.section-head .eyebrow {
  margin: 0;
  font-family:
    "Black Mango", "Noto Serif Display", "Playfair Display", Georgia, serif;
  font-weight: 500;
  letter-spacing: 0.08em;
  font-size: clamp(48px, 9vw, 96px);
  line-height: 0.9;
}

.section-head .title {
  margin: 0;
  font-family:
    "Black Mango", "Noto Serif Display", "Playfair Display", Georgia, serif;
  letter-spacing: 0.06em;
  font-weight: 500;
  font-size: clamp(48px, 9vw, 96px);
  line-height: 0.9;
  text-transform: uppercase;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.5vw, 32px);
}

.card {
  /* background: #f7f7f7; */
  border-radius: var(--radius);
  padding: clamp(16px, 2.5vw, 28px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

.card h3 {
  margin-top: 0;
  font-family:
    "Black Mango", "Noto Serif Display", "Playfair Display", Georgia, serif;
  text-transform: uppercase;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.card p {
  margin-bottom: 0;
  color: #333;
  line-height: 1.65;
}

/* ========================
   Section: Portfolio
   ======================== */
.portfolio {
  background: #fff;
  color: var(--text);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px, 5vw, 64px);
}

.portfolio-card {
  aspect-ratio: 2/3;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

@media (hover: hover) {
  .portfolio-card:hover {
    transform: scale(1.05) translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  }
}

.portfolio-card__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.portfolio-card__bg--alford {
  background-image: url("../content/portfolio/alford/alford-bg.webp");
}

.portfolio-card__bg--townpump {
  background-image: url("../content/portfolio/townpump/otp-bg.webp");
}

.portfolio-card__bg--1905 {
  background-image: url("../content/portfolio/1905/1905-bg.webp");
}

.portfolio-card__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.9) 100%
  );
}

.portfolio-card__logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 60%;
  max-height: 40%;
  object-fit: contain;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.portfolio-card__cta {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: rgb(228, 219, 219);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

@media (hover: hover) {
  .portfolio-card:hover .portfolio-card__logo {
    opacity: 0;
  }

  .portfolio-card:hover .portfolio-card__cta {
    opacity: 1;
  }
}

.portfolio-card__name {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: clamp(16px, 2vw, 24px);
  font-family: var(--font-display);
  font-size: clamp(14px, 1.8vw, 20px);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
}

/* ========================
   Portfolio Modal
   ======================== */
.portfolio-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.portfolio-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.portfolio-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 100vh));
  z-index: 100;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
  width: min(900px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  transition: transform 0.4s ease;
}

.portfolio-modal.visible {
  transform: translate(-50%, -50%);
}

.portfolio-modal__close {
  position: sticky;
  top: 16px;
  float: right;
  margin: 16px 16px 0 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  color: #333;
  transition: all 0.3s ease;
  z-index: 10;
}

.portfolio-modal__close:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.1);
}

.portfolio-modal__content {
  display: none;
  padding: clamp(24px, 5vw, 48px);
  padding-top: 0;
}

.portfolio-modal__content.visible {
  display: block;
}

.portfolio-modal__header {
  text-align: center;
  margin-bottom: clamp(24px, 4vw, 40px);
}

.portfolio-modal__brand-name {
  margin: 0 0 8px 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
}

.portfolio-modal__tagline {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(16px, 2vw, 20px);
  color: var(--muted);
}

.portfolio-modal__section {
  margin-bottom: clamp(32px, 5vw, 48px);
}

.portfolio-modal__section-title {
  margin: 0 0 16px 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
}

.portfolio-modal__description {
  font-size: clamp(15px, 1.8vw, 17px);
  line-height: 1.7;
  color: #444;
}

.portfolio-modal__video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin-bottom: 16px;
  border-radius: var(--radius);
  overflow: hidden;
}

.portfolio-modal__video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.portfolio-modal__gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(8px, 1.5vw, 16px);
}

.portfolio-modal__gallery img {
  width: 100%;
  border-radius: calc(var(--radius) / 2);
  aspect-ratio: 4/3;
  object-fit: cover;
}

.portfolio-modal__instagram {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(16px, 2vw, 24px);
  justify-items: center;
}

/* ========================
  Section: Story
  ======================== */
.story {
  background: #95c1ce;
  color: #fff;
}

.story__grid {
  display: grid;
  /* text column + image column; image column is constrained and will
     shrink proportionally as the viewport narrows */
  grid-template-columns: 1fr minmax(120px, min(40%, 520px));
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding-block: clamp(48px, 9vh, 120px);
}

.story .eyebrow,
.story .title {
  margin: 0;
  font-family:
    "Black Mango", "Noto Serif Display", "Playfair Display", Georgia, sans-serif;
  font-weight: 800;
  font-size: clamp(57.6px, 10.8vw, 115.2px);
  line-height: 0.9;
}

.story .lede {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 600;
  margin-top: 1rem;
  font-size: clamp(
    14.4px,
    2.7vw,
    28.8px
  ); /* 25% of .story .eyebrow's clamp(57.6px, 10.8vw, 115.2px) */
}

.lede-sub {
  font-size: clamp(
    14.4px,
    2.7vw,
    28.8px
  ); /* 25% of .story .eyebrow's clamp(57.6px, 10.8vw, 115.2px) */
}

.story__image {
  margin: 0;
  display: grid;
  place-items: center;
  justify-self: end; /* keep the image anchored to the right column */
  align-self: center;
}

.story__image img {
  width: 100%;
  max-width: 100%;
  height: auto;
  /* Cap height so the panel doesn't exceed the viewport on shorter screens,
     preventing extra scroll snaps on reduced-height viewports */
  max-height: calc(100vh - 160px);
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Panel back button - top right corner */
.panel__back-btn {
  position: absolute;
  right: clamp(20px, 3vw, 40px);
  top: clamp(20px, 3vw, 40px);
  z-index: 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  text-decoration: none;
  font-size: 24px;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.panel__back-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-4px);
}

.panel__back-btn span {
  display: block;
  line-height: 1;
}

/* Dark variant for light background sections */
.services .panel__back-btn,
.portfolio .panel__back-btn {
  background: rgba(0, 0, 0, 0.15);
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.2);
}

.services .panel__back-btn:hover,
.portfolio .panel__back-btn:hover {
  background: rgba(0, 0, 0, 0.25);
  border-color: rgba(0, 0, 0, 0.35);
}

/* ========================
   Section: Contact
   ======================== */

.contact {
  color: #fff;
  overflow: hidden;
}

.contact__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Top-left brand label for Contact panel */
.contact__brand {
  position: absolute;
  left: 24px;
  top: 18px;
  z-index: 2;
  font-family: "Black Mango", "Noto Serif Display", "Playfair Display", serif;
  font-weight: 700;
  color: #fff;
  font-size: clamp(18px, 2.6vw, 34px);
  letter-spacing: 0.02em;
  pointer-events: none;
}

.contact__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55);
}

.contact__grid {
  position: relative;
  z-index: 1;
  display: grid;
  /* keep the left column flexible while constraining the form column so inputs don't stretch too wide */
  grid-template-columns: 1fr min(520px, 40%);
  gap: clamp(24px, 4vw, 48px);
  padding-block: clamp(48px, 9vh, 120px);
  align-items: center; /* ensure contact content (brand) is vertically centered too */
}

.contact__head h2 {
  margin: 0 0 0.5rem 0;
  font-family:
    "Black Mango", "Noto Serif Display", "Playfair Display", Georgia, serif;
  font-weight: 500;
  font-size: clamp(43.7px, 6.9vw, 73.6px); /* increased by 15% */
  text-transform: uppercase;
}

.contact__head p {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  opacity: 0.95;
  font-size: 1.5em; /* increased by 25% relative to inherited size */
}

.contact__form {
  display: grid;
  gap: 12px;
  align-content: start;
  width: 100%;
  max-width: 520px; /* keep form fields from expanding to the full column width */
  align-self: center;
}

.contact__form input,
.contact__form textarea {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
}

.contact__form input::placeholder,
.contact__form textarea::placeholder {
  color: #444;
}

.contact__form button {
  margin-top: 8px;
  justify-self: start;
  border: 0;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  background: #ffffff;
  color: #111;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

/* Contact back button - positioned at the very bottom */
.contact__back-btn {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  text-decoration: none;
  font-size: 24px;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.contact__back-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateX(-50%) translateY(-4px);
}

.contact__back-btn span {
  display: block;
  line-height: 1;
}

/* ========================
   Utilities
   ======================== */
.sr-only {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  padding: 0 !important;
  border: 0 !important;
  height: 1px !important;
  width: 1px !important;
  overflow: hidden;
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .hero__aside {
    text-align: left;
  }
  .manifesto__grid {
    grid-template-columns: 1fr;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
  }
  .panel.portfolio {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: clamp(24px, 5dvh, 48px) 0;
  }
  .portfolio .container.narrow {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .portfolio .section-head {
    flex-shrink: 0;
    margin-bottom: clamp(16px, 3dvh, 32px);
  }
  .portfolio-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2dvh, 20px);
    min-height: 0;
  }
  .portfolio-card {
    flex: 1;
    aspect-ratio: unset;
    min-height: 0;
  }
  .portfolio-card__logo {
    max-width: 50%;
    max-height: 70%;
  }
  .portfolio-card__name {
    display: none;
  }
  .story__grid {
    grid-template-columns: 1fr;
  }
  .contact__grid {
    grid-template-columns: 1fr;
  }

  /* move contact brand to the right on narrower viewports to avoid
     colliding with the contact header */
  .contact__brand {
    left: auto;
    right: 18px;
    text-align: right;
    font-size: clamp(14px, 3.5vw, 24px);
  }
}

@media (max-width: 640px) {
  .section-head {
    margin-bottom: clamp(24px, 5vh, 40px);
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .portfolio-modal {
    width: 100vw;
    max-height: 75vh;
    max-height: 75dvh;
    border-radius: var(--radius);
  }
  .portfolio-modal__gallery {
    grid-template-columns: 1fr;
  }

  .panel__back-btn {
    right: 16px;
    top: 16px;
  }
  /* stay above safari bottom navigation bar */
  .contact__back-btn {
    bottom: 7%;
  }
}

/* Height-aware adjustments: when the viewport is short, reduce paddings
   and large display font sizes so content fits within the fixed-height
   panels and doesn't get clipped at the bottom. */
@media (max-height: 800px) {
  .manifesto__grid,
  .story__grid,
  .hero__inner,
  .contact__grid {
    padding-block: clamp(24px, 6vh, 80px);
  }

  .manifesto__quote {
    font-size: clamp(40px, 6vw, 56px);
    line-height: 1.04;
  }

  .story .eyebrow,
  .story .title {
    font-size: clamp(34px, 7vw, 72px);
    line-height: 1.02;
  }

  .story__image img {
    max-height: calc(100vh - 140px);
  }
}

@media (max-height: 640px) {
  .manifesto__grid,
  .story__grid,
  .hero__inner,
  .contact__grid {
    padding-block: clamp(16px, 4vh, 48px);
  }

  .manifesto__quote {
    font-size: clamp(22px, 6vw, 44px);
  }

  .story .eyebrow,
  .story .title {
    font-size: clamp(28px, 8vw, 56px);
  }

  .story__image img {
    max-height: calc(100vh - 120px);
  }
}

/* Strong small-width override: keep "Our Story" display type large on narrow viewports
   (e.g. modern iPhones). Placed last so it overrides the height-aware rules above. */
@media (max-width: 520px) {
  .story__grid {
    /* slightly reduce vertical padding so larger type doesn't push content out of the viewport */
    padding-block: clamp(20px, 6vh, 80px);
    gap: clamp(16px, 4vw, 40px);
  }

  /* Make the main story headings stay visibly large on small widths. The larger
     clamp minimum prevents the headings from shrinking too far as the viewport narrows. */
  .story .eyebrow,
  .story .title {
    font-size: clamp(56px, 11vw, 115.2px);
    line-height: 1.02;
  }

  /* Keep supporting lede and sub-lede readable */
  .story .lede,
  .lede-sub {
    font-size: clamp(18px, 4.5vw, 22px);
    line-height: 1.45;
  }

  /* Ensure the image doesn't force extra height when larger type is used */
  .story__image img {
    max-height: calc(100vh - 140px);
    object-fit: cover;
  }
}
