/* Design: editorial "open sky" — deep blue sky hero with drifting clouds, gold accents on warm white,
   Fraunces display + Instrument Sans body, viewport-sized type, numbered chapters, blur-to-sharp scroll reveals. */
:root {
  --sky-deep: #0f2f8f;
  --sky: #2f63d8;
  --sky-light: #8fb3f2;
  --sky-haze: #dce7fb;
  --gold: #e3a82b;
  --gold-soft: #f6dfa4;
  --ink: #0c1838;
  --ink-soft: #46506b;
  --paper: #fbf9f4;
  --white: #ffffff;
  --line: rgba(12, 24, 56, 0.14);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
  --col: 44rem;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.65;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--sky); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--sky-deep); text-decoration-color: var(--gold); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.02; letter-spacing: -0.02em; margin: 0; }
code { font-size: 0.9em; background: var(--sky-haze); padding: 0.1em 0.35em; border-radius: 0.25em; }

/* ===== Header ===== */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding: 1rem var(--gutter);
  color: var(--white);
  transition: background 0.4s var(--ease), color 0.4s var(--ease), padding 0.4s var(--ease), box-shadow 0.4s;
}
.site-header.scrolled {
  background: rgba(251, 249, 244, 0.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--ink); padding-block: 0.6rem;
  box-shadow: 0 1px 0 var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 90rem; margin: 0 auto; }
.brand { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: inherit; text-decoration: none; letter-spacing: -0.01em; }
.brand::before { content: ''; display: inline-block; width: 0.55em; height: 0.55em; margin-right: 0.45em; border-radius: 50%; background: var(--gold); vertical-align: 0.05em; }
.nav-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; padding: 0; }
.nav-list a { color: inherit; text-decoration: none; font-size: 0.9rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; position: relative; }
.nav-list a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -0.25em; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease); }
.nav-list a:hover::after { transform: scaleX(1); }
.nav-list a:hover { color: inherit; }

/* ===== Altitude-style progress gauge ===== */
.gauge {
  position: fixed; right: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 40;
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem;
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  color: var(--white); mix-blend-mode: difference; pointer-events: none;
}
.gauge-num { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 0; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-track { position: relative; width: 2px; height: 9rem; background: rgba(255,255,255,0.3); }
.gauge-track::before { content: ''; position: absolute; inset: 0 auto 0 -6px; width: 14px;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.55) 0 1px, transparent 1px 12px); }
.gauge-fill { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: var(--white); transform: scaleY(0); transform-origin: top; }
.gauge-label { max-width: 9rem; text-align: right; }
@media (max-width: 900px) { .gauge { display: none; } }

/* ===== Hero / sky ===== */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 62vh; display: flex; align-items: flex-end;
  padding: 8rem var(--gutter) clamp(3rem, 8vw, 6rem);
  color: var(--white);
  background: linear-gradient(180deg, var(--sky-deep) 0%, var(--sky) 45%, var(--sky-light) 80%, var(--sky-haze) 100%);
}
.hero--home { min-height: 100vh; min-height: 100svh; align-items: center; }
.hero-inner { position: relative; z-index: 2; width: 100%; max-width: 90rem; margin: 0 auto; will-change: transform, filter, opacity; }
.hero h1 { font-size: clamp(2.8rem, 8vw, 7rem); text-wrap: balance; }
.hero--home h1 { font-size: clamp(3.4rem, 13.5vw, 13rem); line-height: 0.9; letter-spacing: -0.045em; font-weight: 700; }
.hero--home h1 .line { display: block; }
.hero--home h1 em { font-style: italic; font-weight: 400; color: var(--gold-soft); }
.hero h1 .small { display: block; font-size: 0.24em; font-weight: 400; letter-spacing: 0; line-height: 1.2; margin-top: 0.6em; font-family: var(--font-body); }
.hero-lede { max-width: 34rem; margin: 2rem 0 0; font-size: clamp(1.05rem, 1rem + 0.5vw, 1.35rem); line-height: 1.5; color: rgba(255,255,255,0.92); }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; margin-top: 2.5rem; }
.scroll-cue { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.85); display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.scroll-cue::after { content: ''; width: 1px; height: 2.5rem; background: currentColor; animation: cue 2.2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

.eyebrow { display: inline-flex; align-items: center; gap: 0.6rem; margin: 0 0 1.25rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.eyebrow::before { content: ''; width: 2rem; height: 1px; background: currentColor; opacity: 0.6; }
.hero .eyebrow { color: var(--gold-soft); }

.sky { position: absolute; inset: -10% 0 0 0; z-index: 1; pointer-events: none; will-change: transform; }
.cloud {
  position: absolute; display: block; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,0.95), rgba(255,255,255,0.55) 55%, rgba(255,255,255,0));
  filter: blur(6px); opacity: 0.85;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after { content: ''; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 60%; height: 120%; left: 15%; top: -45%; }
.cloud::after { width: 45%; height: 95%; right: 8%; top: -25%; }
.c1 { width: 26rem; height: 7rem; top: 18%; left: -10%; animation-duration: 95s; }
.c2 { width: 18rem; height: 5rem; top: 52%; left: 55%; animation-duration: 120s; animation-delay: -40s; opacity: 0.6; }
.c3 { width: 34rem; height: 9rem; top: 78%; left: 20%; animation-duration: 140s; animation-delay: -70s; }
.c4 { width: 12rem; height: 3.5rem; top: 34%; left: 78%; animation-duration: 80s; animation-delay: -20s; opacity: 0.5; filter: blur(10px); }
.c5 { width: 22rem; height: 6rem; top: 92%; left: -15%; animation-duration: 110s; animation-delay: -55s; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(120vw); } }

