/* ============================================================
   Forto — styles.css
   Design tokens, layout, components.
   See DESIGN.md for the canonical visual system.
   ============================================================ */

/* ---------- Fonts (self-hosted, OFL) ---------- */
@font-face {
  font-family: "Rethink Sans";
  src: url("fonts/Rethink_Sans/RethinkSans-VariableFont_wght.ttf") format("truetype-variations"),
       url("fonts/Rethink_Sans/RethinkSans-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rethink Sans";
  src: url("fonts/Rethink_Sans/RethinkSans-Italic-VariableFont_wght.ttf") format("truetype-variations"),
       url("fonts/Rethink_Sans/RethinkSans-Italic-VariableFont_wght.ttf") format("truetype");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Neutrals */
  --paper:        #F8F8F8;
  --white:        #FFFFFF;
  --ink:          #1A1A1A;
  --ink-soft:     #4A4A4A;
  --hairline:     rgba(26,26,26,0.14);
  --hairline-light: rgba(255,255,255,0.18);

  /* Teal range */
  --sage:         #C8E0E0;
  --teal:         #58A8A8;
  --petrol:       #105058;
  --petrol-deep:  #0A3439;

  /* Warm */
  --clay:         #B87040;
  --sand:         #F0E0D0;

  /* Gradients */
  --grad-hero:    linear-gradient(195deg, #0D4E54 0%, #449EA1 55%, #C9E4E3 100%);
  --grad-petrol:  linear-gradient(150deg, #15616B 0%, #0A3439 100%);
  --grad-warm:    linear-gradient(150deg, #F2E3D2 0%, #C98A57 100%);
  --grad-paper:   linear-gradient(180deg, #FFFFFF 0%, #F1F1EF 100%);
  --grad-tile:        linear-gradient(180deg, #F0E0D0 0%, #C8E0E0 52%, #58A8A8 100%);
  --grad-tile-rust:   linear-gradient(180deg, #F4E5D2 0%, #D6AD8A 50%, #B87542 100%);
  --grad-tile-blue:   linear-gradient(180deg, #C9E4E3 0%, #449EA1 50%, #0D4E54 100%);
  --grad-tile-green:  linear-gradient(180deg, #D0E1CE 0%, #A7B4A2 50%, #556A57 100%);

  /* Type scale */
  --font-sans: "Rethink Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fs-eyebrow: clamp(0.72rem, 0.7rem + 0.2vw, 0.82rem);
  --fs-body:    clamp(1rem, 0.97rem + 0.2vw, 1.125rem);
  --fs-lead:    clamp(1.15rem, 1.05rem + 0.6vw, 1.5rem);
  --fs-h3:      clamp(1.35rem, 1.1rem + 1.2vw, 1.9rem);
  --fs-h2:      clamp(2rem, 1.4rem + 3vw, 3.5rem);
  --fs-hero:    clamp(2.6rem, 1.6rem + 5vw, 5.5rem);
  --fs-stat:    clamp(2.8rem, 1.8rem + 5vw, 6rem);

  /* Layout */
  --container: 1440px;
  --pad-x: clamp(1rem, 5vw, 3rem);   /* 16px mobile → 48px desktop */
  --pad-y: clamp(4rem, 10vh, 9rem);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
  border-radius: 2px;
}
::selection { background: var(--petrol); color: var(--white); }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--white);
  padding: 0.75rem 1rem; z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Container / sections ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.section { padding-block: var(--pad-y); position: relative; }
.section--paper  { background: var(--paper); }
.section--white  { background: var(--white); }
.section--sand   { background: var(--sand); }
.section--sage   { background: var(--sage); }
.section--petrol { background: var(--grad-petrol); color: var(--white); }
.section--petrol .lead { color: rgba(255,255,255,0.78); }

/* Vary cadence — odd sections breathe a touch more */
.project    { padding-block: clamp(4rem, 9vh, 8rem); }
.why        { padding-block: clamp(5rem, 12vh, 10rem); }
.market     { padding-block: clamp(4.5rem, 10vh, 9rem); }
.location   { padding-block: clamp(4rem, 9vh, 8rem); background: #E7EFEF; }
.thesis     { padding-block: clamp(5rem, 11vh, 9.5rem); }
.opportunity{ padding-block: clamp(5.5rem, 13vh, 11rem); }
.strategy   { padding-block: clamp(4rem, 9vh, 8rem); }
.timeline   { padding-block: clamp(4.5rem, 10vh, 9rem); }
.portfolio  { padding-block: clamp(5rem, 11vh, 10rem); }
.cta        { padding: 56px 8px 112px; background: var(--paper); }

/* ---------- Typography roles ---------- */
.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.eyebrow--clay  { color: var(--clay); }
.eyebrow--light { color: rgba(255,255,255,0.7); }

.h2 {
  font-size: var(--fs-h2);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.h2--light { color: var(--white); }

.lead {
  font-size: var(--fs-lead);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-soft);
}
.lead--light { color: rgba(255,255,255,0.82); }

/* Section heads */
.section__head { margin-bottom: clamp(2.5rem, 5vh, 4rem); }
.section__head .h2 { margin-top: 0.4rem; }
.section__head--split { display: grid; gap: 1rem; }
@media (min-width: 900px) {
  .section__head--split {
    grid-template-columns: 1fr 2fr;
    align-items: end;
    column-gap: clamp(2rem, 6vw, 6rem);
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease, border-color 200ms ease;
  min-height: 44px;
  letter-spacing: 0.01em;
}
.btn--primary {
  background: var(--ink);
  color: var(--white);
}
.btn--primary:hover {
  background: #000;
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover {
  background: var(--ink);
  color: var(--white);
}
.btn--light {
  background: var(--white);
  color: var(--ink);
}
.btn--light:hover {
  background: var(--sage);
  transform: translateY(-1px);
}

/* Inline CTAs nested in content sections */
.why__cta    { margin-top: clamp(1rem, 2vw, 1.5rem); justify-self: start; }
.thesis__cta { margin-top: clamp(1.25rem, 2.5vw, 2rem); justify-self: start; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition:
    transform 450ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 300ms ease,
    background 250ms ease,
    border-color 250ms ease,
    color 250ms ease,
    backdrop-filter 250ms ease;
  border-bottom: 1px solid transparent;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .nav { transition: background 250ms ease, border-color 250ms ease, color 250ms ease; }
}
.nav__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding: 1rem var(--pad-x);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 2rem;
}
.nav__brand { display: inline-flex; align-items: center; }
.nav__logo {
  height: 22px;
  width: auto;
  transition: filter 250ms ease;
}
.nav__links {
  display: none;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.nav__links a { position: relative; padding: 0.5rem 0; }
.nav__links a:hover { color: var(--clay); }
.nav__cta {
  display: none;
  padding: 0.6rem 1.1rem;
  min-height: 40px;
  font-size: 0.9rem;
}
.nav__toggle {
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 4px;
  width: 44px; height: 40px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  color: inherit;
}
.nav__toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
}

@media (min-width: 900px) {
  .nav__links { display: inline-flex; justify-self: end; }
  .nav__cta { display: inline-flex; }
  .nav__toggle { display: none; }
  .nav__inner { grid-template-columns: auto 1fr auto; }
}

/* State: over hero (hidden — the hero owns its own logo + vertical nav) */
.nav[data-state="over-hero"] {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

/* State: scrolled */
.nav[data-state="scrolled"] {
  background: rgba(248, 248, 248, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: var(--hairline);
  color: var(--ink);
}

/* Mobile menu — top-anchored drop-down panel. Self-contained: logo + close button visible inside. */
.nav__mobile {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--petrol);
  background-image: var(--grad-petrol);
  color: var(--white);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  transform: translateY(-100%);
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 360ms;
}
.nav__mobile[data-open="true"] {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition:
    transform 360ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
}

.nav__mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--pad-x);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.nav__mobile-brand { display: inline-flex; align-items: center; }
.nav__mobile-logo {
  height: 26px;
  width: auto;
  filter: invert(1) brightness(2);
}
.nav__mobile-close {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--white);
  border-radius: 4px;
  transition: background 150ms ease;
}
.nav__mobile-close:hover { background: rgba(255, 255, 255, 0.08); }

.nav__mobile-list {
  display: flex;
  flex-direction: column;
  padding: 0.5rem var(--pad-x) 1.5rem;
  gap: 0;
}
.nav__mobile-list a {
  padding: 0.85rem 0;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
  font-size: clamp(1.15rem, 3.5vw, 1.5rem);
  letter-spacing: -0.01em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav__mobile-list a:hover { color: var(--sage); }
.nav__mobile-list .btn {
  align-self: flex-start;
  margin-top: 1.25rem;
  background: var(--white);
  color: var(--ink);
  font-size: 1rem;
  border-bottom: 0;
  padding: 0.85rem 1.5rem;
}

@media (min-width: 900px) {
  .nav__mobile { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nav__mobile { transition: visibility 0s; }
}

/* ---------- HERO (v2: full-bleed, centered render, vertical nav, address banner) ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--pad-x);
  background: var(--grad-hero);
  overflow: hidden;
  isolation: isolate;
  color: var(--white);
  display: grid;
  grid-template-rows: 1fr;
}

/* The hero render is wrapped in a <picture> for WebP/PNG fallback. The
   wrapper is positioned absolutely so it does not occupy a grid track;
   the img inside then centres within it. */
.hero > picture {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero__render {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
  width: clamp(260px, 50vw, 880px);
  height: auto;
  max-height: 60vh;
  object-fit: contain;
}

.hero__layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 2rem;
  width: 100%;
}

.hero__brand {
  display: grid;
  gap: clamp(1.5rem, 4vh, 3rem);
  max-width: 320px;
  justify-items: start;
}

.hero__logo {
  height: clamp(50px, 6.25vw, 75px);
  width: auto;
  filter: invert(1) brightness(2);
}

.hero__copy { display: grid; gap: 0.6rem; }

.hero__headline {
  font-size: clamp(22px, 1.4rem + 0.6vw, 32px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--white);
}

.hero__lead {
  position: absolute;
  right: var(--pad-x);
  /* Sit just above the address text. Address is 17vw with line-height 0.92,
     so its top is ~15.6vw from the bottom; this keeps the lead clear of it
     at every viewport width and well below the centred render. */
  bottom: max(80px, calc(16vw + 1rem));
  z-index: 3;
  font-size: clamp(13px, 0.85rem + 0.15vw, 16px);
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  max-width: 28ch;
  text-align: right;
  margin: 0;
}

.hero__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: clamp(0.6rem, 1.6vh, 1.25rem);
  text-align: right;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-top: 0.4rem;
}
.hero__nav a {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.25rem 0;
  transition: color 200ms ease, transform 200ms ease;
}
.hero__nav a:hover { color: var(--white); transform: translateX(-2px); }

.hero__toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  width: 44px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--white);
  padding: 0;
}
.hero__toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
}

.hero__address {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  white-space: nowrap;
  /* JS sets font-size to fit viewport width exactly; this is the no-JS fallback. */
  font-size: 17vw;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.92;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  pointer-events: none;
  user-select: none;
  overflow: hidden;
  text-align: left;
}

@media (max-width: 899px) {
  .hero__nav { display: none; }
  .hero__toggle { display: inline-flex; }
  .hero__render {
    transform: translate(-50%, -55%);
    width: clamp(260px, 82vw, 600px);
    max-height: 60vh;
  }
}

/* ---------- PROJECT ---------- */
.project__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.project__image img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.project__body { display: grid; gap: 1.25rem; }
.project__body .h2 { margin-top: 0.25rem; }
.project__body .lead { margin-top: 0.5rem; }
.project__facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 1.5rem;
  border-top: 1px solid var(--hairline);
}
.project__facts li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--hairline);
  display: grid;
  gap: 0.25rem;
}
.project__facts li:nth-child(odd) { padding-right: 1.5rem; border-right: 1px solid var(--hairline); }
.project__facts li:nth-child(even) { padding-left: 1.5rem; }
.project__facts strong {
  font-weight: 600;
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.4rem);
  letter-spacing: -0.02em;
}
.project__facts span { font-size: 0.95rem; color: var(--ink-soft); }

@media (min-width: 900px) {
  .project__grid {
    grid-template-columns: 1.05fr 1fr;
    gap: clamp(3rem, 7vw, 6rem);
  }
  .project__image img { aspect-ratio: 4 / 5; }
}

/* ---------- WHY OTTAWA ---------- */
.why {
  position: relative;
  isolation: isolate;
  color: var(--white);
  overflow: hidden;
}
.why__bg {
  position: absolute;
  top: -15%;
  bottom: -15%;
  left: 0;
  right: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(13,46,52,0.55) 0%, rgba(13,46,52,0.45) 50%, rgba(13,46,52,0.65) 100%),
    url('assets/ottawa-04.jpg') center / cover no-repeat;
  will-change: transform;
}

.why__bento {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
}

.why__intro {
  display: grid;
  gap: 0.6rem;
  align-content: start;
  padding: clamp(1.5rem, 2.4vw, 2.25rem);
}
.why__intro .eyebrow { color: rgba(255,255,255,0.78); }
.why__intro .h2 { color: var(--white); max-width: 18ch; }

.why__tile {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.6rem;
  padding: clamp(1.5rem, 2.4vw, 2.25rem);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: var(--white);
  min-height: clamp(220px, 28vh, 320px);
}
.why__tile + .why__tile { border-top: 0; }
.why__tile .why__num {
  font-weight: 600;
  font-size: clamp(1.6rem, 1.1rem + 1.2vw, 2.1rem);
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.95);
  line-height: 1;
}
.why__tile h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--white);
}
.why__tile p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 42ch;
}

