@import url('https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-sans/style.css');
@import url('https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-mono/style.css');
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --basalt: #0A0E11;
  --ridge: #12242C;
  --chalk: #EDEAE2;
  --teal: #16D6A8;
  --stone: #8B959B;
  --font-heading: 'Geist Sans', 'Geist', system-ui, sans-serif;
  --font-body: 'Instrument Sans', system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --max-width: 1200px;
  --section-pad: clamp(4rem, 8vw, 8.75rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: currentColor; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { opacity: 0.85; }

.surface-basalt { background: var(--basalt); color: var(--chalk); }
.surface-chalk { background: var(--chalk); color: var(--basalt); }
.surface-ridge { background: var(--ridge); color: var(--chalk); }
.surface-teal { background: var(--teal); color: var(--basalt); }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 600; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
}
.muted { color: var(--stone); }
.text-teal { color: var(--teal); }

.container {
  width: min(100% - 2.5rem, var(--max-width));
  margin-inline: auto;
}
.section { padding-block: var(--section-pad); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.625rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s, box-shadow 0.2s;
}
.btn-primary { background: var(--teal); color: var(--basalt); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 4px 24px rgba(22, 214, 168, 0.25); opacity: 1; }
.btn-secondary {
  background: transparent;
  color: currentColor;
  border-color: currentColor;
}
.btn-secondary:hover { filter: brightness(1.15); opacity: 1; }

.hairline {
  border: none;
  border-top: 1px solid rgba(237, 234, 226, 0.15);
  margin: 0;
}
.surface-chalk .hairline { border-top-color: rgba(10, 14, 17, 0.12); }

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background 0.3s, box-shadow 0.3s;
}
.site-header.is-scrolled {
  background: var(--chalk);
  color: var(--basalt);
  box-shadow: 0 1px 0 rgba(10, 14, 17, 0.08);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.logo span { color: var(--teal); }
.site-header:not(.is-scrolled) .logo span { color: var(--teal); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid currentColor;
  color: inherit;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
}
.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.9;
}
.main-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.3em; }

/* Hero — THE CONTOUR */
.hero-contour {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 0;
  overflow: hidden;
}
.hero-contour::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/images/crestlife-01-hero-studio.jpg') center/cover no-repeat;
  z-index: 0;
}
.hero-contour::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,14,17,0.55) 0%, rgba(10,14,17,0.92) 70%, var(--basalt) 100%);
  z-index: 1;
}
.hero-contour .container { position: relative; z-index: 2; }
.hero-eyebrow-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6rem;
  padding-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero-eyebrow-row .right { color: var(--teal); }
.hero-content { padding-bottom: 3rem; max-width: 720px; }
.hero-content h1 { margin: 0.75rem 0 1.25rem; }
.hero-content .sub {
  font-size: 1.0625rem;
  opacity: 0.85;
  max-width: 560px;
  margin-bottom: 2rem;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-trust {
  position: relative;
  z-index: 2;
  padding: 0.875rem 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--stone);
  border-top: 1px solid rgba(237, 234, 226, 0.12);
}

.contour-motif {
  position: absolute;
  bottom: 15%;
  right: 0;
  width: 55%;
  height: 40%;
  opacity: 0.12;
  pointer-events: none;
  z-index: 1;
}
.contour-motif svg { width: 100%; height: 100%; }
.contour-motif path {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1;
}

/* Elevation ladder */
.elevation-ladder { position: relative; }
.ladder-step {
  position: relative;
  padding: 1.75rem 2rem;
  margin-bottom: 0.5rem;
  border-left: 2px solid var(--teal);
  background: rgba(18, 36, 44, 0.6);
}
.ladder-step:nth-child(1) { margin-left: 0; }
.ladder-step:nth-child(2) { margin-left: 2rem; }
.ladder-step:nth-child(3) { margin-left: 4rem; }
.ladder-step:nth-child(4) { margin-left: 6rem; }
.ladder-step:nth-child(5) { margin-left: 8rem; }
.ladder-step .step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.metric-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}
.metric-trio .num {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  color: var(--teal);
  display: block;
}
.metric-trio .label { font-size: 0.875rem; color: var(--stone); margin-top: 0.5rem; }

.two-col-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid rgba(237, 234, 226, 0.12);
}
.two-col-list > div {
  padding: 2rem;
  border-right: 1px solid rgba(237, 234, 226, 0.12);
}
.two-col-list > div:nth-child(2n) { border-right: none; }
.two-col-list h3 { margin-top: 0; }

.capability-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  padding-block: 3rem;
  border-bottom: 1px solid rgba(237, 234, 226, 0.08);
}
.capability-row.reverse .cap-img { order: 2; }
.capability-row.reverse .cap-text { order: 1; }
.cap-img img {
  border: 1px solid rgba(22, 214, 168, 0.3);
  border-radius: 2px;
}

.work-teaser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.work-card {
  padding: 2rem;
  background: rgba(10, 14, 17, 0.4);
  border: 1px solid rgba(237, 234, 226, 0.1);
}
.work-card h3 { margin-top: 0; }

.mini-faq details {
  border-bottom: 1px solid rgba(237, 234, 226, 0.12);
  padding: 1.25rem 0;
}
.mini-faq summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.mini-faq summary::-webkit-details-marker { display: none; }

