@font-face {
  font-family: "Manrope";
  src: url("assets/fonts/Manrope-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("assets/fonts/Inter-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #e43d36;
  --red-accessible: #b4232a;
  --red-dark: #8f1c22;
  --carbon: #17191c;
  --graphite: #555a60;
  --warm-white: #f4f1ec;
  --white: #ffffff;
  --line: rgba(23, 25, 28, 0.16);
  --shell: min(1220px, calc(100vw - 48px));
  --radius: 0;
  --transition: 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

/* #contact, #services, and #work: sit the section heading 15px below the shrunk header.
   The shrunk bar’s visual bottom is 61px (60px SHRUNK_HEIGHT in script.js, plus the
   1px ::before extension). scroll-margin-top = 76px − scroll-padding-top so other
   anchors keep the existing html scroll-padding-top. */
#contact,
#services,
#work {
  scroll-margin-top: calc(76px - 96px);
}

body {
  margin: 0;
  color: var(--carbon);
  background: var(--warm-white);
  font-family: "Inter", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body.nav-open,
body.dialog-open {
  overflow: hidden;
}

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
  padding: 10px 16px;
  color: var(--white);
  background: var(--carbon);
  transform: translateY(-160%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.section {
  padding-block: clamp(88px, 9vw, 148px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  color: var(--red-accessible);
  font-size: 0.73rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 32px;
  height: 2px;
  background: currentColor;
  content: "";
}

.eyebrow--light {
  color: #ff716b;
}

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

h1,
h2,
h3 {
  font-family: "Manrope", Arial, sans-serif;
  font-weight: 500;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 760px;
  margin-bottom: 28px;
  font-size: clamp(3.5rem, 6vw, 5.75rem);
  line-height: 1.02;
}

h2 {
  margin-bottom: 24px;
  font-size: clamp(2.8rem, 5vw, 5.25rem);
  line-height: 0.98;
}

h3 {
  font-size: clamp(1.45rem, 2.1vw, 2rem);
  line-height: 1.15;
}

/* Header. It shrinks smoothly once the page is scrolled and grows back at the top, at every width.
   Layout never changes; only composited transforms animate (no reflow while scrolling).
   --hdr-lift and --logo-scale are measured in script.js (and on resize). */
.site-header {
  --hdr-lift: 27px;
  --logo-scale: 0.5;
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  background: transparent;
  isolation: isolate;
  pointer-events: none;
}

.site-header::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 -1px;
  border-bottom: 1px solid transparent;
  background: var(--warm-white);
  content: "";
  pointer-events: auto;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.site-header.is-scrolled::before {
  border-color: var(--line);
  box-shadow: 0 8px 28px rgba(23, 25, 28, 0.06);
  transform: translateY(calc(-1 * var(--hdr-lift)));
}

.site-header .header-inner > * { pointer-events: auto; }
.site-header .header-inner { transition: transform 0.3s ease; will-change: transform; }
.site-header.is-scrolled .header-inner { transform: translateY(calc(-0.5 * var(--hdr-lift))); }
.site-header .brand img { transform-origin: left center; transition: transform 0.3s ease; will-change: transform; }
.site-header.is-scrolled .brand img { transform: scale(var(--logo-scale)); }

.header-inner {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}

.brand {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 383px;
}

.brand img {
  width: 100%;
  height: auto;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.primary-nav > a:not(.button) {
  position: relative;
  padding-block: 10px;
  font-size: 0.82rem;
  font-weight: 650;
}

.primary-nav > a:not(.button)::after {
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  height: 2px;
  background: var(--red);
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}

.primary-nav > a:not(.button):hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--carbon);
  transition: transform var(--transition), opacity var(--transition);
}

/* Hero */
.hero {
  padding: clamp(132px, 13vw, 184px) 0 clamp(70px, 8vw, 112px);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  align-items: center;
  gap: clamp(36px, 5vw, 76px);
  grid-template-columns: minmax(0, 0.88fr) minmax(420px, 1.12fr);
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-copy .eyebrow { font-size: 0.83rem; line-height: 1.5; }
.hero-copy .eyebrow::before { flex-shrink: 0; }

.hero-lede {
  max-width: 620px;
  margin-bottom: 34px;
  color: var(--graphite);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.62;
}

.hero-points {
  display: grid;
  margin: clamp(46px, 7vw, 88px) 0 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-points li {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 0.83rem;
  font-weight: 650;
  line-height: 1.35;
}

.hero-points span {
  display: block;
  margin-bottom: 8px;
  color: var(--red-accessible);
  font-family: "Inter", Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.hero-media {
  position: relative;
  min-height: clamp(500px, 59vw, 760px);
  margin: 0;
  background: var(--carbon);
  clip-path: polygon(0 0, calc(100% - 56px) 0, 100% 56px, 100% 100%, 0 100%);
}

.hero-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(23, 25, 28, 0.66) 100%);
  content: "";
  pointer-events: none;
}

.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 65% center;
}

.hero-media figcaption {
  position: absolute;
  z-index: 2;
  right: 30px;
  bottom: 28px;
  left: 30px;
  color: var(--white);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

/* Section heading */
.section-heading {
  display: grid;
  align-items: end;
  margin-bottom: clamp(54px, 7vw, 86px);
  gap: 50px;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading > p,
.section-heading > div:last-child > p {
  max-width: 530px;
  margin-bottom: 4px;
  color: var(--graphite);
  font-size: 1.03rem;
}

/* Services */
.services {
  background: var(--warm-white);
  padding-top: 40px;
}

.services .section-heading { gap: 32px; margin-bottom: 40px; }
.services h2 { font-size: clamp(2.25rem, 4vw, 3.75rem); line-height: 1.1; }

.service-grid {
  display: grid;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-card {
  display: flex;
  min-height: 350px;
  padding: clamp(28px, 3.4vw, 48px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.38);
  flex-direction: column;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.service-card:hover {
  z-index: 1;
  background: var(--white);
  box-shadow: 0 24px 52px rgba(23, 25, 28, 0.08);
  transform: translateY(-7px);
}

.service-number {
  margin-bottom: 32px;
  color: var(--red-accessible);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.14em;
}

.service-card h3 {
  margin-bottom: 20px;
}

.service-card > p {
  color: var(--graphite);
}

.service-photo { margin: 0 0 20px; }
.service-photo img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; }
.service-photo figcaption { margin-top: 7px; color: var(--graphite); font-size: 0.75rem; line-height: 1.45; }
.service-card > p:has(+ .card-action) { margin-block-end: 24px; }

.service-card .service-promise {
  min-height: 0;
  margin-bottom: 12px;
  color: var(--carbon);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 650;
}

.card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: auto;
  padding: 17px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 750;
  text-align: left;
}

.service-card--partnership {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 40px;
  min-height: 0;
  background: var(--white);
}

.partnership-copy { max-width: 850px; }
.partnership-copy > p:not(.service-promise) { color: var(--graphite); }
.service-card--partnership .service-number { grid-column: 1 / -1; }
.service-card--partnership:hover { transform: none; }
.partnership-brand { display: flex; align-items: flex-start; flex-direction: column; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.partnership-brand img { width: 200px; height: auto; mix-blend-mode: multiply; }
.partnership-brand > span { color: var(--graphite); font-size: 0.8rem; }
.partnership-brand strong { margin-top: 10px; color: #3037df; font-size: 0.85rem; font-weight: 600; }
.partnership-brand:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.partnership-visual { min-width: 0; margin: 0; align-self: center; }
.partnership-visual img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.partnership-visual figcaption { margin-top: 10px; color: var(--graphite); font-size: 0.68rem; line-height: 1.5; }

.card-action span {
  color: var(--red-accessible);
  font-size: 1.2rem;
  transition: transform var(--transition);
}

.card-action:hover span {
  transform: translateX(6px);
}

/* Standard */
.standard {
  position: relative;
  overflow: hidden;
  background: var(--carbon);
  color: var(--white);
}

.standard::after {
  position: absolute;
  top: -100px;
  right: -100px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  content: "";
  transform: rotate(45deg);
}

.standard-grid {
  display: grid;
  position: relative;
  z-index: 1;
  gap: clamp(64px, 8vw, 130px);
  grid-template-columns: minmax(280px, 0.72fr) minmax(520px, 1.28fr);
}

.standard-intro {
  align-self: start;
  position: sticky;
  top: 130px;
}

.standard-intro > p:not(.eyebrow) {
  max-width: 440px;
  margin-bottom: 36px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 1.03rem;
}

.standard-experience {
  display: grid;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  grid-template-columns: minmax(220px, 0.84fr) minmax(280px, 1.16fr);
}

.standard-tabs {
  border-right: 1px solid rgba(255, 255, 255, 0.16);
}

.standard-tab {
  display: grid;
  width: 100%;
  min-height: 84px;
  align-items: center;
  padding: 20px 24px 20px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 650;
  grid-template-columns: 38px 1fr;
  text-align: left;
  transition: color var(--transition), padding var(--transition), background var(--transition);
}

.standard-tab span {
  color: #ff716b;
  font-family: "Inter", Arial, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.standard-tab:hover,
.standard-tab.is-active {
  padding-left: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--white);
}

.standard-panel {
  min-height: 420px;
  padding: clamp(30px, 4vw, 54px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.panel-kicker {
  margin-bottom: 28px;
  color: #ff716b;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.standard-panel h3 {
  margin-bottom: 24px;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.standard-panel > p:not(.panel-kicker) {
  color: rgba(255, 255, 255, 0.68);
}

.panel-proof {
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.9rem;
}

.panel-proof span {
  display: block;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* Work */
.work {
  background: var(--white);
}

.section-heading--work {
  align-items: start;
}

.work-grid {
  display: grid;
  grid-auto-flow: row;
  grid-auto-rows: auto;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.work-card {
  display: block;
  isolation: isolate;
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 0;
  border: 0;
  background: var(--carbon);
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
}

.work-card[hidden] { display: none; }

.work-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.18, 0.75, 0.2, 1), filter var(--transition);
}

.work-card--portrait img {
  object-position: center 42%;
}

.work-card::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(23, 25, 28, 0.86) 100%);
  content: "";
  transition: background var(--transition);
}

.work-card:hover img {
  transform: scale(1.035);
}

.work-card:hover::after {
  background: linear-gradient(180deg, rgba(23, 25, 28, 0.06) 35%, rgba(23, 25, 28, 0.9) 100%);
}

.work-overlay {
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 22px;
  left: 24px;
  color: var(--white);
  text-align: left;
}

.work-overlay strong {
  display: block;
  margin-bottom: 4px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 650;
}

.work-overlay small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.76rem;
}

/* Projects are grouped by project, with related photographs in one gallery. */
.section-heading--work h2 {
  font-size: clamp(2.3rem, 3.5vw, 3.5rem);
  line-height: 1.1;
}
.projects-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.projects-toolbar h3 { margin-bottom: 0; }
.projects-partnership-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--graphite); font-size: 0.85rem; text-underline-offset: 5px; }
.projects-partnership-link:hover { color: var(--carbon); text-decoration: underline; }
.projects-guidance { margin: 16px 0 24px; color: var(--graphite); font-size: 0.8rem; }
.project-photo-count { position: absolute; z-index: 2; top: 18px; right: 18px; padding: 5px 10px; background: rgba(23,25,28,0.8); color: white; font-size: 0.7rem; }

/* Clarity */
.clarity {
  background: var(--warm-white);
}

.clarity-grid {
  display: grid;
  align-items: start;
  gap: clamp(60px, 9vw, 150px);
  grid-template-columns: minmax(300px, 0.9fr) minmax(420px, 1.1fr);
}

.clarity-copy p:not(.eyebrow) {
  max-width: 530px;
  color: var(--graphite);
}

.clarity-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.clarity-list li {
  display: grid;
  min-height: 72px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(1.08rem, 2vw, 1.5rem);
  font-weight: 600;
  grid-template-columns: 58px 1fr;
}

.clarity-list span {
  color: var(--red-accessible);
  font-family: "Inter", Arial, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.clarity-list small { display: block; margin-top: 3px; color: var(--graphite); font-family: "Inter", Arial, sans-serif; font-size: 0.88rem; font-weight: 400; letter-spacing: 0; }

/* Contact */
.contractor-profile {
  background: var(--white);
  scroll-margin-top: 6rem;
}

.profile-layout {
  display: grid;
  max-width: 1070px;
  grid-template-columns: minmax(0, 0.83fr) minmax(0, 1.17fr);
  grid-template-areas: "portrait heading" "portrait bio";
  column-gap: clamp(40px, 6vw, 90px);
}

.profile-heading { grid-area: heading; align-self: end; }
.profile-heading h2 { margin-bottom: 24px; font-size: clamp(2.6rem, 4.5vw, 4.25rem); }
.profile-portrait { grid-area: portrait; align-self: center; width: 100%; height: auto; }
.profile-bio { grid-area: bio; max-width: 58ch; color: var(--graphite); line-height: 1.7; }
.profile-bio p { margin: 0; }
.profile-bio p + p { margin-top: 1em; }

@media (max-width: 760px) {
  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "heading" "portrait" "bio";
    row-gap: 24px;
    max-width: 560px;
  }
  .profile-heading h2 { margin-bottom: 0; }
  .profile-portrait { aspect-ratio: 1.12; object-fit: cover; object-position: center 34%; }
}

.contact {
  padding-block: clamp(90px, 10vw, 152px);
  background: var(--red-accessible);
  color: var(--white);
}

.contact-grid {
  display: grid;
  align-items: start;
  gap: clamp(54px, 8vw, 120px);
  grid-template-columns: minmax(0, 0.82fr) minmax(480px, 1.18fr);
}

.contact-copy {
  position: sticky;
  /* Match the #contact landing: 15px below the shrunk header (visual bottom 61px). */
  top: 76px;
}

.contact-copy .eyebrow--light {
  color: var(--white);
}

.contact-copy > p:not(.eyebrow) {
  max-width: 500px;
  color: rgba(255, 255, 255, 0.78);
}

.contact-details {
  display: flex;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.32);
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
}

.contact-details a {
  width: fit-content;
  border-bottom: 1px solid transparent;
}

.contact-details a:hover {
  border-color: var(--white);
}

/* Embedded Microsoft Forms. The iframe is wider than its clipped wrapper so the form's own
   scrollbar is cut off (18px overhang here, 14px on phones). Heights are trimmed to just below
   the Submit button (about 16px of padding) so the “Report abuse” / Microsoft footer stay hidden. */
.ms-form-wrap { position: relative; padding: 0; background: #fff; color: var(--carbon); overflow: hidden; }
.ms-form { display: block; width: calc(100% + 18px); max-width: none; height: 1134px; border: 0; overflow: hidden; }

/* Narrow two-column layouts (form ~500px wide) make the form a little taller. */
@media (max-width: 950px) {
  .ms-form { height: 1154px; }
}
.contact-projects-link { display: inline-block; margin: 16px clamp(20px, 3vw, 32px) 20px; color: var(--carbon); text-decoration: underline; text-underline-offset: 5px; font-size: 0.85rem; }

/* Footer */
.site-footer {
  padding: 72px 0 26px;
  background: var(--carbon);
  color: var(--white);
}

.footer-grid {
  display: grid;
  align-items: start;
  padding-bottom: 62px;
  gap: 60px;
  grid-template-columns: 1.5fr 0.55fr 0.75fr;
}

.footer-logo {
  display: block;
  width: min(360px, 100%);
  margin-bottom: 30px;
}

.footer-logo img {
  width: 100%;
  height: auto;
}

.footer-statement {
  margin: 0;
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.3;
}

.footer-links,
.footer-contact {
  display: flex;
  padding-top: 8px;
  flex-direction: column;
  gap: 10px;
  font-size: 0.82rem;
}

.footer-links a:hover,
.footer-contact a:hover {
  color: #ff716b;
}

.footer-contact span {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.72rem;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.7rem;
}

.footer-bottom a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-bottom a:hover {
  color: #ff716b;
}

/* Dialog */
.project-dialog {
  width: min(1060px, calc(100vw - 40px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  background: var(--carbon);
  color: var(--white);
}

.project-dialog::backdrop {
  background: rgba(23, 25, 28, 0.9);
  backdrop-filter: blur(7px);
}

.project-dialog img {
  width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
}

.project-dialog > img { height: min(58dvh, 600px); max-height: none; }

.dialog-close {
  position: fixed;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: var(--carbon);
  color: var(--white);
  cursor: pointer;
  font-size: 1.65rem;
}

.dialog-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  gap: 20px;
}

.dialog-caption strong {
  font-family: "Manrope", Arial, sans-serif;
}

.dialog-caption span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.8rem;
}
.gallery-navigation { display: flex; justify-content: center; align-items: center; gap: 24px; padding: 0 22px 16px; }
.gallery-navigation button { width: 44px; height: 44px; border: 1px solid #777; background: transparent; color: white; cursor: pointer; }
.gallery-navigation span { min-width: 50px; text-align: center; font-size: 0.8rem; }
.gallery-thumbnails { display: flex; gap: 8px; padding: 0 22px 22px; overflow-x: auto; }
.gallery-thumbnails[hidden] { display: none; }
.gallery-thumbnails button { flex: 0 0 80px; height: 60px; padding: 0; border: 2px solid transparent; opacity: 0.55; background: transparent; cursor: pointer; }
.gallery-thumbnails button[aria-pressed="true"] { border-color: var(--red); opacity: 1; }
.gallery-thumbnails img { height: 100%; object-fit: cover; }

@media (max-width: 1180px) {
  html { scroll-padding-top: 130px; }
  #contact,
  #services,
  #work { scroll-margin-top: calc(76px - 130px); }
  .header-inner { position: relative; min-height: 76px; gap: 16px; padding-block: 12px; }
  .brand { width: 352px; }
  .nav-toggle { display: flex; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }
  .primary-nav {
    position: absolute;
    z-index: 2;
    inset: 100% 0 auto;
    max-height: 0;
    overflow: hidden;
    align-items: stretch;
    padding-inline: 22px;
    border-bottom: 0 solid var(--line);
    background: var(--warm-white);
    flex-direction: column;
    gap: 0;
    opacity: 0;
    visibility: hidden;
  }
  .primary-nav.is-open {
    max-height: calc(100dvh - 130px);
    overflow-y: auto;
    padding-top: 18px;
    padding-bottom: 24px;
    border-bottom-width: 1px;
    opacity: 1;
    visibility: visible;
  }
  .primary-nav > a:not(.button) {
    max-width: none;
    padding: 17px 0;
    border-bottom: 1px solid var(--line);
    font-family: "Manrope", Arial, sans-serif;
    font-size: 1.1rem;
  }
  /* The bar's top edge lifts by --hdr-lift and .header-inner by half of it, so pull the
     dropdown menu up by the other half to sit flush under the shrunk bar. */
  .site-header.is-scrolled .primary-nav { top: calc(100% - 0.5 * var(--hdr-lift)); }
  .hero { padding-top: 154px; }
  .privacy-page { padding-top: 154px; }
}

@media (max-width: 1040px) {
  .hero-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(380px, 1.15fr);
  }

  .standard-grid {
    gap: 72px;
    grid-template-columns: 1fr;
  }

  .standard-intro,
  .contact-copy {
    position: static;
  }

  .standard-intro h2 br {
    display: none;
  }
}

@media (max-width: 860px) {
  :root {
    --shell: min(100% - 36px, 720px);
  }

  .section {
    padding-block: 84px;
  }

  .brand {
    width: 335px;
  }

  .primary-nav {
    transition: max-height 380ms ease, opacity var(--transition), padding var(--transition), border-width var(--transition);
  }

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

  .hero-media {
    min-height: 560px;
  }

  .section-heading,
  .clarity-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

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

  .services { padding-top: 32px; }
  .service-card--partnership { grid-template-columns: 1fr; gap: 0; }
  .partnership-visual { margin-top: 28px; }

  .service-card {
    min-height: 360px;
  }

  .standard-experience {
    grid-template-columns: 1fr;
  }

  .standard-tabs {
    display: grid;
    border-right: 0;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    overflow-x: auto;
  }

  .standard-tab {
    min-height: 100px;
    padding: 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .standard-tab:hover,
  .standard-tab.is-active {
    padding-left: 16px;
  }

  .ms-form {
    width: calc(100% + 14px);
    height: 1134px;
  }

  .footer-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  :root {
    --shell: calc(100% - 28px);
  }

  html { scroll-padding-top: 116px; }
  #contact,
  #services,
  #work { scroll-margin-top: calc(76px - 116px); }

  h1 {
    font-size: clamp(2.8rem, 13vw, 3.6rem);
  }

  h2 {
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

  .brand {
    width: min(287px, calc(100% - 52px)); /* leave room for 44px menu + 8px gap */
    flex: 0 1 auto;
    min-width: 0;
  }

  .primary-nav.is-open { max-height: calc(100dvh - 116px); }

  .hero { padding-top: 138px; padding-bottom: 40px; }
  .privacy-page { padding-top: 138px; }
  .privacy-promise { padding: 22px 20px 22px 22px; }
  .hero-copy .eyebrow { font-size: 0.76rem; letter-spacing: 0.12em; gap: 9px; }
  .hero-copy .eyebrow::before { width: 22px; }

  .hero-media {
    min-height: 0;
    aspect-ratio: 4 / 3;
    clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%);
  }

  .hero-points {
    grid-template-columns: 1fr;
  }

  .hero-points li {
    display: grid;
    grid-template-columns: 38px 1fr;
  }

  .services { padding-top: 28px; }

  .service-card {
    min-height: 330px;
  }

  .standard-panel {
    min-height: 470px;
  }

  .clarity-list li { grid-template-columns: 42px 1fr; }

  .projects-toolbar { gap: 12px; }
  .projects-partnership-link { font-size: 0.75rem; }
  .work-grid { grid-template-columns: 1fr; }
  .work-card { min-width: 0; }

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

  .footer-grid > div:first-child {
    grid-column: auto;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .project-dialog {
    width: calc(100vw - 20px);
  }

  .project-dialog > img { height: 46dvh; }

  .dialog-caption {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Desktop photo viewer: fills the whole screen, see-through (only the photo is solid), caption
   tucked into the lower-right corner, click/wheel zoom (photo-zoom.js). */
@media (min-width: 861px) {
  .project-dialog,
  .project-dialog[open] {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .project-dialog:not([open]) { display: none; }
  .project-dialog { background: transparent; overscroll-behavior: contain; }
  .project-dialog::backdrop { background: rgba(0, 0, 0, 0.5); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
  .project-dialog > img {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    width: 100%;
    object-fit: contain;
    background: transparent;
    cursor: zoom-in;
    transition: transform 0.25s ease;
  }
  .project-dialog.is-zoomed > img { cursor: zoom-out; transition: transform 0.25s ease, transform-origin 0s; }
  /* Snappier transform while zooming with the mouse wheel. */
  .project-dialog.is-wheeling > img { transition: transform 0.06s linear, transform-origin 0s; }
  /* Switching photos snaps straight to the fitted view (no zoom-out animation). */
  .project-dialog.no-zoom-anim > img { transition: none !important; }
  .project-dialog .dialog-caption,
  .project-dialog .gallery-navigation,
  .project-dialog .gallery-thumbnails {
    position: relative;
    z-index: 3;
    flex: 0 0 auto;
    align-self: center;
    width: fit-content;
    max-width: calc(100vw - 48px);
    background: rgba(23, 25, 28, 0.82);
    color: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  }
  .project-dialog .dialog-caption {
    position: fixed;
    right: 24px;
    bottom: 112px;
    margin: 0;
    align-self: auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    padding: 10px 16px;
    text-align: right;
  }
  .project-dialog .gallery-navigation { margin-top: 8px; padding: 8px 16px; }
  .project-dialog .gallery-thumbnails { margin: 8px auto 16px; padding: 10px; }
  .project-dialog .dialog-close { z-index: 3; }
}


/* Privacy policy page (privacy.html). These selectors do not apply on the homepage,
   except .footer-bottom a, which is defined with the footer styles above. */
.privacy-page {
  padding: clamp(132px, 13vw, 184px) 0 clamp(80px, 8vw, 120px);
}

.privacy-brand {
  margin: 0 0 6px;
  color: var(--graphite);
  font-size: 1.02rem;
}

.privacy-effective {
  margin: 0 0 36px;
  color: var(--graphite);
  font-size: 0.92rem;
  font-style: italic;
}

.privacy-page h1 {
  max-width: none;
  margin-bottom: 12px;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.08;
}

.privacy-body {
  max-width: 720px;
}

.privacy-promise {
  margin: 0 0 48px;
  padding: 28px 28px 28px 32px;
  border-left: 4px solid var(--red);
  background: var(--white);
  box-shadow: 0 8px 28px rgba(23, 25, 28, 0.06);
}

.privacy-promise-lead {
  margin: 0 0 14px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

.privacy-promise p:last-child {
  margin-bottom: 0;
  color: var(--graphite);
}

.privacy-section {
  margin-bottom: 2.4rem;
}

.privacy-page h2 {
  margin-bottom: 14px;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.privacy-page h3 {
  margin: 1.3rem 0 0.55rem;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.privacy-body p,
.privacy-body li {
  color: var(--carbon);
  font-size: 1.02rem;
  line-height: 1.65;
}

.privacy-body p {
  margin: 0 0 1rem;
}

.privacy-body ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.privacy-body li {
  margin: 0 0 0.4rem;
}

.privacy-body a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.privacy-body a:hover {
  color: var(--red-accessible);
}

/* Form iframe heights for narrow phones: keep Submit fully visible without showing
   the “Never give out your password / Report abuse” line (20px below Submit). */
@media (max-width: 519px) {
  .ms-form { height: 1154px; }
}

@media (max-width: 510px) {
  .ms-form { height: 1181px; }
}

@media (max-width: 438px) {
  .ms-form { height: 1203px; }
}

@media (max-width: 425px) {
  .ms-form { height: 1223px; }
}

/* ≤352px: Microsoft Forms swaps the inline form for a “Fill out the form” splash when the
   iframe is narrower than ~320px, so let the form card run edge to edge on these phones. */
@media (max-width: 352px) {
  .ms-form-wrap { margin-inline: calc(50% - 50vw); }
}

/* Edge-to-edge iframe of 338px or less (≤324px phones, e.g. iPhone SE 320) wraps one more line. */
@media (max-width: 324px) {
  .ms-form { height: 1241px; }
}