@media (min-width: 900px) {
  .why__bento {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(clamp(170px, 22vh, 240px), auto);
    gap: 0;
  }
  /* Asymmetric placement on a 6-col grid — every tile edge lands on a shared grid line */
  .why__intro {
    grid-column: 1 / span 2;
    grid-row: 1 / span 2;
    padding: clamp(1.75rem, 3vw, 3rem);
    border: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .why__tile { border: 1px solid rgba(255, 255, 255, 0.18); }
  .why__tile:nth-of-type(1) { grid-column: 3 / span 2; grid-row: 1; }
  .why__tile:nth-of-type(2) { grid-column: 5 / span 2; grid-row: 1; }
  .why__tile:nth-of-type(3) { grid-column: 3 / span 2; grid-row: 2; }
  .why__tile:nth-of-type(4) { grid-column: 5 / span 2; grid-row: 3; }
}

/* ---------- MARKET ---------- */
.market__pillars {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--hairline);
}
.market__pillars article {
  padding: 2rem 0;
  border-bottom: 1px solid var(--hairline);
  display: grid;
  gap: 0.5rem;
  max-width: 60ch;
}
.market__pillars h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.market__pillars p { color: var(--ink-soft); }
@media (min-width: 800px) {
  .market__pillars {
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(2rem, 5vw, 5rem);
  }
  .market__pillars article { padding-block: 2.25rem; }
}

