/* ============================================================
   Cartesian Property Group - main.css
   Brand: Formal Green #0f3228 · Ecru White #F3F2EF · Celeste #DDDCD3
          Melville #B2BFB4 · Casual Black #181818 · Instrument Sans
   Direction: confident, friendly, trustworthy. Calm spacing, soft
   type, fade-rise entrances, 0.3s hovers. No counters, no gimmicks.
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/InstrumentSans-Variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/InstrumentSans-Italic-Variable.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --green: #0f3228;
  --green-soft: #1a4638;
  --ink: #181818;
  --sage: #b2bfb4;
  --stone: #dddcd3;
  --ecru: #f3f2ef;
  --white: #fdfdfc;

  --text: #23312c;
  --text-soft: #5c6b64;
  --text-on-dark: #eef0ec;
  --text-soft-on-dark: rgba(240, 242, 238, 0.88);

  --radius: 14px;
  --radius-sm: 8px;

  --font: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1240px;

  --section-y: clamp(4.5rem, 9vw, 8rem);
}

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

html {
  scroll-behavior: smooth;
}
html.lenis {
  height: auto;
  scroll-behavior: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto;
}

body {
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--ecru);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

ul {
  list-style: none;
}

::selection {
  background: var(--green);
  color: var(--ecru);
}

/* ---------- Type scale ---------- */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.display {
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  font-weight: 600;
}

h2, .h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
}

h3, .h3 {
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  line-height: 1.3;
}

.lead {
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 34em;
}

p {
  max-width: 62ch;
}

.muted {
  color: var(--text-soft);
}

/* ---------- Layout ---------- */
.container {
  width: min(var(--container), 100% - 3rem);
  margin-inline: auto;
}

