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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  overflow-x: clip;
}

body {
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--navy-light);
}

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

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-alt);
  box-shadow: 0 1px 0 rgba(26, 45, 74, 0.06), 0 6px 16px -12px rgba(26, 45, 74, 0.12);
}

.site-header__inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--navy);
  text-decoration: none;
  line-height: 1.2;
}

.site-logo:hover {
  color: var(--navy-light);
}

.site-logo:hover .site-logo__role {
  color: var(--navy-light);
}

.site-logo__name {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--hero-diagram-fill, #5c2430);
}

.site-logo:hover .site-logo__name {
  color: var(--hero-diagram-fill, #5c2430);
  opacity: 0.86;
}

.site-logo__rule {
  display: block;
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

.site-logo__role {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy);
  white-space: nowrap;
  line-height: 1.2;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.site-nav__link {
  font-size: 18px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: var(--navy);
  background: var(--bg);
}

.site-nav__cta {
  display: inline-block;
  margin-left: 6px;
  padding: 8px 20px;
  border: 2px solid var(--navy);
  border-radius: 5px;
  background: transparent;
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav__cta:hover,
.site-nav__cta:focus-visible {
  background: var(--navy);
  color: var(--bg);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  color: var(--navy);
  font-family: inherit;
}

.nav-toggle__icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
  height: 18px;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Main layout ── */

main {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

main > section:not(.hero) {
  max-width: none;
}

section[id] {
  scroll-margin-top: calc(var(--header-height) + 12px);
}

section + section {
  margin-top: 28px;
  padding-top: 0;
  border-top: none;
}

/* ── Typography ── */

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
  margin-bottom: 20px;
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 16px;
  max-width: 56ch;
}

p {
  color: var(--text-muted);
  max-width: 62ch;
}

p + p {
  margin-top: 14px;
}

/* ── Home hero ── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 1fr);
  grid-template-areas: "copy visual";
  column-gap: 32px;
  row-gap: 0;
  align-items: center;
  padding: 32px 0 32px;
}

.hero--solo {
  grid-template-columns: minmax(0, 1fr);
}

.hero__copy {
  grid-area: copy;
  min-width: 0;
  padding-right: 8px;
  align-self: center;
}

.hero__place {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.hero__place-sep {
  color: var(--hero-diagram-fill, #5c2430);
}

.hero h1 {
  position: relative;
  font-size: clamp(1.85rem, 3.8vw, 2.5rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: none;
  padding-bottom: 16px;
  margin-bottom: 14px;
}

.hero h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50%;
  height: 2px;
  background: var(--border);
}

.hero .lead {
  margin-top: 0;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  line-height: 1.55;
  max-width: none;
}

.hero__actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 0;
}

.hero__cta,
.hero__secondary {
  display: inline-block;
  padding: 12px 20px;
  border: 2px solid var(--navy);
  border-radius: 5px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
}

.hero__cta {
  background: var(--navy);
  color: var(--bg);
}

.hero__cta:hover,
.hero__cta:focus-visible {
  background: var(--navy-light);
  border-color: var(--navy-light);
  color: var(--bg);
}

.hero__secondary {
  background: transparent;
  color: var(--navy);
}

.hero__secondary:hover,
.hero__secondary:focus-visible {
  background: var(--navy);
  color: var(--bg);
  text-decoration: none;
}

.hero__portrait {
  position: relative;
  margin: 0 -8px 0 0;
  overflow: hidden;
  width: 100%;
  height: auto;
  aspect-ratio: 825 / 1024;
  max-height: 520px;
  justify-self: end;
}

.hero__portrait img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center center;
}

.hero__visual {
  grid-area: visual;
  margin: 0;
  width: 100%;
  max-width: min(100%, 640px);
  justify-self: end;
  align-self: center;
  overflow: visible;
}

.hero__visual img {
  display: block;
  width: 100%;
  height: auto;
  transform: none;
}

/* Hero group-structure diagram (replaces hero-scenarios.png) */

.hero-diagram {
  --hero-diagram-pair-gap: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(20px, 4.5vw, 44px);
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}

.hero-diagram__chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  max-width: 268px;
}

.hero-diagram__node {
  margin: 0;
  margin-inline: auto;
  align-self: center;
  width: fit-content;
  max-width: 100%;
  padding-block: 10px;
  padding-inline: 50px;
  background: var(--hero-diagram-fill, var(--navy));
  color: var(--white);
  border-radius: 999px;
  font-size: clamp(12px, 1.4vw, 15px);
  font-weight: 600;
  line-height: 1.28;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-diagram__node-line {
  display: block;
  width: 100%;
  text-align: center;
}

.hero-diagram__node-line--sub {
  font-weight: 600;
  opacity: 0.95;
}

.hero-diagram__node--inline {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
}

.hero-diagram__node--inline .hero-diagram__node-line {
  display: inline;
  width: auto;
}

.hero-diagram__line {
  display: block;
  flex-shrink: 0;
  background: var(--hero-diagram-line, var(--navy));
}

.hero-diagram__line--v {
  width: 2px;
  height: 28px;
}

.hero-diagram__chart--stack .hero-diagram__line--v {
  height: 34px;
}

.hero-diagram__chart--fork .hero-diagram__line--stem {
  height: 22px;
  margin-inline: auto;
  margin-bottom: -1px;
}

.hero-diagram__pair {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--hero-diagram-pair-gap);
  width: 100%;
  padding-top: 2px;
  box-sizing: border-box;
}

.hero-diagram__pair-rail {
  position: absolute;
  top: 0;
  left: calc((100% - var(--hero-diagram-pair-gap)) / 4);
  right: calc((100% - var(--hero-diagram-pair-gap)) / 4);
  height: 2px;
  background: var(--hero-diagram-line, var(--navy));
}

.hero-diagram__pair-col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  text-align: center;
}

.hero-diagram__line--leg {
  height: 22px;
  margin: 0;
}

.hero-diagram__chart--fork .hero-diagram__node--single {
  font-size: clamp(11px, 1.25vw, 14px);
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero h1,
.hero .lead,
.hero__actions,
.hero__portrait,
.hero__visual,
.hero-diagram {
  animation: hero-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero h1 { animation-delay: 0.08s; }
.hero .lead { animation-delay: 0.18s; }
.hero__actions { animation-delay: 0.28s; }
.hero__portrait,
.hero__visual { animation-delay: 0.14s; }

@media (prefers-reduced-motion: reduce) {
  .hero h1,
  .hero .lead,
  .hero__actions,
  .hero__portrait,
  .hero__visual,
  .hero-diagram {
    animation: none;
  }
}

/* ── Lower-page panels ── */

.panel {
  background: var(--bg-alt);
  border-left: 4px solid var(--navy);
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  padding-block: 36px 40px;
  padding-inline: calc((100vw - min(var(--page-width), 100vw)) / 2 + var(--page-gutter));
  box-sizing: border-box;
}

#services.panel,
.panel.about,
#contact.panel {
  border-left: none;
}

.panel.about {
  background: var(--bg);
}

.panel .eyebrow {
  font-size: 13px;
}

.panel h2 {
  font-size: clamp(1.55rem, 3.2vw, 1.9rem);
  margin-bottom: 14px;
}

.panel > p {
  max-width: none;
  font-size: 18px;
}

/* ── Services list ── */

.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, auto);
  gap: 16px;
  margin-top: 28px;
}