.market__stats {
  margin-top: clamp(2.5rem, 5vh, 4rem);
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  grid-template-columns: 1fr;
  padding-top: clamp(2.5rem, 5vh, 4rem);
}
@media (min-width: 800px) {
  .market__stats { grid-template-columns: repeat(3, 1fr); }
}

.stat { display: grid; gap: 0.75rem; }
.stat__num {
  font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat__num small {
  font-size: 0.45em;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0;
}
.stat__label { color: var(--ink-soft); max-width: 32ch; }

.stat--inline .stat__num { color: var(--ink); }

/* ---------- LOCATION ---------- */
.location__intro {
  display: grid;
  gap: 0.6rem;
  margin-bottom: clamp(2.5rem, 5vh, 4.5rem);
}
.location__intro .h2 { margin-top: 0.4rem; }
.location__intro .lead { margin-top: 1rem; }

.location__split {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}
.location__map-wrap { min-width: 0; }

.location__rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hairline);
}
.location__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "num title    distance"
    "num desc     desc";
  column-gap: clamp(0.85rem, 2vw, 1.2rem);
  row-gap: 0.35rem;
  padding: 16px 8px;
  border-bottom: 1px solid var(--hairline);
  align-items: baseline;
  cursor: pointer;
  outline: none;
  transition: background-color 200ms ease;
}
.location__row:hover,
.location__row:focus-visible,
.location__row[data-active="true"] {
  background: rgba(184, 112, 64, 0.07);
}
.location__row:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
  border-radius: 2px;
}
.location__num      { grid-area: num; }
.location__title    { grid-area: title; }
.location__distance { grid-area: distance; }
.location__desc     { grid-area: desc; }

