:root {
  --bg: #e8e8e8;
  --text: #393c40;
  --muted: #575f62;
  --line: #c8c8c8;
  --accent: #3e4d54;
  --content-width: min(1280px, 95vw);
  /* Home tuning */
  --home-footer-gap: 0rem;
  --home-main-min-height: auto;
  --home-main-bottom-space: 0rem;
  --home-scroll-runway-space: 5rem;
  --home-contact-top-space: 5rem;
  --home-contact-bottom-space: 0rem;
  --home-contact-text-width: 70ch;
  --landscape-col-offset-1: 3.85rem;
  --landscape-col-offset-2: 6.85rem;
  --landscape-col-offset-3: 10.9rem;
  --landscape-subtitle-rise: 0.22rem;
  --landscape-hero-min-start: 94vh;
  --landscape-hero-min-end: 0vh;
  --landscape-hero-top-pad-start: 3rem;
  --landscape-hero-top-pad-end: 0rem;
  --landscape-hero-bottom-pad-start: 1rem;
  --landscape-hero-bottom-pad-end: 0rem;
  --landscape-subtitle-wordmark-gap-base: 0rem;
  --landscape-subtitle-wordmark-gap-spread: 7rem;
  --landscape-subtitle-wordmark-gap-reveal: 0rem;
  --landscape-sections-lift-max: 0rem;
  /* Wordmark palette (A R C H I M M E R S I O N) */
  --wm-a: #f21f3d;
  --wm-r: #0b6f3a;
  --wm-c: #ba9796;
  --wm-h: #732f93;
  --wm-i1: #a79879;
  --wm-m1: #97b8d4;
  --wm-m2: #8b163f;
  --wm-e: #7da892;
  --wm-r2: #665f22;
  --wm-s: #9358a4;
  --wm-i2: #ef7f1a;
  --wm-o: #3f3f9f;
  --wm-n: #7fba3e;
  /* Homepage keyword colors are derived from wordmark tokens */
  --subtitle-design: var(--wm-h);
  --subtitle-design-underline: var(--wm-c);
  --subtitle-representation: var(--wm-o);
  --subtitle-representation-underline: var(--wm-m1);
  --subtitle-communication: var(--wm-i2);
  --subtitle-communication-underline: var(--wm-i1);
}

