/* ==========================================================================
   Enduros — site styles
   --------------------------------------------------------------------------
   Layout and components for the marketing site. Design tokens (color, type,
   spacing, radii, motion) come from the design system:
   _ds/.../colors_and_type.css. No inline styles in the HTML — if a value is
   reused, it belongs to a token; if a pattern is reused, it belongs to a
   class here.
   ========================================================================== */

:root {
  /* Site-local tokens (not part of the core design system) */
  --paper: #f2f1ec;                            /* warm paper behind the topo callout */
  --hairline-on-dark: rgba(255, 255, 255, 0.08);
  --border-on-dark: rgba(255, 255, 255, 0.18);
  --header-height: 76px;
  --header-height-compact: 60px;
  --gutter: clamp(20px, 5vw, 48px);
  --section-pad: clamp(64px, 9vw, 100px);
}

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

html {
  scroll-behavior: smooth;
  /* Compact header height + border, so anchors land flush under the bar */
  scroll-padding-top: 61px;
}

body {
  margin: 0;
  background: var(--bg);
}

a { color: var(--brand-deep); }
a:hover { color: var(--fg-1); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--brand-tint); }

/* ----- Layout primitives -------------------------------------------------- */

.container {
  max-width: 1040px;
  margin: 0 auto;
}

.section {
  padding: var(--section-pad) var(--gutter);
}

.section--dark {
  background: var(--ink-surface);
  color: var(--fg-on-dark);
  position: relative;
  overflow: hidden;
}

.section--tint {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.section--quote {
  padding-top: 0;
}

/* ----- Header ------------------------------------------------------------- */

.site-header {
  background: var(--ink-surface);
  border-bottom: 1px solid var(--hairline-on-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
}

.header-bar {
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-height);
  transition: min-height 240ms var(--ease);
}

.site-header.is-scrolled .header-bar {
  min-height: var(--header-height-compact);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  padding: 10px 0;
}

.brand img {
  display: block;
  border-radius: var(--radius-sm);
}

.brand-name {
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: 0.82rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fg-on-dark);
}

.site-nav {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: clamp(2px, 1.5vw, 14px);
}

.nav-link {
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: var(--t-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg-on-dark-2);
  padding: 0 9px;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.nav-link:hover { color: var(--brand-mid); }

.nav-link.is-active {
  color: var(--brand-mid);
  box-shadow: inset 0 -1px 0 var(--brand-mid);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fg-on-dark);
}

.menu-toggle:hover { color: var(--brand-mid); }

@media (max-width: 760px) {
  .site-nav { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* ----- Overlay menu ------------------------------------------------------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--ink-surface);
  display: flex;
  flex-direction: column;
  animation: panel-in 260ms var(--ease) both;
}

.menu[hidden] { display: none; }

body.menu-open { overflow: hidden; }

.menu-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  min-height: var(--header-height);
  border-bottom: 1px solid var(--hairline-on-dark);
}

.menu .menu-toggle { display: inline-flex; }

.menu-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-6) var(--gutter) var(--space-7);
}

.menu-link {
  font-family: var(--font-serif);
  font-weight: var(--weight-light);
  font-size: clamp(2rem, 9vw, 2.9rem);
  letter-spacing: var(--tracking-tight);
  color: var(--fg-on-dark);
  text-decoration: none;
  padding: var(--space-3) 0;
  animation: panel-item 420ms var(--ease) both;
}

.menu-link:hover { color: var(--brand-mid); }

.menu-nav > :nth-child(1) { animation-delay: 60ms; }
.menu-nav > :nth-child(2) { animation-delay: 120ms; }
.menu-nav > :nth-child(3) { animation-delay: 180ms; }
.menu-nav > :nth-child(4) { animation-delay: 240ms; }
.menu-nav > :nth-child(5) { animation-delay: 300ms; }
.menu-nav > :nth-child(6) { animation-delay: 360ms; }

.menu-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 36px;
  animation: panel-item 420ms var(--ease) both;
}

.menu-foot .eyebrow { color: var(--fg-on-dark-3); }