/* ===== Main content defaults (reading column for policy/text pages) ===== */
main > section:not(.hero) {
  max-width: calc(var(--col) + 2 * var(--gutter)); margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter);
}
main > section:not(.hero) h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); margin: 2.5rem 0 1rem; }
main > section:not(.hero) h2:first-child { margin-top: 0; }
main > section:not(.hero) li { margin-bottom: 0.5rem; }
main > section:not(.hero) li::marker { color: var(--gold); }
main > section:not(.hero) + section:not(.hero) { border-top: 1px solid var(--line); }

/* ===== Chapters (home) ===== */
main > section.chapter { max-width: 90rem; }
.chapter-head { display: grid; gap: 1.5rem; margin-bottom: clamp(2.5rem, 6vw, 5rem); }
.chapter-head h2,
main > section.chapter .chapter-head h2 { font-size: clamp(2.4rem, 6vw, 5.5rem); margin: 0; max-width: 16ch; text-wrap: balance; }
.chapter-head h2 em { font-style: italic; font-weight: 400; color: var(--sky); }
.chapter-head p { max-width: 36rem; margin: 0; color: var(--ink-soft); font-size: 1.15em; }
.chapter .eyebrow { color: var(--sky); margin: 0; }
.rule { display: block; width: 100%; height: 1px; border: 0; margin: 0;
  background: repeating-linear-gradient(90deg, var(--gold) 0 18px, transparent 18px 28px); }