.service-item {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  align-content: start;
  padding: 28px 28px 32px;
  background: var(--bg);
  border-left: 4px solid var(--navy);
}

.service-item h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.service-item > p {
  font-size: 17px;
  max-width: none;
  margin-bottom: 14px;
}

@supports not (grid-template-rows: subgrid) {
  .service-item {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .service-item > p {
    flex-grow: 1;
    min-height: 6.25em;
  }
}

.service-item__list {
  margin-top: 0;
  padding-left: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 17px;
}

.service-item__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.service-item__list li + li {
  margin-top: 10px;
}

.service-item__icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 2px solid var(--navy);
}

.service-item__list span {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

/* ── About ── */

.about__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 32px 40px;
  align-items: center;
}

.about__copy {
  min-width: 0;
}

.about__copy p {
  max-width: none;
}

.about__portrait {
  margin: 0;
  width: 100%;
  max-width: 320px;
  justify-self: end;
}

.about__portrait img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center top;
}

.about__credentials {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 14px;
  background: var(--bg);
  border-left: 4px solid var(--navy);
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  max-width: none;
}

/* ── Contact ── */

.contact-links {
  list-style: none;
  margin-top: 24px;
  display: grid;
  gap: 10px;
}

.contact-links li + li {
  margin-top: 0;
}

.contact-links a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg);
  border-left: 4px solid var(--navy);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  color: var(--navy);
}

.contact-links__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--navy);
}