section {
  padding-block: var(--section-y);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.section-head p {
  margin-top: 1.1rem;
  color: var(--text-soft);
}

/* dark section variant */
.dark {
  background: var(--green);
  color: var(--text-on-dark);
}
.dark h1, .dark h2, .dark h3, .dark h4 {
  color: #f6f7f4;
}
.dark p, .dark .lead {
  color: var(--text-soft-on-dark);
}

/* stone / wash variant */
.wash {
  background: var(--stone);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.site-header.is-solid {
  background: rgba(243, 242, 239, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(15, 50, 40, 0.08);
}
.site-header.on-dark:not(.is-solid) {
  color: var(--text-on-dark);
}

.logo img {
  height: 42px;
  width: auto;
}
.logo .logo-dark { display: block; }
.logo .logo-light { display: none; }
.on-dark:not(.is-solid) .logo .logo-dark { display: none; }
.on-dark:not(.is-solid) .logo .logo-light { display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a {
  position: relative;
  padding-block: 0.3rem;
  transition: opacity 0.3s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1.5px;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s var(--ease);
}
.nav a:hover::after,
.nav a[aria-current="page"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-cta {
  margin-left: 0.5rem;
}

/* mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 44px;
  height: 44px;
  position: relative;
  color: inherit;
}
.nav-toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: currentColor;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 16px; }
.nav-toggle span:nth-child(2) { top: 22px; }
.nav-toggle span:nth-child(3) { top: 28px; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: 0;
    background: var(--green);
    color: var(--text-on-dark);
    flex-direction: column;
    justify-content: center;
    gap: 1.6rem;
    font-size: 1.4rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s var(--ease);
  }
  body.nav-open .nav {
    opacity: 1;
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; }
  .nav .nav-cta {
    background: var(--ecru);
    color: var(--green);
    font-size: 1.15rem;
    padding: 1rem 2.2rem;
  }
  body.nav-open .nav-toggle { color: var(--text-on-dark); z-index: 60; position: relative; }
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.9rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.98rem;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
    border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn-primary {
  background: var(--green);
  color: #f6f7f4;
}
.btn-primary:hover {
  background: var(--green-soft);
}
.dark .btn-primary {
  background: var(--ecru);
  color: var(--green);
}
.dark .btn-primary:hover {
  background: #ffffff;
}
.btn-ghost {
  border-color: rgba(15, 50, 40, 0.35);
  color: var(--ink);
}
.btn-ghost:hover {
  border-color: var(--green);
  background: rgba(15, 50, 40, 0.05);
}
.dark .btn-ghost {
  border-color: rgba(246, 247, 244, 0.4);
  color: #f6f7f4;
}
.dark .btn-ghost:hover {
  border-color: #f6f7f4;
  background: rgba(246, 247, 244, 0.08);
}

.text-link {
  font-weight: 500;
  border-bottom: 1.5px solid var(--sage);
  padding-bottom: 2px;
  transition: border-color 0.3s var(--ease);
}
.text-link:hover {
  border-color: var(--green);
}

/* Hero sits on a dark photo: ghost button must read light, not ink */
.hero .btn-ghost {
  border-color: rgba(248, 249, 246, 0.85);
  color: #f8f9f6;
  background: rgba(15, 50, 40, 0.25);
}
.hero .btn-ghost:hover {
  border-color: #ffffff;
  background: rgba(248, 249, 246, 0.16);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  color: var(--text-on-dark);
  overflow: hidden;
  padding-block: 0;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}
.hero-media img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  will-change: transform;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(15, 50, 40, 0.88) 0%,
    rgba(15, 50, 40, 0.45) 45%,
    rgba(24, 24, 24, 0.25) 100%
  );
}
.hero-inner {
  padding-block: clamp(5rem, 10vh, 7.5rem);
}
.hero h1 {
  color: #f8f9f6;
  max-width: 21ch;
}
.hero .lead {
  color: rgba(246, 247, 244, 0.85);
  margin-top: 1.4rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}

/* interior page hero (short) */
.page-hero {
  background: var(--green);
  color: var(--text-on-dark);
  padding-top: clamp(9rem, 16vh, 12rem);
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
  position: relative;
  overflow: hidden;
}
.page-hero h1 {
  color: #f6f7f4;
  font-size: clamp(2.4rem, 4.6vw, 3.8rem);
  max-width: 16ch;
}
.page-hero .lead {
  margin-top: 1.2rem;
}
.page-hero .pattern {
  position: absolute;
  right: -6%;
  top: -20%;
  width: clamp(300px, 38vw, 560px);
  opacity: 0.35;
  mix-blend-mode: lighten;
  pointer-events: none;
}

/* ---------- Cards & grids ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -18px rgba(15, 50, 40, 0.25);
}
.card h3 {
  margin-bottom: 0.7rem;
}
.card p {
  color: var(--text-soft);
  font-size: 0.99rem;
}

/* numbered service rows */
.num-list {
  border-top: 1px solid rgba(15, 50, 40, 0.14);
}
.num-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 2fr;
  gap: 2rem;
  align-items: baseline;
  padding: 1.9rem 0;
  border-bottom: 1px solid rgba(15, 50, 40, 0.14);
  transition: background 0.3s var(--ease), padding-left 0.3s var(--ease);
}
.num-row:hover {
  background: rgba(255, 255, 255, 0.55);
  padding-left: 0.75rem;
}
.num-row .num {
  font-weight: 500;
  color: var(--sage);
  font-size: 1rem;
}
.num-row h3 {
  font-size: 1.3rem;
}
.num-row p {
  color: var(--text-soft);
  font-size: 0.99rem;
}
@media (max-width: 800px) {
  .num-row {
    grid-template-columns: 3rem 1fr;
    gap: 0.9rem;
  }
  .num-row p {
    grid-column: 2;
  }
}

/* split feature */
.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.split.flip > .split-media { order: 2; }
@media (max-width: 900px) {
  .split, .split.flip { grid-template-columns: 1fr; }
  .split.flip > .split-media { order: 0; }
}
.split-media {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.split-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3.4;
  transition: transform 0.6s var(--ease);
}
.split-media:hover img {
  transform: scale(1.03);
}
.split-copy h2 {
  margin-bottom: 1.1rem;
}
.split-copy p + p {
  margin-top: 0.9rem;
}
.split-copy .btn, .split-copy .text-link {
  margin-top: 1.7rem;
  display: inline-flex;
}
.split-copy p {
  color: var(--text-soft);
}
.dark .split-copy p {
  color: var(--text-soft-on-dark);
}

/* ---------- Team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
@media (max-width: 1000px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .team-grid { grid-template-columns: 1fr; }
}
.team-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.team-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -18px rgba(15, 50, 40, 0.25);
}
.team-photo {
  background: var(--stone);
  aspect-ratio: 1 / 0.92;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.team-photo img {
  width: 82%;
  height: auto;
  max-height: 96%;
  object-fit: contain;
  object-position: bottom;
  filter: grayscale(1);
}
.team-meta {
  padding: 1.4rem 1.6rem 1.6rem;
}
.team-meta h3 {
  font-size: 1.15rem;
}
.team-meta .role {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin-top: 0.15rem;
}
.team-meta .bio {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--text-soft);
}

/* ---------- Quote ---------- */
.quote {
  text-align: left;
}
.quote blockquote {
  font-size: clamp(1.4rem, 2.6vw, 2.1rem);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 24em;
}
.dark .quote blockquote {
  color: #f6f7f4;
}
.quote figcaption {
  margin-top: 1.6rem;
  font-size: 0.98rem;
  color: var(--text-soft);
}
.dark .quote figcaption {
  color: var(--text-soft-on-dark);
}
.quote figcaption strong {
  display: block;
  color: inherit;
  font-weight: 600;
}

/* ---------- FAQ ---------- */
.faq {
  border-top: 1px solid rgba(15, 50, 40, 0.14);
  max-width: 820px;
}
.faq details {
  border-bottom: 1px solid rgba(15, 50, 40, 0.14);
}
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.4rem 0;
  font-weight: 500;
  font-size: 1.08rem;
  color: var(--ink);
  transition: color 0.3s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--sage);
  transition: transform 0.3s var(--ease);
  flex: none;
}
.faq details[open] summary::after {
  transform: rotate(45deg);
}
.faq details p {
  padding-bottom: 1.4rem;
  color: var(--text-soft);
  max-width: 58ch;
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
}
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.field.full {
  grid-column: 1 / -1;
}
.field label {
  font-weight: 500;
  font-size: 0.94rem;
  color: var(--ink);
}
.field input,
.field textarea,
.field select {
  font: inherit;
  color: var(--ink);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(15, 50, 40, 0.22);
  background: var(--white);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder {
  color: #8a958f;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 50, 40, 0.12);
}
.form-note {
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
}
.cta-band .pattern {
  position: absolute;
  right: -4%;
  bottom: -30%;
  width: clamp(320px, 40vw, 620px);
  opacity: 0.3;
  mix-blend-mode: lighten;
  pointer-events: none;
}
.cta-band .container {
  position: relative;
  display: grid;
  gap: 1.8rem;
  max-width: 900px;
  text-align: center;
  justify-items: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(238, 240, 236, 0.75);
  padding-block: 3.5rem 2.5rem;
  font-size: 0.95rem;
}
.site-footer .top {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(238, 240, 236, 0.14);
}
.site-footer .logo img { height: 26px; }
.site-footer nav {
  display: flex;
  gap: 1.8rem;
  flex-wrap: wrap;
}
.site-footer a {
  transition: color 0.3s var(--ease);
}
.site-footer a:hover {
  color: #ffffff;
}
.site-footer .bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  padding-top: 1.8rem;
  font-size: 0.88rem;
  color: rgba(238, 240, 236, 0.5);
}
.site-footer address {
  font-style: normal;
  line-height: 1.8;
}

/* ---------- Checklist (dark approach section) ---------- */
.checks li {
  position: relative;
  padding-left: 1.7rem;
}
.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 0.85em;
  height: 0.45em;
  border-left: 2px solid var(--sage);
  border-bottom: 2px solid var(--sage);
  transform: rotate(-45deg);
}

/* ---------- Partner logo marquee ---------- */
.logo-marquee {
  overflow: hidden;
  padding-block: 1rem;
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
.logo-track {
  display: flex;
  align-items: center;
  gap: clamp(3rem, 6vw, 5.5rem);
  width: max-content;
  padding-right: clamp(3rem, 6vw, 5.5rem);
}
.logo-track img {
  height: auto;
  width: auto;
  max-height: 72px;
  max-width: 190px;
}
@media (prefers-reduced-motion: no-preference) {
  .logo-marquee .logo-track {
    animation: marquee 45s linear infinite;
  }
  @keyframes marquee {
    to {
      transform: translateX(-50%);
    }
  }
}
@media (max-width: 700px) {
  .logo-track img { max-height: 54px; max-width: 140px; }
}

/* ---------- Reveal animation ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(48px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
    transition-delay: var(--d, 0ms);
  }
  .reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Utilities ---------- */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.center { text-align: center; }
