/* ==========================================================
   Endevra Net Lease — brand tokens (from Brand Guidelines)
   ========================================================== */
:root {
  /* Primary palette */
  --nightfall: #082221;
  --basalt: #17423f;
  --bone: #fef8f1;
  --agave: #4f8a7e;
  /* Secondary palette */
  --juniper: #2b6459;
  --turquoise: #6bbaad;
  --clay: #b0674a;
  --sandstone: #efe6d8;
  --limestone: #d6cdbe;
  --dune: #c9b99e;
  --sage: #a9bab6;
  --ironwood: #5a6663;

  /* Semantic roles */
  --bg: var(--bone);
  --text: var(--nightfall);
  --text-muted: #3f4b48;           /* 8.9:1 on bone */
  --text-on-dark: var(--bone);
  --text-on-dark-muted: #c3d0cd;   /* 10:1 on nightfall */
  --accent-on-light: var(--juniper);
  --accent-on-dark: var(--turquoise);
  --line-light: var(--limestone);
  --line-dark: rgba(254, 248, 241, 0.18);
  --error-on-dark: #f2b39b;

  /* Type */
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Spacing (8pt) */
  --s-1: 8px; --s-2: 16px; --s-3: 24px; --s-4: 32px; --s-6: 48px; --s-8: 64px; --s-12: 96px; --s-16: 128px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 160ms;
  --dur: 280ms;
  --dur-slow: 700ms;

  --header-h: 80px;
  --z-header: 40;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 300; line-height: 1.12; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--agave); outline-offset: 3px; border-radius: 2px; }
.contact :focus-visible, .hero :focus-visible, .site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--turquoise); }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(80px, 11vw, 144px); }

.skip-link {
  position: absolute; left: var(--s-2); top: -100px; z-index: 100;
  background: var(--bone); color: var(--nightfall); padding: 12px 18px; text-decoration: none; font-weight: 500;
}
.skip-link:focus { top: var(--s-2); }

/* Eyebrow: Jost Medium, caps, +200 tracking */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  margin: 0 0 var(--s-3);
  font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent-on-light);
}
.eyebrow-light { color: var(--accent-on-dark); }
.arrow-mark { width: 14px; height: 12px; color: var(--agave); flex: none; }
.eyebrow-light .arrow-mark { color: var(--turquoise); }

.section-title { font-size: clamp(2rem, 4.2vw, 3.375rem); margin-bottom: var(--s-4); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 28px;
  font-family: var(--font-sans); font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  text-decoration: none; border: 1px solid transparent; border-radius: 0; cursor: pointer;
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
  touch-action: manipulation;
}
.btn-sm { min-height: 44px; padding: 10px 20px; font-size: 0.75rem; }
.btn-light { background: var(--bone); color: var(--nightfall); }
.btn-light:hover { background: var(--turquoise); }
.btn-ghost { color: var(--bone); border-color: rgba(254, 248, 241, 0.55); }
.btn-ghost:hover { background: rgba(254, 248, 241, 0.1); border-color: var(--bone); }
.btn-outline { color: var(--bone); background: transparent; border-color: rgba(254, 248, 241, 0.45); }
.btn-outline:hover { background: var(--bone); color: var(--nightfall); }
.btn:active { transform: translateY(1px); }

.text-link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-on-light); text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.text-link span { transition: transform var(--dur) var(--ease-out); }
.text-link:hover span { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: var(--z-header);
  color: var(--bone);
  transition: background-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.site-header.is-scrolled { background: rgba(8, 34, 33, 0.94); box-shadow: 0 1px 0 var(--line-dark); backdrop-filter: blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: var(--s-3); }
.brand { display: inline-flex; color: var(--bone); padding-block: 8px; }
.logo { width: 150px; height: auto; }
.nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); }
.nav a:not(.btn) {
  font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none;
  padding-block: 12px; position: relative;
}
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease-out);
}
.nav a:not(.btn):hover::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
/* Shorter than the viewport so the next section peeks above the fold.
   Headline sits in the sky; lede + actions sit along the bottom. */