.menu-email {
  font-family: var(--font-sans);
  font-size: var(--t-body);
  color: var(--brand-mid);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ----- Hero --------------------------------------------------------------- */

.hero-inner {
  padding: clamp(64px, 10vw, 110px) var(--gutter) clamp(72px, 11vw, 120px);
  position: relative;
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-light);
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
  max-width: 15ch;
}

.hero-title em {
  font-style: italic;
  font-weight: var(--weight-light);
  color: var(--brand-mid);
}

.hero-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

.hero-line-inner {
  display: inline-block;
  animation: hero-rise 720ms var(--ease) both;
}

.hero-line:nth-child(1) .hero-line-inner { animation-delay: 120ms; }
.hero-line:nth-child(2) .hero-line-inner { animation-delay: 280ms; }

.hero-lede {
  max-width: 56ch;
  margin: 30px 0 0;
  font-size: 1.1rem;
  line-height: var(--leading-body);
  color: var(--fg-on-dark-2);
  animation: fade-up 640ms var(--ease) 640ms both;
}

.hero-services {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 44px 0 0;
  padding: 0;
  animation: fade-up 640ms var(--ease) 840ms both;
}

.service-pill {
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: var(--t-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--fg-on-dark-2);
  border: 1px solid var(--border-on-dark);
  border-radius: var(--radius-pill);
  background: none;
  padding: 9px 18px;
  white-space: nowrap;
}

/* ----- Section headers ---------------------------------------------------- */

.section-head {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 2.5vw, 28px);
}

/* On small screens, stack the section number above the content instead of
   running it down the left edge. The vertical rule has no place in the
   stacked layout, so it is hidden. */
@media (max-width: 760px) {
  .section-head {
    flex-direction: column;
    gap: 14px;
  }
  .section-rule { display: none; }
}

.section-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--weight-light);
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1;
  color: var(--brand-complement-deep);
  flex: none;
}

.section--dark .section-num { color: var(--brand-complement); }

.section-rule {
  align-self: stretch;
  width: 1px;
  background: var(--rule);
  flex: none;
}

.section--dark .section-rule { background: var(--border-on-dark); }

.section-eyebrow {
  color: var(--brand-deep);
  margin: 0 0 10px;
}

.section--dark .section-eyebrow { color: var(--brand-mid); }

.section-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-light);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
  color: inherit;
  margin: 0;
  max-width: 24ch;
}

.section-title em {
  font-style: italic;
  font-weight: var(--weight-light);
  color: var(--brand);
}

.section--dark .section-title em { color: var(--brand-mid); }

.section-lede {
  margin: 18px 0 0;
  color: var(--fg-2);
  max-width: 56ch;
}

.section--dark .section-lede { color: var(--fg-on-dark-2); max-width: 58ch; }

/* ----- Pull quote --------------------------------------------------------- */

.pull {
  margin: 0;
  max-width: 40ch;
  border-left: 3px solid var(--brand);
  padding: 10px 0 10px 28px;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--weight-light);
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--fg-1);
}

/* ----- Service cards ------------------------------------------------------ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 0 clamp(32px, 5vw, 64px);
  margin-top: 52px;
}

.card {
  border-top: 1px solid var(--rule);
  padding: var(--space-6) 0 36px;
}

.card-eyebrow {
  color: var(--brand-deep);
  margin: 0 0 14px;
}

.card-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-medium);
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 0 0 var(--space-3);
}

.card-copy {
  margin: 0;
  color: var(--fg-2);
  font-size: 0.98rem;
}

/* ----- Approach tiles ----------------------------------------------------- */

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: var(--space-7);
}

.tile {
  background: var(--bg);
  padding: var(--space-6) 28px;
}

.tile-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-medium);
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 0 0 10px;
}

.tile-copy {
  margin: 0;
  color: var(--fg-2);
  font-size: var(--t-small);
}

/* ----- Clients ------------------------------------------------------------ */

.client-label {
  color: var(--fg-3);
  margin: 44px 0 0;
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 0 clamp(32px, 5vw, 56px);
  margin-top: var(--space-4);
}

.client {
  border-top: 1px solid var(--rule);
  padding: var(--space-5) 0 26px;
}

.client-name {
  font-family: var(--font-serif);
  font-weight: var(--weight-medium);
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 0 0 var(--space-2);
}

.client-copy {
  margin: 0;
  color: var(--fg-2);
  font-size: var(--t-small);
}