/* Fact strip */
.fact-strip { background: var(--ink); color: var(--white); overflow: hidden; }
main > section.fact-strip { max-width: none; padding: 1.1rem 0; }
.fact-strip ul { display: flex; width: max-content; gap: 0; margin: 0; padding: 0; list-style: none; animation: ticker 40s linear infinite; }
main > section.fact-strip li { margin: 0; padding: 0 2.5rem; white-space: nowrap; font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; position: relative; }
.fact-strip li::after { content: '✦'; position: absolute; right: -0.4rem; color: var(--gold); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Services as editorial rows */
.service-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
main > section .service-rows > li { margin: 0; }
.service-row {
  display: grid; grid-template-columns: 4rem 1fr; gap: 0.5rem 1.5rem; align-items: start;
  padding: clamp(1.5rem, 3vw, 2.5rem) 0; border-bottom: 1px solid var(--line);
  transition: padding 0.4s var(--ease), background 0.4s var(--ease);
}
.service-row .num { font-family: var(--font-display); font-size: 1rem; color: var(--gold); font-weight: 600; padding-top: 0.6rem; }
.service-row h3 { font-size: clamp(1.8rem, 4.5vw, 3.6rem); font-weight: 500; transition: color 0.3s, transform 0.5s var(--ease); }
.service-row p { grid-column: 2; margin: 0; max-width: 34rem; color: var(--ink-soft); }
.service-row .doodle { display: none; }
.service-row:hover h3 { color: var(--sky); transform: translateX(0.5rem); }
@media (min-width: 900px) {
  .service-row { grid-template-columns: 5rem minmax(0, 1.3fr) minmax(0, 1fr) 6rem; align-items: center; }
  .service-row p { grid-column: auto; }
  .service-row .doodle { display: block; width: 5rem; height: 5rem; color: var(--sky); justify-self: end; transition: transform 0.6s var(--ease), color 0.3s; }
  .service-row:hover .doodle { transform: rotate(-8deg) scale(1.08); color: var(--gold); }
}
.doodle path, .doodle circle, .doodle rect { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Process (how we work) */
.chapter--sky { background: linear-gradient(180deg, var(--paper), var(--sky-haze)); }
main > section.chapter--sky { max-width: none; }
.chapter--sky > * { max-width: 90rem; margin-left: auto; margin-right: auto; }
.process { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.process::before { content: ''; position: absolute; left: 1.4rem; top: 0.5rem; bottom: 0.5rem; width: 2px; background: var(--gold); transform: scaleY(var(--progress, 0)); transform-origin: top; transition: transform 0.2s linear; }
main > section .process li { counter-increment: step; position: relative; padding: 0 0 2.75rem 4.5rem; margin: 0; }
.process li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: -0.1rem;
  width: 2.8rem; height: 2.8rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--gold); font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--ink);
}
.process h3 { font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 500; margin-bottom: 0.4rem; }
.process p { margin: 0; color: var(--ink-soft); max-width: 32rem; }
@media (min-width: 900px) {
  .process { grid-template-columns: repeat(4, 1fr); gap: 2rem; }
  .process::before { left: 0; right: 0; top: 1.4rem; bottom: auto; width: auto; height: 2px; transform: scaleX(var(--progress, 0)); transform-origin: left; }
  main > section .process li { padding: 4.5rem 0 0; }
}

/* FAQ */
.faq-list { border-top: 1px solid var(--line); max-width: 60rem; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1.5rem 0; font-family: var(--font-display); font-size: clamp(1.2rem, 1rem + 1vw, 1.75rem); font-weight: 500;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; font-family: var(--font-body); font-weight: 300; font-size: 1.6em; line-height: 0.8; color: var(--gold); transition: transform 0.35s var(--ease); }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list summary:hover { color: var(--sky); }
.faq-list details p { margin: 0 0 1.5rem; max-width: 40rem; color: var(--ink-soft); }

/* Contact */
.contact { background: var(--sky-deep); color: var(--white); }
main > section.contact { max-width: none; }
.contact-inner { max-width: 90rem; margin: 0 auto; display: grid; gap: clamp(2.5rem, 6vw, 5rem); }
@media (min-width: 900px) { .contact-inner { grid-template-columns: 1.2fr 1fr; } }
.contact .chapter-head { margin-bottom: 2rem; }
.contact .eyebrow { color: var(--gold-soft); }
main > section.contact h2 { font-size: clamp(2.4rem, 6vw, 5.5rem); margin: 0; }
.contact .chapter-head h2 em { color: var(--gold-soft); }
.contact .chapter-head p { color: rgba(255,255,255,0.8); }
.contact a { color: var(--gold-soft); }
#contact-form { display: grid; gap: 0.4rem; }
#contact-form label { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.75); margin-top: 1rem; }
#contact-form input[type="text"], #contact-form input[type="email"], #contact-form textarea {
  width: 100%; font: inherit; font-size: 1.15rem; color: var(--white);
  background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,0.4); border-radius: 0;
  padding: 0.6rem 0; transition: border-color 0.3s;
}
#contact-form textarea { resize: vertical; min-height: 6rem; }
#contact-form input:focus, #contact-form textarea:focus { outline: none; border-bottom-color: var(--gold); }
.privacy-notice { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.25rem; }
#contact-form .privacy-notice label { margin: 0; text-transform: none; letter-spacing: 0; font-size: 0.95rem; font-weight: 400; }
.privacy-notice input { accent-color: var(--gold); width: 1.1rem; height: 1.1rem; }
.btn, #contact-form button {
  justify-self: start; display: inline-flex; align-items: center; gap: 0.75rem; margin-top: 1.75rem;
  font: 600 1rem var(--font-body); letter-spacing: 0.04em; color: var(--ink); text-decoration: none;
  background: var(--gold); border: 0; border-radius: 999px; padding: 1rem 1.75rem; cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.3s, box-shadow 0.35s;
}
.btn::after, #contact-form button::after { content: '→'; transition: transform 0.35s var(--ease); }
.btn:hover, #contact-form button:hover { color: var(--ink); background: var(--gold-soft); transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(227,168,43,0.8); }
.btn:hover::after, #contact-form button:hover::after { transform: translateX(4px); }
.btn--ghost { background: transparent; color: var(--white); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6); }
.btn--ghost:hover { color: var(--ink); background: var(--white); }
.hero .btn { margin-top: 0; }
.form-errors { list-style: none; padding: 1rem 1.25rem; margin: 0 0 1rem; border-left: 3px solid #ff8a80; background: rgba(255,255,255,0.08); color: #ffd6d2; }
main > section .form-errors li { margin: 0.2rem 0; }
.form-success { font-family: var(--font-display); font-size: 1.6rem; color: var(--gold-soft); }
.contact address { font-style: normal; align-self: end; display: grid; gap: 0.25rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.25); }
.contact address p { margin: 0; }
/* Contact on light pages (contact page uses same dark block) */