.location__num {
  align-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--white);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.location__row:hover .location__num,
.location__row:focus-visible .location__num,
.location__row[data-active="true"] .location__num {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--white);
}

.location__distance {
  font-size: clamp(0.75rem, 0.7rem + 0.2vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay);
  line-height: 1;
  white-space: nowrap;
}
.location__title {
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}
.location__desc {
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0;
  font-size: clamp(0.95rem, 0.92rem + 0.15vw, 1.05rem);
}

/* Mobile: map first (fixed-aspect block), list below — source order already supplies this. */
@media (min-width: 1024px) {
  .location__split {
    grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
    column-gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
  }
  .location__map-wrap {
    position: sticky;
    top: calc(64px + 24px); /* nav height + breathing room */
  }
}

/* ---------- LOCATION MAP ---------- */
.map {
  margin: 0;
  position: relative;
  background: #EFF4F4;
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.map__layer {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.map__base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Slight desaturation so our clay/ink chrome reads stronger over Mapbox light-v11. */
  filter: saturate(0.85) contrast(1.02);
}
.map__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  font-family: var(--font-sans);
  pointer-events: none;     /* re-enabled on interactive children below */
}
.map__svg .map__marker { pointer-events: auto; }

/* SVG text */
.map__pin-num {
  font-family: var(--font-sans);
}