/* ----- XT Coach callout --------------------------------------------------- */

.xt-callout {
  display: flex;
  flex-wrap: wrap;
  gap: 28px clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--rule);
  margin-top: var(--space-7);
  padding: 36px clamp(16px, 2.5vw, 32px);
  background: var(--paper) url('../assets/topo-pattern.png') center / cover no-repeat;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.xt-brand {
  flex: 1 1 220px;
  min-width: 220px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.xt-brand img {
  flex: none;
  border-radius: var(--radius-sm);
  display: block;
}

.xt-title {
  font-family: var(--font-serif);
  font-weight: var(--weight-medium);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 0;
}

.xt-body {
  flex: 2 1 320px;
  min-width: 280px;
}

.xt-copy {
  margin: 0;
  color: var(--fg-2);
}

.xt-copy strong {
  font-weight: var(--weight-medium);
  color: var(--fg-1);
}

.xt-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) 28px;
  margin-top: var(--space-4);
}

.text-cta {
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  padding: 6px 0;
}

.text-cta:hover { color: var(--fg-1); }

/* ----- About -------------------------------------------------------------- */

.about-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(560px 400px at 100% 0%, rgba(63, 138, 160, 0.18), transparent 70%),
    radial-gradient(480px 360px at 0% 100%, rgba(216, 145, 106, 0.14), transparent 70%);
}

.about-inner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-7);
  align-items: flex-start;
}

.about-copy {
  flex: 2 1 420px;
  min-width: 300px;
}

.about-photo {
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 280px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.about-photo img {
  display: block;
  width: 100%;
}

/* ----- Contact ------------------------------------------------------------ */

.contact-cta {
  margin: 28px 0 0;
}

.button {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: var(--weight-medium);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-on-dark);
  background: var(--brand);
  text-decoration: none;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  transition: background var(--dur) var(--ease);
}

.button:hover {
  background: var(--brand-deep);
  color: var(--fg-on-dark);
}

/* ----- Footer ------------------------------------------------------------- */

.site-footer {
  background: var(--ink-surface);
  color: var(--fg-on-dark);
}

.footer-inner {
  padding: var(--space-6) var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.footer-brand img {
  display: block;
  border-radius: 6px;
}

.footer-note {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--fg-on-dark-2);
}

.footer-link {
  color: var(--fg-on-dark-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-link:hover { color: var(--fg-on-dark); }

/* ----- Scroll-reveal animations ------------------------------------------- */
/* Initial hidden states are gated on html.js so content is fully visible
   when JavaScript is unavailable. */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 560ms var(--ease), transform 560ms var(--ease);
}

html.js .card-grid [data-reveal]:nth-child(2),
html.js .tile-grid [data-reveal]:nth-child(2),
html.js .client-grid [data-reveal]:nth-child(2) { transition-delay: 90ms; }
html.js .card-grid [data-reveal]:nth-child(3),
html.js .tile-grid [data-reveal]:nth-child(3),
html.js .client-grid [data-reveal]:nth-child(3) { transition-delay: 180ms; }
html.js .card-grid [data-reveal]:nth-child(4),
html.js .client-grid [data-reveal]:nth-child(4) { transition-delay: 270ms; }

html.js .section-head [data-reveal-rule] {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 700ms var(--ease) 220ms;
}

html.js .section-head[data-reveal] .section-num {
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 600ms var(--ease) 80ms, transform 600ms var(--ease) 80ms;
}

html.js [data-reveal-quote] {
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 680ms var(--ease) 100ms, transform 680ms var(--ease) 100ms;
}

html.js .is-visible[data-reveal],
html.js .is-visible[data-reveal-quote],
html.js .is-visible[data-reveal] .section-num {
  opacity: 1;
  transform: none;
}

html.js .section-head.is-visible [data-reveal-rule] { transform: scaleY(1); }

/* ----- Keyframes ---------------------------------------------------------- */

@keyframes hero-rise {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}

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

@keyframes panel-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes panel-item {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* ----- Reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  html.js [data-reveal],
  html.js [data-reveal-quote],
  html.js [data-reveal-rule],
  html.js .section-head[data-reveal] .section-num {
    opacity: 1;
    transform: none;
  }
}