/* ===== Footer ===== */
footer { background: var(--ink); color: rgba(255,255,255,0.75); padding: clamp(3rem, 8vw, 5rem) var(--gutter) 2rem; font-size: 0.9rem; overflow: hidden; }
.footer-inner { max-width: 90rem; margin: 0 auto; display: grid; gap: 1.5rem; }
.footer-word { font-family: var(--font-display); font-weight: 700; font-size: clamp(4rem, 19vw, 18rem); line-height: 0.8; letter-spacing: -0.05em; color: var(--white); margin: 0 0 1rem; white-space: nowrap; }
.footer-word span { color: var(--gold); }
.footer-info p { margin: 0.2rem 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.15); }
footer a { color: var(--white); }
footer a:hover { color: var(--gold); }

/* ===== Cookie banner ===== */
#cookie-banner {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: 1rem; z-index: 60; max-width: 34rem;
  background: var(--white); color: var(--ink); padding: 1.25rem 1.5rem; border-radius: 1rem;
  box-shadow: 0 20px 60px -20px rgba(12,24,56,0.45), 0 0 0 1px var(--line);
  display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9rem;
}
#cookie-banner p { margin: 0; }
#cookie-banner .actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
#cookie-banner button { font: 600 0.85rem var(--font-body); border-radius: 999px; padding: 0.6rem 1.1rem; cursor: pointer; border: 1px solid var(--ink); background: transparent; color: var(--ink); }
#cookie-banner button#cookie-accept-all { background: var(--ink); color: var(--white); }
#cookie-banner button:hover { border-color: var(--sky); color: var(--sky); }
#cookie-banner button#cookie-accept-all:hover { background: var(--sky); color: var(--white); }

/* ===== Scroll reveal (blur to sharp) — only when JS is running ===== */
.js .reveal { opacity: 0; filter: blur(10px); transform: translateY(1.5rem); transition: opacity 0.9s var(--ease), filter 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.is-in { opacity: 1; filter: blur(0); transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cloud, .fact-strip ul, .scroll-cue::after { animation: none; }
  .js .reveal { opacity: 1; filter: none; transform: none; transition: none; }
  .process::before { transform: none; }
}
main > section:not(.hero) .eyebrow { color: var(--sky); }
main > section:not(.hero) .eyebrow + h2 { margin-top: 0; }
main > section.contact .eyebrow { color: var(--gold-soft); }
/* Keep content clear of the fixed progress gauge on wide screens */
@media (min-width: 900px) {
  .hero-inner, .chapter-head, .service-rows, .process, .faq-list, .contact-inner { padding-right: 5rem; }
  .service-rows, .faq-list { margin-right: 5rem; padding-right: 0; }
}
.brand { white-space: nowrap; }
.hero h1 .small { font-size: max(1.1rem, 0.24em); }
@media (max-width: 560px) {
  .site-header { padding-inline: 1rem; }
  .brand { font-size: 1.1rem; }
  .nav-list { gap: 0.25rem 0.9rem; flex-wrap: nowrap; }
  .nav-list a { font-size: 0.72rem; letter-spacing: 0.06em; }
}