.contact-links__icon--brand {
  width: 20px;
  height: 20px;
}

.contact-links a:hover {
  background: var(--white);
}

.contact-note {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-soft);
  max-width: none;
}

/* ── Footer ── */

.site-footer {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  min-height: var(--header-height);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-soft);
}

.site-footer a {
  color: var(--text-soft);
}

.site-footer a:hover {
  color: var(--navy);
}

/* ── Sub-page (privacy) ── */

.page-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  padding: 8px 0;
}

.back-link:hover {
  color: var(--navy-light);
}

.back-link__arrow {
  font-size: 18px;
  line-height: 1;
}

.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.page-content h2 {
  font-size: 1.25rem;
  margin-top: 32px;
  margin-bottom: 12px;
}

.page-content h2:first-of-type {
  margin-top: 0;
}

.page-content p,
.page-content li {
  font-size: 17px;
  color: var(--text-muted);
}

.page-content__meta {
  font-size: 15px;
  color: var(--text-soft);
  margin-bottom: 20px;
}

.page-content strong {
  color: var(--text);
  font-weight: 600;
}

.page-content ul {
  margin: 12px 0;
  padding-left: 20px;
}

.page-content li + li {
  margin-top: 6px;
}

/* ── Tablet: stack the wordmark so it doesn't collide with nav ── */

@media (max-width: 960px) {
  .site-logo {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .site-logo__rule {
    display: none;
  }

  .site-logo__name {
    font-size: 22px;
  }

  .site-logo__role {
    font-size: 12px;
    letter-spacing: 0.1em;
  }
}

/* ── Tablet: stacked sections and menu nav ── */

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
  }

  .site-header__inner {
    position: relative;
    align-items: center;
    height: auto;
    min-height: var(--header-height);
    padding-block: 12px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    margin-left: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px 16px;
    box-shadow: 0 12px 24px rgba(26, 45, 74, 0.08);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav__link {
    padding: 14px 12px;
    font-size: 17px;
  }

  .site-nav__cta {
    margin: 8px 12px 4px;
    padding: 12px 20px;
    text-align: center;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "visual";
    padding: 24px 0 20px;
    row-gap: 20px;
  }

  .hero__visual {
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
  }

  .service-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 14px;
  }

  .service-item {
    display: block;
    grid-row: auto;
  }

  .about__layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .about__portrait {
    max-width: min(320px, 80%);
    margin: 0 auto;
    justify-self: center;
  }

  .panel h2 {
    font-size: clamp(1.4rem, 4.5vw, 1.75rem);
  }
}

/* ── Phone ── */

@media (max-width: 640px) {
  :root,
  [data-theme] {
    --page-gutter: 20px;
  }

  body {
    font-size: 17px;
    line-height: 1.6;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  main {
    padding: 0 var(--page-gutter);
  }

  .hero {
    padding: 20px 0 12px;
    row-gap: 18px;
  }

  .hero h1 {
    font-size: clamp(1.35rem, 6.5vw, 1.55rem);
    line-height: 1.22;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .hero .lead {
    font-size: 1rem;
    line-height: 1.5;
  }

  .hero-diagram {
    --hero-diagram-pair-gap: 10px;
    gap: 12px;
    max-width: 100%;
  }

  .hero-diagram__node {
    padding-inline: clamp(18px, 6vw, 36px);
    font-size: clamp(10px, 2.85vw, 13px);
  }

  .hero-diagram__chart--fork .hero-diagram__node--single {
    font-size: clamp(10px, 2.6vw, 12px);
  }

  section + section {
    margin-top: 0;
  }

  .panel {
    padding-block: 24px 28px;
  }

  .panel > p {
    font-size: 17px;
  }

  .service-item {
    padding: 20px 18px 22px;
  }

  .service-item > p {
    flex-grow: 0;
    margin-bottom: 14px;
    font-size: 16px;
  }

  .service-item__list {
    font-size: 16px;
  }

  .service-item__icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
  }

  .contact-links a {
    font-size: 17px;
    padding: 14px 16px;
  }

  .contact-links a span {
    overflow-wrap: anywhere;
  }
}

/* ── Small phone ── */

@media (max-width: 400px) {
  :root,
  [data-theme] {
    --page-gutter: 16px;
  }

  .hero-diagram__node {
    padding-inline: 14px;
  }

  .site-logo__name {
    font-size: 19px;
  }

  .service-item__list li {
    gap: 8px;
  }
}
