/* Ged Devine / DEPT-style portfolio (mobile-first) */

:root {
  --white: #f3f3f3;
  --black: #1e1e1e;
  --muted: #1e1e1e;
  --line: #e8e8e8;
  --max: 1440px;
  /* Horizontal inset for .shell (left/right padding) */
  --gutter: clamp(0.875rem, 3vw, 1.25rem);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --cta-gold: #c9a227;
  --contact-bg: #ebebeb;
  /* Same band as #work-index-heading when "View all work" is used: lead copy lines up under the sticky header. */
  --anchor-lead-offset: clamp(4.75rem, 11vw, 6.75rem);
  /* Tight top padding below header so lead headlines sit in that same vertical band (not header + large hero pad). */
  --inner-lead-pad-top: clamp(0.35rem, 1vw, 0.85rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 1rem;
  background: var(--white);
}

.skip-link:focus {
  left: 0;
}

.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1;
}

.shell {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (max-width: 640px) {
  :root {
    --gutter: 30px;
  }
}

@media (min-width: 900px) {
  :root {
    --gutter: 2.5rem; /* 40px sides at desktop (~1440) */
  }
}

/* —— Header —— */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.header-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: clamp(4.5rem, 10vw, 6.375rem);
  gap: 1rem;
}

@media (max-width: 640px) {
  .header-row {
    min-height: 4rem;
    gap: 0.65rem;
  }
}

.logo {
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  z-index: 2;
}

.nav-primary {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  gap: clamp(1.5rem, 3vw, 2.75rem);
  font-size: 0.9375rem;
  font-weight: 400;
}

.nav-primary a {
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}

.nav-primary a:hover,
.nav-primary a[aria-current="page"] {
  border-bottom-color: var(--black);
}

.header-tools {
  display: none;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
  flex-shrink: 0;
  z-index: 2;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--black);
  cursor: pointer;
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
}

.btn-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.625rem;
  padding: 0 1.25rem;
  background: var(--black);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 999px;
}

.btn-contact:hover {
  opacity: 0.9;
}

@media (max-width: 640px) {
  .btn-contact {
    min-height: 2.3rem;
    padding: 0 1rem;
    font-size: 0.625rem;
    letter-spacing: 0.1em;
  }
}

.menu-toggle {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--black);
  cursor: pointer;
  position: relative;
  z-index: 70;
  transition: transform 220ms ease;
}

@media (max-width: 640px) {
  .menu-toggle {
    width: 2.4rem;
    height: 2.4rem;
  }
}

.menu-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-toggle svg path {
  stroke-width: 2.35;
}

body.nav-open .menu-toggle svg {
  transform: rotate(90deg) scale(1.02);
}

.menu-toggle:hover {
  transform: translateX(1px);
}

.nav-drawer {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6rem 1.875rem 0.75rem;
  border-top: 0;
  font-weight: 500;
  position: fixed;
  inset: 0;
  background: var(--white);
  z-index: 60;
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1), opacity 300ms ease-out;
}

.nav-drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-drawer.is-routing {
  transform: translateX(-100%);
  opacity: 1;
  pointer-events: none;
}

.nav-drawer > a {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.nav-drawer > a + a {
  margin-top: 0.15rem;
}

.nav-drawer .drawer-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  margin-top: auto;
  padding-top: 0;
  font-size: 8pt;
  line-height: 1.3;
  color: #1e1e1e;
}

.nav-drawer .drawer-copyright {
  margin: 0;
  white-space: nowrap;
}

.nav-drawer .drawer-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  white-space: nowrap;
}