/* Building anchor — star sits on top of every other layer. */
.map__anchor { pointer-events: none; }
.map__star {
  fill: var(--clay);
  stroke: var(--white);
  stroke-width: 6;
  stroke-linejoin: round;
  paint-order: stroke fill;
}

/* Pin markers (viewBox 1280 × 960). The translate() is set by JS at runtime. */
.map__marker {
  cursor: pointer;
  outline: none;
}
.map__hit { fill: transparent; }
.map__pin {
  fill: var(--white);
  stroke: var(--ink);
  stroke-width: 3;
  transition: fill 180ms ease, stroke 180ms ease, r 180ms ease, stroke-width 180ms ease;
}
.map__pin-num {
  font-size: 22px;
  font-weight: 700;
  fill: var(--ink);
  stroke: none;             /* numbers already legible inside the pin */
  pointer-events: none;
  user-select: none;
  transition: fill 180ms ease, font-size 180ms ease;
}
.map__marker:hover .map__pin,
.map__marker:focus-visible .map__pin,
.map__marker[data-active="true"] .map__pin {
  fill: var(--clay);
  stroke: var(--clay);
  r: 30;
  stroke-width: 3.5;
}
.map__marker:hover .map__pin-num,
.map__marker:focus-visible .map__pin-num,
.map__marker[data-active="true"] .map__pin-num {
  fill: var(--white);
  font-size: 25px;
}
.map__marker:focus-visible .map__hit {
  fill: rgba(184, 112, 64, 0.16);
}

/* Connector line (clay, animated in by JS) */
.map__connector {
  transition: opacity 200ms ease;
  pointer-events: none;
}

/* Popover */
.map__popover {
  position: absolute;
  top: 8px;
  right: 8px;
  width: min(280px, calc(100% - 16px));
  background: var(--white);
  border: 1px solid var(--hairline);
  padding: 14px 14px 16px;
  display: grid;
  gap: 10px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
  z-index: 2;
}
.map__popover[data-state="open"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.map__popover[hidden] { display: none; }
.map__popover-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 8px;
}
.map__popover-close:hover { color: var(--ink); }
.map__popover-thumb {
  aspect-ratio: 16 / 10;
  background: var(--sand);
  overflow: hidden;
}
.map__popover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.map__popover-distance {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay);
  margin: 0;
  line-height: 1;
}
.map__popover-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
  line-height: 1.2;
}
.map__popover-desc {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .map__pin,
  .map__pin-num,
  .map__connector,
  .map__popover,
  .location__row,
  .location__num {
    transition: none !important;
  }
}

/* ---------- THESIS ---------- */
.thesis__grid {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
}
.thesis__copy .h2 { margin-top: 0.4rem; }
.thesis__copy .lead { margin-top: 1.25rem; }
.thesis__data {
  display: grid;
  border-top: 1px solid var(--hairline);
}
.thesis__data > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--hairline);
}
.thesis__data dt { color: var(--ink-soft); }
.thesis__data dd {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.8rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
@media (min-width: 950px) {
  .thesis__grid { grid-template-columns: 5fr 6fr; gap: clamp(3rem, 6vw, 6rem); align-items: start; }
}

/* ---------- OPPORTUNITY ---------- */
.opportunity { color: var(--white); text-align: center; }
.opportunity__head {
  margin: 0 auto clamp(2.5rem, 6vh, 4.5rem);
}
.opportunity__head .h2 { margin: 0.5rem auto 0; }

.opportunity__stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3rem) clamp(2rem, 5vw, 4rem);
  padding-top: clamp(2rem, 4vh, 3rem);
  justify-items: center;
}
.opp-stat {
  display: grid;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  justify-items: center;
  text-align: center;
}
.opp-stat__num {
  font-size: var(--fs-stat);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.opp-stat__label {
  color: var(--sage);
  font-size: 1rem;
  max-width: 24ch;
  letter-spacing: 0.01em;
}
@media (min-width: 700px) {
  .opportunity__stats { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .opportunity__stats {
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(1.5rem, 3vw, 3rem);
  }
  .opp-stat__num { font-size: clamp(2.4rem, 1.6rem + 2.8vw, 4.6rem); }
}

.opportunity__note {
  margin: clamp(2.5rem, 5vh, 4rem) auto 0;
  color: rgba(255,255,255,0.78);
  max-width: 70ch;
  padding-top: clamp(1.5rem, 3vh, 2.5rem);
  font-size: 1rem;
}
.opportunity__cta { margin-top: 2rem; }

/* ---------- STRATEGY ---------- */
.strategy__steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--hairline);
}
.strategy__steps li {
  padding: 2rem 0;
  border-bottom: 1px solid var(--hairline);
  display: grid;
  gap: 0.6rem;
}
.strategy__num {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--clay);
}
.strategy__steps h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.strategy__steps p { color: var(--ink-soft); max-width: 50ch; }