.hero {
  position: relative; isolation: isolate;
  min-height: min(74vh, 800px); min-height: min(74svh, 800px);
  display: flex; align-items: stretch;
  color: var(--bone); background: var(--nightfall); overflow: hidden;
}
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 12%; z-index: -2; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    /* Eased stops (no hard "knee") so the smooth sky shows no visible band */
    linear-gradient(180deg,
      rgba(8, 34, 33, 0.74) 0%, rgba(8, 34, 33, 0.64) 10%, rgba(8, 34, 33, 0.54) 20%,
      rgba(8, 34, 33, 0.45) 30%, rgba(8, 34, 33, 0.38) 40%, rgba(8, 34, 33, 0.33) 50%,
      rgba(8, 34, 33, 0.34) 58%, rgba(8, 34, 33, 0.42) 66%, rgba(8, 34, 33, 0.56) 75%,
      rgba(8, 34, 33, 0.72) 84%, rgba(8, 34, 33, 0.86) 93%, rgba(8, 34, 33, 0.9) 100%),
    linear-gradient(90deg,
      rgba(8, 34, 33, 0.45) 0%, rgba(8, 34, 33, 0.3) 20%, rgba(8, 34, 33, 0.15) 40%,
      rgba(8, 34, 33, 0.05) 55%, rgba(8, 34, 33, 0) 65%);
}
.hero-content {
  display: flex; flex-direction: column;
  padding-top: calc(var(--header-h) + clamp(24px, 5vh, 64px));
  padding-bottom: clamp(32px, 5vh, 64px);
}
.hero-title {
  font-size: clamp(2.5rem, 5.2vw, 5.25rem); line-height: 1.06; letter-spacing: -0.015em;
  max-width: 16ch; margin-bottom: var(--s-3);
}
.hero-foot {
  margin-top: auto;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4);
}
.hero-lede { max-width: 54ch; margin: 0; font-size: 1.1875rem; font-weight: 400; color: var(--bone); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
@media (min-width: 960px) {
  /* Two-line headline on desktop so it fits in the sky above the mountain */
  .hero-title { max-width: none; }
}

/* ---------- About ---------- */
.about { background: var(--bone); padding-top: clamp(56px, 6.5vw, 96px); }
.about-grid { display: grid; gap: var(--s-8); align-items: center; }
.about-copy p { max-width: 60ch; color: var(--text-muted); font-size: 1.1875rem; font-weight: 400; }
.about-copy .text-link { margin-top: var(--s-2); }
.about-media { margin: 0; position: relative; }
.about-media img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 60%; }
.about-media::before {
  content: ""; position: absolute; inset: 24px max(-24px, calc(var(--gutter) * -0.75)) -24px 24px; z-index: -1;
  border: 1px solid var(--dune);
}
.about-media { isolation: isolate; }

.about-media--collage::before { content: none; }
.about-collage {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px;
  aspect-ratio: 4 / 3;
}
.about-collage img { width: 100%; height: 100%; min-height: 0; aspect-ratio: auto; object-fit: cover; }
.about-collage .c-tall { grid-row: 1 / 3; object-position: 30% 50%; }
.about-collage .c-top { object-position: 35% 55%; }
.about-collage .c-bottom { object-position: 45% 60%; }
.about-collage::before {
  content: ""; position: absolute; inset: 24px max(-24px, calc(var(--gutter) * -0.75)) -24px 24px; z-index: -1;
  border: 1px solid var(--dune);
}
.about-caption {
  margin-top: calc(24px + var(--s-2));
  font-size: 0.875rem; line-height: 1.5; color: var(--ironwood);
}

.pullquote {
  margin: clamp(80px, 10vw, 128px) auto 0;
  padding-top: var(--s-8);
  position: relative;
}
.pullquote::before, .footer-top::after {
  content: ""; position: absolute; left: var(--gutter); right: var(--gutter); height: 1px;
}
.pullquote::before { top: 0; background: var(--line-light); }
.footer-top::after { bottom: 0; background: var(--line-dark); }
.pullquote p {
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(1.625rem, 3vw, 2.5rem); line-height: 1.25; color: var(--juniper);
  max-width: 36ch; margin: 0;
}