@media (min-width: 900px) {
  /*
   * auto | 1fr | auto: logo & tools intrinsic width; nav gets the spare middle lane
   * (prevents spill/overlap vs 1fr | auto | 1fr where a wide nav sits under .header-tools).
   */
  .header-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(0.5rem, 1.5vw, 1rem);
  }

  .logo {
    grid-column: 1;
    justify-self: start;
  }

  .nav-primary,
  .header-tools {
    display: flex;
  }

  .nav-primary {
    grid-column: 2;
    position: static;
    transform: none;
    justify-self: center;
    justify-content: center;
    min-width: 0;
  }

  .header-tools {
    grid-column: 3;
    justify-self: end;
    margin-left: 0;
    flex-shrink: 0;
  }

  .menu-toggle {
    display: none;
  }

  .nav-drawer {
    display: none !important;
  }
}

body.nav-open {
  overflow: hidden;
}

/* —— Home hero —— */

.hero-home {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  /* Homepage keeps more air above the hero line. */
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
}

.headline-display {
  margin: 0;
  max-width: 54rem;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

@media (max-width: 640px) {
  .headline-display {
    font-size: clamp(1.6rem, 9vw, 2.2rem);
    line-height: 1.16;
    letter-spacing: -0.025em;
  }
}

.hero-lede {
  margin: 0;
  max-width: 46rem;
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
}

@media (max-width: 640px) {
  .hero-lede {
    font-size: 1.02rem;
    line-height: 1.5;
  }
}

/* —— Home feature (collage + copy) —— */

.feature-split {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

/* —— About section (single-page) —— */

.about-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  padding-block: var(--inner-lead-pad-top) clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--line);
}

.about-copy {
  margin: 0;
  max-width: 52rem;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  line-height: 1.35;
  color: var(--black);
}

.about-copy + .about-copy {
  margin-top: clamp(1rem, 2vw, 1.25rem);
}

.about-links {
  margin-top: clamp(3rem, 8vw, 6rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.about-links a {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Homepage-only: remove keyline separators */
.home-page .site-header,
.home-page .about-panel,
.home-page .about-links,
.home-page .site-footer {
  border-top: 0;
  border-bottom: 0;
}

/* About-only: remove keyline separators */
.about-page .site-header,
.about-page .hero-home,
.about-page .site-footer {
  border-top: 0;
  border-bottom: 0;
}

/* Work-only: remove keyline separators */
.work-page .site-header,
.work-page .site-footer {
  border-top: 0;
  border-bottom: 0;
}

/* Contact-only: remove keyline separators (same as Home / About / Work) */
.contact-page .site-header,
.contact-page .hero-home,
.contact-page .site-footer {
  border-top: 0;
  border-bottom: 0;
}

/* —— Contact (Loaf-style minimalist) —— */

/* Contact: hero sits in <main> like Home (no flex wrapper); grey band only below the hero. */
.contact-sheet {
  background: var(--contact-bg);
}

/* Contact hero title: own type scale (not .headline-display — same class was winning / cache made size fixes invisible). */
.contact-page .contact-hero-title {
  margin: 0 0 clamp(3rem, 12vw, 8rem);
  max-width: 54rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: inherit;
  font-size: clamp(1.125rem, calc(0.6rem + 2.8vw), 2rem) !important;
  line-height: 1.15 !important;
}

@media (min-width: 900px) {
  .contact-page .contact-hero-title {
    font-size: 32px !important;
  }
}

@media (max-width: 640px) {
  .contact-page .contact-hero-title {
    letter-spacing: -0.025em;
    font-size: clamp(1.125rem, calc(0.5rem + 3.5vw), 1.75rem) !important;
  }
}

.contact-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding-block: var(--inner-lead-pad-top) clamp(3.5rem, 9vw, 6rem);
}

.contact-hero-row {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  scroll-margin-top: var(--anchor-lead-offset);
}

@media (min-width: 768px) {
  .contact-hero-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: clamp(3rem, 8vw, 6rem);
  }

  .contact-social {
    text-align: right;
    justify-self: end;
  }
}

.contact-primary {
  display: flex;
  flex-direction: column;
  gap: clamp(0.65rem, 2vw, 1rem);
}

.contact-line--primary {
  display: inline-block;
  width: fit-content;
  font-size: clamp(1.75rem, 4.8vw, 3.25rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.contact-line--primary:hover {
  opacity: 0.82;
}

.contact-social {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(1rem, 1.6vw, 1.1875rem);
  font-weight: 600;
  line-height: 1.4;
}

.contact-social li + li {
  margin-top: 0.65rem;
}

.contact-social a {
  text-decoration: none;
}

.contact-social a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 960px) {
  .feature-split {
    grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.88fr);
    align-items: start;
    column-gap: clamp(2rem, 4vw, 3.5rem);
  }
}

.feature-visual {
  position: relative;
  background: var(--black);
  min-height: clamp(240px, 48vw, 520px);
}

.feature-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: inherit;
}