/* Liquid-glass palette sampled from reflected highlights/tones in provided photo. */
body[data-palette="liquid-glass"] {
  --wm-a: #d8d4c6;
  --wm-r: #8c9a9d;
  --wm-c: #b9b6aa;
  --wm-h: #7a8792;
  --wm-i1: #dcd8cc;
  --wm-m1: #9cadbd;
  --wm-m2: #6c7a89;
  --wm-e: #c7d0cb;
  --wm-r2: #8f7d6a;
  --wm-s: #6f86a3;
  --wm-i2: #c6b69b;
  --wm-o: #4f6076;
  --wm-n: #a6afa2;
  /* Explicit subtitle remap for liquid-glass mode (muted, no vivid orange) */
  --subtitle-design: var(--wm-s);
  --subtitle-design-underline: var(--wm-c);
  --subtitle-representation: var(--wm-o);
  --subtitle-representation-underline: var(--wm-m1);
  --subtitle-communication: var(--wm-r2);
  --subtitle-communication-underline: var(--wm-i1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Avenir Next", "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

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

.skip-link {
  left: -9999px;
  position: absolute;
  top: 0;
}

.skip-link:focus {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  left: 1rem;
  padding: 0.4rem 0.65rem;
  top: 1rem;
}

.site-main {
  margin: 0 auto;
  max-width: var(--content-width);
  min-height: calc(100vh - 5.5rem);
  padding: 2rem 1rem 3rem;
}

.site-main--home {
  min-height: var(--home-main-min-height);
  padding-bottom: var(--home-main-bottom-space);
  padding-top: 0.25rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin-top: var(--home-footer-gap);
  padding: 1rem;
  text-align: center;
}

.subpage-topbar {
  background: rgba(235, 235, 235, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.subpage-topbar-inner {
  align-items: center;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  margin: 0 auto;
  max-width: var(--content-width);
  padding: 0.7rem 1rem;
}

.subpage-nav {
  display: flex;
  gap: 0.8rem;
  justify-self: start;
}

.subpage-nav a {
  color: #5f6668;
  font-size: 1.05rem;
  text-decoration: none;
}

.subpage-nav a:hover,
.subpage-nav a:focus-visible {
  color: #303335;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.subpage-nav a[aria-current="page"] {
  color: #303335;
  font-weight: 600;
  text-decoration: none;
}

.subpage-wordmark {
  color: #212425;
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
}

.subpage-topbar-spacer {
  display: block;
  justify-self: end;
  width: 9rem;
}

.top-anchor {
  display: block;
  height: 1px;
}

.home-hero {
  align-content: center;
  display: grid;
  justify-items: center;
  min-height: 64vh;
  padding: 2.1rem 0 1rem;
  text-align: center;
}

.hero-wordmark {
  --wordmark-size: clamp(4.2rem, 10.5vw, 10rem);
  display: flex;
  flex-wrap: nowrap;
  font-size: 0;
  font-weight: 500;
  justify-content: center;
  letter-spacing: 0.02em;
  line-height: 0.95;
  margin: 0;
  position: relative;
  white-space: nowrap;
}

.wordmark-piece {
  color: var(--piece, #3d4042);
  /* color: #000000; */
  display: inline-block;
  font-size: var(--wordmark-size);
  line-height: 0.95;
  text-transform: uppercase;
}

.subtitle {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  margin: 1rem 0 0.4rem;
  white-space: nowrap;
}

.subtitle-word {
  color: #383c40;
  font-size: clamp(1.95rem, 3.8vw, 3rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: underline;
  text-decoration-color: #d2d2d2;
  text-underline-offset: 8px;
}

.subtitle-word:nth-child(1) {
  color: var(--subtitle-design);
  text-decoration-color: var(--subtitle-design-underline);
}

.subtitle-word:nth-child(2) {
  color: var(--subtitle-representation);
  text-decoration-color: var(--subtitle-representation-underline);
}

.subtitle-word:nth-child(3) {
  color: var(--subtitle-communication);
  text-decoration-color: var(--subtitle-communication-underline);
}

.subtitle-word:hover,
.subtitle-word:focus-visible {
  text-decoration-color: currentColor;
}

.sections-grid {
  display: grid;
  gap: 2.2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0.25rem 0 1rem;
}

.section-card {
  align-content: start;
  display: grid;
  gap: 0.55rem;
}

.section-card h2 {
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 600;
  line-height: 1.04;
  margin: 0;
}

.section-card h2 a {
  text-decoration: underline;
  text-decoration-color: #d2d2d2;
  text-underline-offset: 8px;
}

.section-blurb {
  font-family: "Georgia", "Times New Roman", serif;
  /* font-size: clamp(1.05rem, 1.42vw, 1.55rem); */
  font-size: clamp(1.05rem, 1.42vw, 1.55rem);
  line-height: 1.3;
  margin: 0;
}

.section-image-link {
  border-radius: 0.35rem;
  display: block;
  overflow: hidden;
}

.section-image {
  display: block;
  width: 100%;
}

.section-links {
  display: grid;
  gap: 0.26rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.section-links a {
  color: #454c50;
  font-size: clamp(0.98rem, 1.04vw, 1.28rem);
  text-decoration: underline;
  text-decoration-color: #d0d0d0;
  text-underline-offset: 4px;
}

.section-links a:hover,
.section-links a:focus-visible {
  text-decoration-color: #939ba0;
}

.home-page.home-landscape-motion {
  --spread-progress: 1;
  --reveal-progress: 1;
  --wordmark-fade: 1;
  --offset-progress: 0;
  --align-progress: 1;
}

.home-page.home-landscape-motion .home-hero,
.home-page.home-landscape-motion .hero-wordmark,
.home-page.home-landscape-motion .wordmark-piece,
.home-page.home-landscape-motion .subtitle,
.home-page.home-landscape-motion .sections-grid,
.home-page.home-landscape-motion .section-card {
  transition: transform 180ms linear, opacity 180ms linear, gap 180ms linear, margin 180ms linear,
    min-height 180ms linear, max-width 180ms linear;
}

.home-page.home-landscape-motion .subtitle-word {
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  transition: none;
  z-index: 5;
}

.home-page.home-landscape-motion .home-hero {
  min-height: calc(var(--landscape-hero-min-start) - ((var(--landscape-hero-min-start) - var(--landscape-hero-min-end)) * var(--wordmark-fade)));
  padding-bottom: calc(var(--landscape-hero-bottom-pad-start) - ((var(--landscape-hero-bottom-pad-start) - var(--landscape-hero-bottom-pad-end)) * var(--reveal-progress)));
  padding-top: calc(var(--landscape-hero-top-pad-start) - ((var(--landscape-hero-top-pad-start) - var(--landscape-hero-top-pad-end)) * var(--reveal-progress)));
}

.home-page.home-landscape-motion .hero-wordmark {
  opacity: calc(1 - var(--wordmark-fade));
}

.home-page.home-landscape-motion .wordmark-piece {
  transform: translate(calc(var(--dx, 0) * 1px * var(--spread-progress)),
      calc(var(--dy, 0) * 1px * var(--spread-progress))) rotate(calc(var(--dr, 0) * 1deg * var(--spread-progress)));
}

.home-page.home-landscape-motion .sections-grid {
  opacity: var(--reveal-progress);
  position: relative;
  transform: translateY(calc((1 - var(--reveal-progress)) * 1.2rem));
  z-index: 2;
}

.home-page.home-landscape-motion .section-card {
  opacity: clamp(0,
      calc((var(--reveal-progress) * 1.25) - (var(--section-index, 0) * 0.1)),
      1);
}

.home-page.home-landscape-motion .section-card:nth-child(1) {
  margin-top: calc(var(--landscape-col-offset-1) * var(--offset-progress));
}

.home-page.home-landscape-motion .section-card:nth-child(2) {
  margin-top: calc(var(--landscape-col-offset-2) * var(--offset-progress));
}

.home-page.home-landscape-motion .section-card:nth-child(3) {
  margin-top: calc(var(--landscape-col-offset-3) * var(--offset-progress));
}

.home-contact {
  border-top: 1px solid var(--line);
  margin-top: var(--home-contact-top-space);
  padding: 2.4rem 0 var(--home-contact-bottom-space);
  text-align: center;
}

.home-contact h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.04;
  margin: 0 0 0.7rem;
}

.home-contact p {
  color: #4d5357;
  font-size: clamp(1.08rem, 1.4vw, 1.38rem);
  margin: 0 auto 1.2rem;
  max-width: var(--home-contact-text-width);
}

.contact-button {
  border: 1px solid #3c4347;
  border-radius: 999px;
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.55rem 1rem;
  text-decoration: none;
}

.contact-button:hover,
.contact-button:focus-visible {
  background: #2e3539;
  color: #f1f1f1;
}

.home-page.home-landscape-motion .section-heading-fallback {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.markdown-body {
  margin: 0 auto;
  max-width: 1080px;
}

.markdown-body h1 {
  color: #1e2326;
  font-size: clamp(3.1rem, 4.8vw, 4.5rem);
  line-height: 1.04;
  margin: 0 0 1.2rem;
}

.markdown-body p {
  font-size: clamp(1.3rem, 1.95vw, 2rem);
  line-height: 1.36;
  margin: 0 0 1rem;
}

.markdown-body h2 {
  font-size: clamp(2rem, 3vw, 2.9rem);
  margin: 2rem 0 1rem;
}

.markdown-body .md-anchor {
  font-size: clamp(2rem, 3vw, 2.9rem);
  line-height: 1.08;
  margin: 2rem 0 0.8rem;
  scroll-margin-top: 6rem;
}

.markdown-body .md-anchor a {
  text-decoration: underline;
  text-decoration-color: #d2d2d2;
  text-underline-offset: 8px;
}

.markdown-body .md-anchor a:hover,
.markdown-body .md-anchor a:focus-visible {
  text-decoration-color: #939ba0;
}

.markdown-body img {
  display: block;
  height: auto;
  margin: 0.7rem auto;
  max-width: 100%;
}

.markdown-body .md-image {
  margin: 0;
}

.markdown-body .md-image figcaption {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 0.35rem;
  text-align: center;
}

.carousel-host {
  margin: 1rem auto 0;
  max-width: 1080px;
}

.carousel {
  margin: 0;
}

.carousel-frame {
  background: #d8dcdb;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  overflow: hidden;
  position: relative;
}

.carousel-image {
  cursor: pointer;
  display: block;
  height: clamp(300px, 58vh, 680px);
  object-fit: cover;
  width: 100%;
}

.carousel-arrow {
  align-items: center;
  background: rgba(20, 23, 24, 0.63);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.35rem;
  height: 2.8rem;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 210ms ease, transform 210ms ease;
  width: 2.8rem;
}

.carousel-arrow--prev {
  left: 0.85rem;
}

.carousel-arrow--next {
  right: 0.85rem;
}

.carousel:hover .carousel-arrow,
.carousel:focus-within .carousel-arrow {
  opacity: 1;
  pointer-events: auto;
}

.carousel-arrow:hover,
.carousel-arrow:focus-visible {
  background: rgba(20, 23, 24, 0.84);
}

.carousel-caption {
  color: #555d60;
  font-size: 1.05rem;
  margin: 0.65rem 0 0;
  min-height: 1.4em;
  text-align: center;
}

.carousel-dots {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.35rem;
}

.carousel-dot {
  background: #c9c9c9;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  height: 0.55rem;
  width: 0.55rem;
}

.carousel-dot[aria-pressed="true"] {
  background: #4a5255;
}

@media (hover: none) {
  .carousel-arrow {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (orientation: landscape) and (min-width: 1000px) {
  .home-page.home-landscape-motion .subtitle {
    display: flex;
    gap: calc(0.4rem + (2.35rem * var(--spread-progress)));
    justify-content: center;
    margin-bottom: calc(0.08rem + (0.35rem * var(--reveal-progress)));
    margin-top: calc(var(--landscape-subtitle-wordmark-gap-base) + (var(--landscape-subtitle-wordmark-gap-spread) * var(--spread-progress)) - (var(--landscape-subtitle-wordmark-gap-reveal) * var(--reveal-progress)));
  }

  .home-page.home-landscape-motion .subtitle-word {
    --target-shift: 0px;
    --header-follow-offset-y: 0rem;
    font-size: clamp(1.55rem, calc(1.32rem + 1.15vw), 2.62rem);
    display: inline-block;
    text-align: left;
    transform: translateX(calc(var(--target-shift) * var(--align-progress))) translateY(calc((1 - var(--spread-progress)) * var(--landscape-subtitle-rise) + var(--header-follow-offset-y)));
  }

  .home-page.home-landscape-motion .subtitle-word:nth-child(1) {
    --header-follow-offset-y: calc(var(--landscape-col-offset-1) * var(--offset-progress));
  }

  .home-page.home-landscape-motion .subtitle-word:nth-child(2) {
    --header-follow-offset-y: calc(var(--landscape-col-offset-2) * var(--offset-progress));
  }

  .home-page.home-landscape-motion .subtitle-word:nth-child(3) {
    --header-follow-offset-y: calc(var(--landscape-col-offset-3) * var(--offset-progress));
  }

  .home-page.home-landscape-motion .sections-grid {
    gap: 0.9rem 1.85rem;
    margin-top: calc(var(--landscape-sections-lift-max) * (1 - var(--reveal-progress)));
    opacity: clamp(0, calc(var(--reveal-progress) * 1.35), 1);
  }

  .home-page.home-landscape-motion .section-card {
    gap: 0.48rem;
    opacity: clamp(0,
        calc((var(--reveal-progress) * 1.65) - (var(--section-index, 0) * 0.08)),
        1);
  }

  .home-page.home-landscape-motion .section-blurb {
    font-size: clamp(0.98rem, 1.34vw, 1.45rem);
    line-height: 1.23;
  }

  .home-page.home-landscape-motion .section-links {
    gap: 0.25rem;
  }

  .home-page.home-landscape-motion .section-links a {
    font-size: clamp(0.95rem, 1vw, 1.24rem);
  }

  .home-page.home-landscape-motion .site-main--home {
    padding-bottom: var(--home-scroll-runway-space);
  }
}

@media (orientation: portrait),
(max-width: 999px) {
  .home-hero {
    min-height: 38vh;
    padding-bottom: 0.6rem;
    padding-top: 1.2rem;
  }

  .hero-wordmark {
    --wordmark-size: clamp(3rem, 11vw, 5rem);
  }

  .subtitle {
    flex-wrap: wrap;
    gap: 0.38rem;
    margin-bottom: 0.2rem;
    margin-top: 0.35rem;
    white-space: normal;
  }

  .subtitle-word {
    font-size: clamp(1.72rem, 7.7vw, 2.72rem);
  }

  .sections-grid {
    gap: 1.35rem;
    grid-template-columns: 1fr;
    margin-top: 0;
  }

  .section-card {
    gap: 0.55rem;
  }

  .section-heading-fallback {
    clip: auto;
    clip-path: none;
    height: auto;
    margin: 0;
    overflow: visible;
    padding: 0;
    position: static;
    white-space: normal;
    width: auto;
  }

  .subpage-topbar-inner {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    justify-items: center;
  }

  .subpage-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .subpage-topbar-spacer {
    display: none;
  }

  .home-contact {
    margin-top: 1.6rem;
    padding-top: 1.7rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