@media (min-width: 900px) {
  .strategy__steps {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
  }
  .strategy__steps li {
    padding: 2.5rem clamp(1rem, 2vw, 1.75rem) 2.5rem 0;
    border-bottom: none;
    border-right: 1px solid var(--hairline);
  }
  .strategy__steps li:last-child { border-right: none; padding-right: 0; }
  .strategy__steps li:not(:first-child) { padding-left: clamp(1rem, 2vw, 1.75rem); }
}

/* ---------- TIMELINE ---------- */
.timeline__track {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.timeline__track li {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--hairline);
}
.timeline__date {
  font-weight: 600;
  letter-spacing: -0.01em;
  min-width: 5.5rem;
}
.timeline__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--teal);
  display: inline-block;
}
.timeline__dot--clay { background: var(--clay); }
.timeline__track p { color: var(--ink-soft); }

@media (min-width: 1000px) {
  .timeline__track {
    grid-template-columns: repeat(8, 1fr);
    padding-top: 2.5rem;
    position: relative;
    gap: 0;
  }
  .timeline__track::before {
    content: "";
    position: absolute;
    /* aligns with the dot's vertical center: padding-top + date line + row gap + dot margin + half dot */
    top: calc(2.5rem + 1.425rem + 0.75rem + 0.25rem + 7px);
    left: 0; right: 0;
    height: 1px;
    background: var(--hairline);
  }
  .timeline__track li {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0 1rem 0 0;
    border: none;
    align-items: start;
    grid-template-rows: auto auto 1fr;
    position: relative;
  }
  .timeline__date { font-size: 0.95rem; min-width: 0; }
  .timeline__dot {
    width: 14px; height: 14px;
    margin-top: 0.25rem;
    z-index: 1;
  }
  .timeline__track p { font-size: 0.95rem; padding-top: 0.5rem; max-width: 18ch; }
}

/* ---------- PORTFOLIO (mosaic) ---------- */
.portfolio__mosaic {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* Small tablets and below: intro flows naturally above the grid, mosaic starts immediately below. */
@media (max-width: 1023px) {
  .portfolio__mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }
  /* Intro spans full width as a content-height block, no forced square. */
  .portfolio__mosaic > :nth-child(1)  {
    grid-column: 1 / span 2;
    grid-row: 1;
    aspect-ratio: auto;
  }
  .portfolio__mosaic > :nth-child(2)  { grid-column: 1; grid-row: 2; }  /* stat 7 */
  .portfolio__mosaic > :nth-child(3)  { grid-column: 2; grid-row: 2; }  /* photo 01 */
  .portfolio__mosaic > :nth-child(4)  { grid-column: 1; grid-row: 3; }  /* photo 02 */
  .portfolio__mosaic > :nth-child(5)  { grid-column: 2; grid-row: 3; }  /* stat 538 */
  .portfolio__mosaic > :nth-child(6)  { grid-column: 1; grid-row: 4; }  /* photo 03 */
  .portfolio__mosaic > :nth-child(7)  { grid-column: 2; grid-row: 4; }  /* stat 188M */
  .portfolio__mosaic > :nth-child(8)  { grid-column: 1; grid-row: 5; }  /* stat 45M */
  .portfolio__mosaic > :nth-child(9)  { grid-column: 2; grid-row: 5; }  /* stat 1262 */
  .portfolio__mosaic > :nth-child(10) { grid-column: 1; grid-row: 6; }  /* photo 04 */
  .portfolio__mosaic > :nth-child(11) { grid-column: 2; grid-row: 6; }  /* photo 05 */
  .portfolio__mosaic > :nth-child(12) { grid-column: 1; grid-row: 7; }  /* empty */
}

.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--ink);
  overflow: hidden;
}

.tile--intro {
  background: transparent;
  padding: 0 0 clamp(1.5rem, 3vw, 2.5rem);
  justify-content: flex-start;
}
.tile--intro .h2 {
  margin-top: 0.4rem;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.2rem);
  line-height: 1.15;
}
.tile--intro .lead {
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  line-height: 1.5;
}

.tile--stat { background: var(--grad-tile); }
.tile--stat-rust  { background: var(--grad-tile-rust); }
.tile--stat-blue  { background: var(--grad-tile-blue); }
.tile--stat-green { background: var(--grad-tile-green); }