.cta-band {
  text-align: center;
  padding: var(--section-pad) 0;
}
.cta-band h2 { margin-bottom: 1rem; }
.cta-band p { max-width: 540px; margin: 0 auto 2rem; color: var(--stone); }

/* Page hero (inner pages) */
.page-hero {
  padding-top: 8rem;
  padding-bottom: 3rem;
}
.page-hero h1 { margin: 0.5rem 0 1rem; }

/* Services */
.service-block {
  padding: 3rem 0;
  border-bottom: 1px solid rgba(237, 234, 226, 0.08);
}
.service-block:last-child { border-bottom: none; }
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}

/* FAQ page */
.faq-list details {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(10, 14, 17, 0.1);
}
.faq-list summary {
  font-weight: 600;
  cursor: pointer;
  padding-right: 2rem;
}
.surface-ridge .faq-list details,
.surface-basalt .faq-list details { border-bottom-color: rgba(237, 234, 226, 0.12); }

/* Contact form */
.contact-hero-img { margin-bottom: 2rem; border-radius: 2px; }
.form-surface {
  padding: 2.5rem;
  border-radius: 2px;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid rgba(10, 14, 17, 0.2);
  border-radius: 2px;
  background: #fff;
  color: var(--basalt);
}
.form-group textarea { min-height: 140px; resize: vertical; }
.form-check {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.875rem;
}
.form-check input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
  padding: 0;
  accent-color: var(--teal);
}
.form-group.form-check label {
  display: block;
  margin-bottom: 0;
  font-weight: 400;
  flex: 1;
}
.surface-basalt .form-surface,
.surface-ridge .form-surface {
  border: 1px solid rgba(237, 234, 226, 0.1);
}
.surface-basalt .form-group input:not([type="checkbox"]),
.surface-basalt .form-group select,
.surface-basalt .form-group textarea,
.surface-ridge .form-group input:not([type="checkbox"]),
.surface-ridge .form-group select,
.surface-ridge .form-group textarea {
  background: var(--basalt);
  border-color: rgba(237, 234, 226, 0.15);
  color: var(--chalk);
}
.surface-basalt .form-group input:not([type="checkbox"]):focus,
.surface-basalt .form-group select:focus,
.surface-basalt .form-group textarea:focus,
.surface-ridge .form-group input:not([type="checkbox"]):focus,
.surface-ridge .form-group select:focus,
.surface-ridge .form-group textarea:focus {
  outline: 2px solid rgba(22, 214, 168, 0.4);
  outline-offset: 1px;
}
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: start;
}
.contact-info dl { margin: 0; }
.contact-info dt {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  margin-top: 1.25rem;
}
.contact-info dd { margin: 0.25rem 0 0; }

/* Legal prose */
.legal-prose h2 { margin-top: 2.5rem; font-size: 1.375rem; }
.legal-prose h3 { margin-top: 1.75rem; font-size: 1.125rem; }
.legal-prose p, .legal-prose li { font-size: 0.9375rem; }
.legal-prose ul { padding-left: 1.25rem; }

/* Footer */
.site-footer {
  padding: 4rem 0 2rem;
  font-size: 0.875rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  color: var(--stone);
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.5rem; }
.footer-disclaimer {
  padding-top: 2rem;
  border-top: 1px solid rgba(237, 234, 226, 0.1);
  font-size: 0.8125rem;
  color: var(--stone);
  line-height: 1.6;
}
.surface-chalk .footer-disclaimer { border-top-color: rgba(10, 14, 17, 0.1); }
.footer-bottom {
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--stone);
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 1.25rem;
  background: var(--ridge);
  color: var(--chalk);
  border-top: 1px solid rgba(22, 214, 168, 0.3);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
  transform: translateY(100%);
  transition: transform 0.35s ease;
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-inner {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.cookie-text { flex: 1 1 320px; font-size: 0.875rem; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cookie-actions button {
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid rgba(237,234,226,0.3);
  background: transparent;
  color: var(--chalk);
}
.cookie-actions .accept { background: var(--teal); color: var(--basalt); border-color: var(--teal); }

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(10,14,17,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cookie-modal.is-open { display: flex; }
.cookie-modal-panel {
  background: var(--chalk);
  color: var(--basalt);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  border-radius: 2px;
}
.cookie-modal-panel h3 { margin-top: 0; }
.cookie-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(10,14,17,0.1);
}

/* Reveal animation */
.js .reveal {
  transition: opacity 0.6s ease, transform 0.6s ease;
}
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 1;
    transform: translateY(16px);
  }
  .js .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal { transform: none; }
}

/* 404 */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  text-align: center;
  padding-top: 6rem;
}
.error-page h1 { font-size: clamp(2.5rem, 6vw, 4rem); }

/* Responsive */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--chalk);
    color: var(--basalt);
    padding: 1rem 1.25rem;
    display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0.75rem; }
  .hero-contour { min-height: 84vh; }
  .ladder-step:nth-child(n) { margin-left: 0 !important; }
  .metric-trio { grid-template-columns: 1fr; gap: 1.5rem; }
  .two-col-list, .capability-row, .work-teaser, .contact-grid, .service-grid, .footer-grid {
    grid-template-columns: 1fr;
  }
  .two-col-list > div { border-right: none; border-bottom: 1px solid rgba(237,234,226,0.12); }
  .capability-row.reverse .cap-img,
  .capability-row.reverse .cap-text { order: unset; }
}