/* ---------- Core components ---------- */
.strategy { background: var(--sandstone); }
.strategy-head { text-align: center; max-width: 760px; margin: 0 auto clamp(48px, 7vw, 88px); }
.strategy-head .section-title { color: var(--clay); margin-bottom: 0; }
.section-sub {
  margin: var(--s-2) 0 0;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem); font-weight: 400; line-height: 1.4; color: var(--juniper);
} /* large display text: 3.3:1 on sandstone */
.pillars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-6); }
.pillar { text-align: center; max-width: 360px; margin-inline: auto; }
.pillar-icon {
  width: 72px; height: 72px; margin: 0 auto var(--s-3);
  fill: none; stroke: var(--basalt); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.pillar h3 {
  font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  line-height: 1.4; color: var(--juniper); margin-bottom: 12px;
}
.pillar p { margin: 0; font-size: 1.1875rem; font-weight: 400; color: var(--text-muted); }

/* ---------- Contact ---------- */
.contact { background: var(--nightfall); color: var(--text-on-dark); }
.contact-grid { display: grid; gap: var(--s-8); }
.contact-intro p { color: var(--text-on-dark-muted); font-size: 1.1875rem; font-weight: 400; max-width: 42ch; }
.contact-details { margin: var(--s-6) 0 0; display: grid; gap: var(--s-3); }
.contact-details dt { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--turquoise); }
.contact-details dd { margin: 4px 0 0; font-size: 1.125rem; }
.contact-details a { text-decoration: none; border-bottom: 1px solid var(--line-dark); }

.form { display: grid; gap: var(--s-3); }
.form-row { display: grid; gap: var(--s-3); }
.field { display: grid; gap: 8px; }
.field label { font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone); }
.req { color: var(--turquoise); }
.optional { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-on-dark-muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 14px 16px;
  font: inherit; font-size: 1rem; color: var(--bone);
  background: rgba(254, 248, 241, 0.04);
  border: 1px solid rgba(254, 248, 241, 0.32); border-radius: 0;
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
  -webkit-appearance: none; appearance: none;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(254, 248, 241, 0.55); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--turquoise); background: rgba(254, 248, 241, 0.07);
  box-shadow: 0 0 0 1px var(--turquoise);
}
.field select option { color: var(--nightfall); background: var(--bone); }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; pointer-events: none;
  border-right: 1.5px solid var(--bone); border-bottom: 1.5px solid var(--bone);
  transform: translateY(-70%) rotate(45deg);
}
.field [aria-invalid="true"] { border-color: var(--error-on-dark); box-shadow: 0 0 0 1px var(--error-on-dark); }
.field-error { margin: 0; min-height: 0; font-size: 0.9375rem; color: var(--error-on-dark); }
.field-error:empty { display: none; }
.field-error::before { content: "! "; font-weight: 500; }

.form-summary {
  padding: var(--s-2) var(--s-3); border: 1px solid var(--error-on-dark); color: var(--bone);
}
.form-summary p { margin: 0 0 8px; font-weight: 500; }
.form-summary ul { margin: 0; padding-left: 20px; }
.form-summary a { color: var(--error-on-dark); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-1); }
.form-note { margin: 0; font-size: 0.9375rem; color: var(--text-on-dark-muted); }
.form-status { margin: 0; font-size: 1rem; }
.form-status:empty { display: none; }
.form-status.is-success { color: var(--turquoise); }
.form-status.is-error { color: var(--error-on-dark); }

.spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}
[data-submit][aria-busy="true"] .spinner { display: inline-block; }
[data-submit]:disabled { opacity: 0.6; cursor: not-allowed; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.site-footer { background: #051716; color: var(--text-on-dark-muted); padding-top: var(--s-12); font-size: 1rem; }
.footer-top { position: relative; display: grid; gap: var(--s-8); padding-bottom: var(--s-8); }
.logo.logo-footer { width: 200px; }
.footer-tagline {
  margin: var(--s-3) 0 var(--s-2); max-width: 24ch;
  font-family: var(--font-display); font-weight: 300; font-size: clamp(1.375rem, 2.2vw, 1.75rem); line-height: 1.25; color: var(--bone);
}
.footer-location {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-on-dark-muted);
}
.footer-location .arrow-mark { color: var(--turquoise); }
.footer-label { margin: 0 0 12px; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--turquoise); }
.footer-legal { padding-block: var(--s-4) var(--s-6); font-size: 0.8125rem; line-height: 1.6; }
.footer-legal > p { max-width: 110ch; }
.copyright { margin: var(--s-3) 0 0; letter-spacing: 0.04em; }
.footer-nav { list-style: none; margin: -8px 0 0; padding: 0; display: grid; gap: 4px; }
.footer-nav a {
  display: inline-flex; align-items: center; min-height: 40px;
  font-size: 1.0625rem; font-weight: 400; color: var(--bone); text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.footer-nav a:hover { color: var(--turquoise); }

.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1) var(--s-4);
  margin-top: var(--s-3);
}
.footer-bottom .copyright { margin: 0; }
.legal-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--s-3); }
.legal-links a, .link-button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  font: inherit; font-size: 0.8125rem; letter-spacing: 0.04em;
  color: var(--text-on-dark-muted); text-decoration: none; background: none; border: 0; cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}
.legal-links a:hover, .link-button:hover { color: var(--bone); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: var(--s-2) var(--gutter) calc(var(--s-2) + env(safe-area-inset-bottom));
  background: rgba(5, 23, 22, 0.97); color: var(--bone);
  border-top: 1px solid var(--line-dark); box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25);
  transform: translateY(100%); transition: transform var(--dur) var(--ease-out);
}
.cookie-banner.is-open { transform: none; }
.cookie-inner {
  max-width: var(--max); margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4);
}
.cookie-text { margin: 0; max-width: 72ch; font-size: 0.9375rem; line-height: 1.55; color: var(--text-on-dark-muted); }
.cookie-text a { color: var(--bone); text-underline-offset: 3px; }
.cookie-actions { display: flex; gap: var(--s-1); flex-shrink: 0; }
@media (max-width: 599px) {
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; }
}

/* ---------- Legal pages (Privacy, Terms) ---------- */
.site-header.is-solid { background: var(--nightfall); box-shadow: 0 1px 0 var(--line-dark); }
.legal { background: var(--bone); padding: calc(var(--header-h) + clamp(48px, 7vw, 96px)) 0 clamp(80px, 10vw, 128px); }
.legal-inner { max-width: calc(760px + 2 * var(--gutter)); }
.legal-title { font-size: clamp(2.25rem, 5vw, 3.5rem); margin-bottom: var(--s-6); }
.legal-body h2 {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem); font-weight: 400; color: var(--juniper);
  margin: var(--s-6) 0 var(--s-2);
}
.legal-body p { margin: 0 0 1.1em; font-size: 1.0625rem; line-height: 1.75; color: var(--text-muted); }
.legal-body a { color: var(--juniper); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal-body a:hover { color: var(--nightfall); }
.legal-links a[aria-current="page"] { color: var(--bone); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 599px) {
  /* Nav links stay visible on phones now that the header button is gone */
  .nav { gap: 14px; }
  .nav a:not(.btn) { font-size: 0.6875rem; letter-spacing: 0.12em; }
  .logo { width: 116px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 100%; }
  .form-foot .btn { width: 100%; }
}
@media (min-width: 720px) {
  .footer-top { grid-template-columns: 1fr auto; gap: var(--s-6); }
  .footer-links { min-width: 180px; }
}
@media (min-width: 720px) {
  .pillars { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(32px, 5vw, 72px); }
  .form-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 960px) {
  .about-grid { grid-template-columns: 1.05fr 0.95fr; gap: clamp(64px, 8vw, 128px); align-items: start; }
  .about-copy { padding-top: var(--s-2); }
  .about-media--collage { align-self: center; }
  .contact-grid { grid-template-columns: 0.85fr 1.15fr; gap: clamp(64px, 8vw, 128px); }
  .logo { width: 176px; }
}

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

.br-lg { display: none; }
@media (min-width: 960px) { .br-lg { display: inline; } }