.tile--stat .tile__num {
  font-size: clamp(1.8rem, 1.2rem + 1.8vw, 2.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--ink);
}
.tile--stat .tile__label {
  font-size: clamp(0.9rem, 0.85rem + 0.2vw, 1.05rem);
  color: var(--ink);
  max-width: 22ch;
  align-self: flex-start;
}

/* Dark-bottomed gradients: flip all text to white for contrast. Must come after .tile--stat rules. */
.tile--stat-blue  .tile__num,
.tile--stat-blue  .tile__label,
.tile--stat-green .tile__num,
.tile--stat-green .tile__label { color: var(--white); }

.tile--photo {
  padding: 0;
  display: block;
  margin: 0;
}
.tile--photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portfolio__team {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  margin-top: clamp(1rem, 2vw, 2rem);
  border-top: 1px solid var(--hairline);
}
@media (min-width: 700px) {
  .portfolio__team {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2.5rem, 5vw, 5rem);
  }
}
.principal {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.principal__photo {
  margin: 0;
  width: 88px;
  height: 88px;
  background: var(--sage);
  overflow: hidden;
  border-radius: 50%;
}
.principal__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(0.15) contrast(1.02);
}
.principal h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
}
.principal h3 span {
  font-weight: 400;
  color: var(--ink-soft);
  letter-spacing: 0;
}
.principal p {
  margin-top: 0.5rem;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 42ch;
}

.tile--empty { background: transparent; }

@media (min-width: 1024px) {
  /* 5 cols × 3 rows of perfect squares. Team has been pulled out into its own subsection below. */
  .portfolio__mosaic {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    aspect-ratio: 5 / 3;
  }
  .tile { min-height: 0; }

  /* Positions follow DOM order. INTRO is 2×2; everything else is 1×1. */
  .portfolio__mosaic > :nth-child(1)  { grid-column: 1 / span 2; grid-row: 1 / span 2; } /* intro */
  .portfolio__mosaic > :nth-child(2)  { grid-column: 3; grid-row: 1; }                   /* stat 7 */
  .portfolio__mosaic > :nth-child(3)  { grid-column: 4; grid-row: 1; }                   /* photo 01 */
  .portfolio__mosaic > :nth-child(4)  { grid-column: 5; grid-row: 1; }                   /* photo 02 */
  .portfolio__mosaic > :nth-child(5)  { grid-column: 4; grid-row: 2; }                   /* stat 538 */
  .portfolio__mosaic > :nth-child(6)  { grid-column: 3; grid-row: 2; }                   /* photo 03 */
  .portfolio__mosaic > :nth-child(7)  { grid-column: 5; grid-row: 2; }                   /* stat 188M */
  .portfolio__mosaic > :nth-child(8)  { grid-column: 1; grid-row: 3; }                   /* stat 45M */
  .portfolio__mosaic > :nth-child(9)  { grid-column: 4; grid-row: 3; }                   /* stat 1262 */
  .portfolio__mosaic > :nth-child(10) { grid-column: 2; grid-row: 3; }                   /* photo 04 */
  .portfolio__mosaic > :nth-child(11) { grid-column: 3; grid-row: 3; }                   /* photo 05 */
  .portfolio__mosaic > :nth-child(12) { grid-column: 5; grid-row: 3; }                   /* empty */

  .tile--intro {
    padding: clamp(1.5rem, 2.5vw, 2.25rem);
    justify-content: flex-start;
  }
}