.feature-copy h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.05;
  text-transform: uppercase;
}

.feature-copy p {
  margin: 0 0 1.125rem;
  max-width: 36rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.feature-copy p:last-of-type {
  margin-bottom: 1.75rem;
}

.btn-pill-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.75rem;
  background: var(--black);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
}

.btn-pill-dark:hover {
  opacity: 0.9;
}

/* —— Work index —— */

.work-hero {
  /* Original hero air above the Work index headline (unchanged from before inner-page alignment work). */
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
}

.work-page .work-sample-cta {
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  color: inherit;
}

.work-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  padding-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

@media (min-width: 720px) {
  .work-row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.work-title {
  margin: 0;
  font-size: clamp(2.4rem, 14vw, 7.5rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

#home-hero-heading,
#work-index-heading,
#work-hero-heading,
#about-copy-heading,
#contact-heading {
  scroll-margin-top: var(--anchor-lead-offset);
}

.btn-ghost-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.5rem;
  border: 1px solid var(--black);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.btn-ghost-pill:hover {
  background: var(--black);
  color: var(--white);
}

/* Figma Work frame 110:460 — three case placeholders (keyline frames), no section tint */
.work-studies-grid {
  display: grid;
  gap: clamp(1.25rem, 3vw, 1.75rem);
  margin: 0;
  padding: 0 0 clamp(2rem, 5vw, 3rem);
}

@media (min-width: 880px) {
  .work-studies-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .work-study-slot--wide {
    grid-column: 1 / -1;
  }
}

.work-study-hit {
  display: block;
  text-decoration: none;
  color: inherit;
}

.work-study-thumb {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  overflow: hidden;
}

.work-study-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Ratios from Figma image frames (650×435, 650×653, 1317×737) */
.work-study-thumb--landscape {
  aspect-ratio: 650 / 435;
}

.work-study-thumb--tall {
  aspect-ratio: 650 / 653;
}

.work-study-thumb--wide {
  aspect-ratio: 1317 / 737;
}

.work-study-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.work-study-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-study-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: flex-end;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: #1e1e1e;
}

.work-grid-figma {
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

.work-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
}

@media (min-width: 880px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.work-card-hit {
  display: block;
  text-decoration: none;
  color: inherit;
}

.work-card figure {
  margin: 0 0 1rem;
  background: #f4f4f4;
}

.work-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.work-card.card-tall figure {
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.work-card.card-wide figure {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.work-card figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-card .meta {
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: none;
}

/* —— Case study —— */

.case-hero {
  padding-block: clamp(2rem, 5vw, 3rem);
}

.case-hero-inner {
  max-width: 48rem;
}

.case-kicker {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.case-title {
  margin: 0 0 1rem;
  font-family: var(--font);
  font-size: clamp(3rem, 8vw, 5.25rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.04em;
}

@media (max-width: 640px) {
  .case-title {
    font-size: clamp(2rem, 12vw, 3rem);
    line-height: 1.06;
  }
}

.case-sub {
  margin: 0;
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  font-weight: 400;
  max-width: 34rem;
  color: var(--muted);
}

.case-hero-shot {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  position: relative;
  background: #e5e5e5;
}

.case-hero-shot:not(.case-hero-shot--plain)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 50%);
  pointer-events: none;
}

.case-hero-shot--plain {
  background: #ececec;
}

.case-media-placeholder {
  min-height: clamp(220px, 42vw, 480px);
  background: linear-gradient(145deg, #ececec 0%, #d4d4d4 50%, #e8e8e8 100%);
}

.case-hero-shot img {
  width: 100%;
  max-height: min(85vh, 720px);
  object-fit: cover;
}

.case-hero-caption {
  position: absolute;
  z-index: 1;
  left: clamp(1rem, 3vw, 2.5rem);
  bottom: clamp(1rem, 3vw, 2.5rem);
  max-width: min(36rem, 90%);
  color: var(--white);
  text-shadow: 0 1px 24px rgba(0, 0, 0, 0.35);
}

.case-hero-caption h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.case-hero-caption h3 em {
  font-style: italic;
  font-weight: 500;
}

.case-hero-caption p {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.btn-pill-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.meta-row {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--line);
}

@media (min-width: 880px) {
  .meta-row {
    grid-template-columns: minmax(0, 0.38fr) minmax(0, 1fr);
    align-items: start;
  }
}

.meta-labels {
  display: grid;
  gap: 1rem;
  font-size: 0.8125rem;
}

.meta-labels dt {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.6875rem;
}

.meta-labels dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.body-columns p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

.body-columns p:last-child {
  margin-bottom: 0;
}

.figure-full {
  margin: 0;
  background: #eee;
}

.figure-full img {
  width: 100%;
  max-height: min(90vh, 860px);
  object-fit: cover;
}

.prose-centered {
  max-width: 40rem;
  margin-inline: auto;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}

.prose-centered p {
  margin: 0 0 1.125rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.prose-centered p:last-child {
  margin-bottom: 0;
}

.cta-band {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(1.75rem, 4vw, 2.5rem) var(--gutter);
  background: var(--cta-gold);
  color: var(--white);
}

@media (min-width: 720px) {
  .cta-band {
    flex-direction: row;
    align-items: center;
  }
}

.cta-band p {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 500;
}

.section-serif {
  padding-block: clamp(3rem, 8vw, 5.5rem);
}

.section-serif h2 {
  margin: 0 0 1.5rem;
  max-width: 22ch;
  font-family: var(--font);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.section-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.asym-text {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .asym-text {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.55fr);
    gap: clamp(2rem, 5vw, 4rem);
  }

  .asym-text .body-columns {
    padding-top: 2.5rem;
  }
}

.asym-text .body-columns p {
  text-align: left;
}

.case-study-section + .case-study-section {
  margin-top: clamp(3rem, 9vw, 5.5rem);
}

.grid-3 {
  display: grid;
  gap: clamp(0.75rem, 2vw, 1rem);
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.grid-3 figure {
  margin: 0;
  background: #e8e8e8;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.grid-3 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-serif.centered-block {
  text-align: center;
}

.section-serif.centered-block h2 {
  margin-inline: auto;
  max-width: 22ch;
}

.section-serif.centered-block .body-columns {
  max-width: 40rem;
  margin-inline: auto;
}

.section-serif.centered-block .body-columns p {
  text-align: center;
}

/* —— Footer —— */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: clamp(2rem, 5vw, 3rem);
  font-size: 10pt;
  color: #1e1e1e;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .footer-inner {
    gap: 0.75rem;
  }

  .footer-links {
    gap: 0.9rem;
  }
}

.footer-links a:hover {
  color: var(--black);
}

@media (max-width: 768px) {
  :root {
    --gutter: 30px;
  }

  .site-footer {
    margin-top: 8px;
    padding-block: 0.5rem 0.35rem;
    font-size: 10pt;
    color: #1e1e1e;
  }

  .site-footer .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
  }

  .site-footer .footer-inner p,
  .site-footer .footer-links {
    margin: 0;
    white-space: nowrap;
  }

  .site-footer .footer-links {
    flex-wrap: nowrap;
    gap: 14px;
  }
}

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

/* —— Dark mode —— */

body.theme-dark {
  --white: #1e1e1e;
  --black: #f3f3f3;
  --muted: #c8c8c8;
  --line: #383838;
  --contact-bg: #1e1e1e;
  background: #1e1e1e;
  color: #f3f3f3;
}

body.theme-dark .skip-link,
body.theme-dark .site-header,
body.theme-dark .nav-drawer,
body.theme-dark .site-footer {
  background: #1e1e1e;
}

body.theme-dark .nav-drawer .drawer-tools {
  color: #c8c8c8;
}

body.theme-dark .site-footer {
  color: #c8c8c8;
}

body.theme-dark .menu-toggle {
  background: transparent;
  color: #f3f3f3;
}

body.theme-dark .feature-visual,
body.theme-dark .work-card figure,
body.theme-dark .figure-full,
body.theme-dark .grid-3 figure {
  background: #2a2a2a;
}

body.theme-dark .btn-contact,
body.theme-dark .btn-pill-dark {
  background: #f3f3f3;
  color: #1e1e1e;
}

body.theme-dark .work-study-tags {
  color: #9a9a9a;
}

body.theme-dark .btn-ghost-pill {
  border-color: #f3f3f3;
  color: #f3f3f3;
}

body.theme-dark .btn-ghost-pill:hover {
  background: #f3f3f3;
  color: #1e1e1e;
}

body.theme-dark .theme-toggle {
  color: #f3f3f3;
}

body.theme-dark .cta-band {
  background: #8d6d20;
}

/* Dark-mode overrides for Figma-positioned work inner pages */
body.theme-dark .work-inner-figma {
  background: #1e1e1e !important;
  color: #f3f3f3 !important;
}

body.theme-dark .work-inner-figma p {
  color: #f3f3f3 !important;
}

body.theme-dark .work-inner-figma .placeholder {
  background: #1e1e1e !important;
  border-color: #3a3a3a !important;
}

body.theme-dark .work-inner-figma [style*="background:#f3f3f3"] {
  background: #1e1e1e !important;
}

body.theme-dark .work-inner-figma [style*="color:#f2f2f2"] {
  color: #f3f3f3 !important;
}

body.theme-dark .work-inner-figma .cta {
  background: #f3f3f3 !important;
  color: #1e1e1e !important;
}

/* Case-study inner: pull the Figma canvas up so the project title band sits closer to the Work-index anchor line. */
body.case-figma-page #main {
  padding-top: 0;
}

body.case-figma-page .work-inner-wrap {
  margin-top: clamp(-2.75rem, -6vw, -0.75rem);
}

@media (max-width: 768px) {
  body.case-figma-page .work-inner-wrap {
    margin-top: 0;
  }

  /* Overrides per-page inline .work-inner-mobile padding; top inset halved vs prior for ~50% less space under nav. */
  body.case-figma-page .work-inner-mobile {
    padding: calc(max(var(--inner-lead-pad-top), env(safe-area-inset-top, 0px)) * 0.5) 30px 56px;
  }

  body.case-figma-page .work-inner-mobile .mobile-title {
    scroll-margin-top: var(--anchor-lead-offset);
  }
}

/* Inner routes only (not Work index): desktop — ~50% less space between nav and lead title. */
@media (min-width: 769px) {
  body.case-figma-page .work-inner-wrap {
    margin-top: clamp(-4.125rem, -9vw, -1.125rem);
  }
}

/* Remove header keyline for Figma case-study pages */
body.case-figma-page .site-header {
  border-bottom: 0;
}

body.case-figma-page .site-footer {
  border-top: 0;
}