/* ---------- CONTACT ---------- */
/* ---------- CTA (pre-footer) ---------- */
.cta__container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1280px;
  margin-inline: auto;
  align-items: stretch;
  gap: 0;
}
.cta__card {
  background: linear-gradient(180deg, #b87542 0%, #d6ad8a 56%, #f4e5d2 100%);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  color: var(--white);
  min-width: 0;
}
.cta__copy {
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.cta__eyebrow {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: -0.3px;
  margin: 0;
  color: var(--white);
}
.cta__headline {
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -1.12px;
  color: var(--white);
  margin: 0;
}
.cta__lead {
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.32px;
  color: var(--white);
  margin: 0;
}
.cta__buttons {
  display: flex;
  gap: 8px;
}
.cta__btn {
  flex: 1 0 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  color: var(--ink);
  padding: 24px 16px;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-size: 18px;
  letter-spacing: -0.36px;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 200ms ease, transform 200ms ease;
}
.cta__btn:hover { opacity: 0.92; transform: translateY(-1px); }
.cta__image {
  position: relative;
  min-height: 634px;
  overflow: hidden;
  margin: 0;
}
.cta__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 899px) {
  .cta { padding: 0; }
  .cta__container {
    position: relative;
    grid-template-columns: 1fr;
    max-width: none;
    min-height: 620px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .cta__image {
    position: absolute;
    inset: 0;
    min-height: auto;
    z-index: 0;
  }
  .cta__card {
    position: relative;
    z-index: 1;
    width: 352px;
    max-width: calc(100% - 32px);
    padding: 24px;
    gap: 48px;
    margin: 0;
  }
  .cta__copy { gap: 40px; }
  .cta__headline { font-size: 40px; letter-spacing: -0.8px; }
  .cta__buttons { flex-direction: column; }
  .cta__btn { font-size: 16px; letter-spacing: -0.32px; }
}

/* ---------- MODAL ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none; }
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 26, 30, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  cursor: pointer;
  opacity: 0;
  transition: opacity 300ms ease;
}
.modal__panel {
  position: relative;
  z-index: 1;
  background: var(--white);
  width: 100%;
  max-width: 720px;
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(13, 26, 30, 0.18);
  transform: translateY(100vh);
  opacity: 0;
  transition:
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 320ms ease;
}
.modal[data-state="open"] .modal__overlay { opacity: 1; }
.modal[data-state="open"] .modal__panel {
  transform: translateY(0);
  opacity: 1;
}
.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  border-radius: 50%;
  transition: background 150ms ease;
}
.modal__close:hover { background: rgba(0,0,0,0.06); }
.modal__eyebrow { color: var(--clay); }
.modal__title {
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0.5rem 0 0.5rem;
}
.modal__lead {
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
}
.modal__calendar {
  width: 100%;
  min-height: 540px;
}
.modal__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 540px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 0.95rem;
  border: 1px dashed var(--hairline);
  text-align: center;
  padding: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .modal__overlay,
  .modal__panel { transition: opacity 200ms ease; transform: none; }
}

/* ---------- FOOTER ---------- */
/* Layered footer: sky bg → gradient panel → building image → content overlay.
   Aspect-locked so the composition scales together across breakpoints. */
.footer {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background: url('assets/forto-footer-background.jpg') center / cover no-repeat;
  aspect-ratio: 1920 / 1640;
  isolation: isolate;
}

.footer__panel {
  position: absolute;
  /* Desktop: 1736 panel inside 1920 frame, bottom-aligned. */
  left: 4.79%;
  right: 4.79%;
  top: 6.71%;
  bottom: 0;
  background: linear-gradient(180deg, #0d4e54 0%, #449ea1 28.33%, #c9e4e3 85%);
  z-index: 1;
}

.footer__building {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  /* Desktop: building 1855 wide in 1920 frame = 96.59% */
  width: 96.59%;
  height: auto;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

.footer__inner {
  position: absolute;
  /* Desktop: logo top at 200.7/1640 = 12.24% from frame top; left at 169.11/1920 = 8.81% */
  top: 12.24%;
  left: 8.81%;
  right: 8.81%;
  z-index: 3;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(1.5rem, 4vw, 5rem);
  align-items: start;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 3vw, 4rem);
}

.footer__logo {
  width: clamp(140px, 24vw, 470px);
  height: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.footer__by {
  font-size: clamp(0.85rem, 1.2vw, 1.4rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  color: var(--white);
}
.footer__by a {
  color: inherit;
  text-decoration: underline;
}
.footer__by a:hover { opacity: 0.8; }

.footer__legal {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2vw, 2.5rem);
  justify-self: end;
  max-width: 36ch;
}

.footer__disclaimer,
.footer__copy {
  font-size: clamp(0.7rem, 0.8vw, 0.95rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--white);
}

/* Small tablets and below: taller portrait footer, content stacks in a single column. */
@media (max-width: 768px) {
  .footer {
    aspect-ratio: 414 / 620;
  }
  .footer__panel {
    top: 16px;
    left: 16px;
    right: 16px;
    bottom: auto;
    height: 73.25%;   /* 454.14 / 620 */
  }
  .footer__building {
    width: 128.16%;   /* 530.6 / 414 — building overflows past the panel sides */
    bottom: 0;
  }
  .footer__inner {
    /* Anchor the text block just above the building's top edge to shrink the gap between them. */
    top: auto;
    bottom: 56%;
    left: 8.7%;       /* 36 / 414 */
    right: 8.7%;
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .footer__brand { gap: 13.8px; }
  .footer__logo  { width: 46.8%; }  /* 193.9 / 414 */
  .footer__by    { font-size: 14px; }
  .footer__legal {
    justify-self: stretch;
    max-width: none;
    gap: 16px;
  }
  .footer__disclaimer,
  .footer__copy  { font-size: 14px; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
