/* FIRSTWATER — design system v1. Fonts via <link> in base.html. */
:root {
  --ink: #0A0B0D;
  --panel: #12151A;
  --paper: #F5F7FA;
  --gray: #98A1AB;
  --accent: #62B6E8;
  /* Accessible link blue on the paper ground: #1F6FA8 on #F5F7FA = 5.02:1
     (WCAG AA needs 4.5:1). The ice --accent (2.09:1 on paper) stays for
     dark grounds only. */
  --accent-on-light: #1F6FA8;
  --line: rgba(152, 161, 171, 0.18);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  /* compatibility aliases (legacy class rules) */
  --bg: var(--ink);
  --text: var(--paper);
  --text-muted: var(--gray);
  --font-heading: var(--font-display);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-up, .fade-in { transition: none !important; opacity: 1 !important; transform: none !important; }
}
body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1.06rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.015em; }
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.eyebrow { font: 600 0.75rem var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gray); display: block; margin-bottom: 1.2rem; }

/* ---- cymatics ground (signature element) ----
   Fixed canvas behind everything; scroll-driven Chladni nodal lines.
   Sections sit at z-index 1: light sections are opaque and cover it,
   dark sections are transparent and let it read through. */
#cymaticsCanvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.cymatics-band { height: 55vh; }

/* ---- sections: contrast rhythm ---- */
.section { padding: 7rem 0; position: relative; z-index: 1; }
.section--light { background: var(--paper); color: var(--ink); }
.section--light .eyebrow { color: rgba(10,11,13,0.65); }
.section--light a { color: var(--accent-on-light); }
.section--dark { background: transparent; color: var(--paper); }
.section--panel { background: var(--panel); color: var(--paper); }
.section h2 { font-size: clamp(2rem, 4vw, 3.2rem); margin-bottom: 1.6rem; }
.section p { max-width: 42rem; }
.section p + p { margin-top: 1.1rem; }

/* ---- header ---- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ink); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 1rem 24px; }
.logo { text-decoration: none; }
.logo-word { font: 700 1rem var(--font-display); letter-spacing: 0.22em; color: var(--paper); }
.nav-links { list-style: none; display: flex; gap: 2rem; align-items: center; }
.nav-links a { color: var(--gray); text-decoration: none; font: 600 0.9rem var(--font-body); transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--paper); }
.nav-links .nav-cta { background: var(--accent); color: var(--ink); padding: 0.6rem 1.3rem; display: inline-flex; align-items: center; min-height: 44px; }
.nav-links .nav-cta:hover { color: var(--ink); filter: brightness(1.1); }
.mobile-menu-toggle { display: none; background: none; border: none; color: var(--paper); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0.55rem; min-width: 44px; min-height: 44px; }
@media (max-width: 760px) {
  .mobile-menu-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--panel); flex-direction: column; padding: 1.5rem; gap: 1.2rem; border-bottom: 1px solid var(--line); }
  .nav-links.mobile-open { display: flex; }
  /* Desktop line breaks orphan-wrap at phone widths; let the headline flow. */
  .hero-section h1 br { display: none; }
  /* Fold: at 375px the h1 sits at its 3.5rem floor and wraps to ~7 lines, so
     trim the homepage hero's top padding and sub margins to clear the CTA
     above the 812px mobile fold. Interior .page-hero pages keep their spacing. */
  .hero-section:not(.page-hero) { padding: 2.5rem 0; }
  .hero-section:not(.page-hero) .hero-sub { margin: 1rem 0 1.6rem; }
}

/* ---- hero ---- */
.hero-section { min-height: 82vh; display: flex; align-items: center; position: relative; overflow: hidden; padding: 4.5rem 0; }
.hero-section h1 { font-size: clamp(2.6rem, 5.5vw, 4.2rem); font-weight: 300; letter-spacing: -0.01em; max-width: 30ch; }
.hero-sub { color: var(--gray); font-size: 1.15rem; max-width: 38rem; margin: 1.8rem 0 2.6rem; }
.hero-date { color: var(--accent); font: 600 0.85rem var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; }
/* Full-bleed photo behind the hero; directional scrim keeps the left column readable */
.hero-media { position: absolute; inset: 0; z-index: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(100deg, rgba(10,11,13,0.9) 0%, rgba(10,11,13,0.68) 40%, rgba(10,11,13,0.28) 68%, rgba(10,11,13,0.06) 100%),
  linear-gradient(0deg, rgba(10,11,13,0.72) 0%, rgba(10,11,13,0) 30%); }
.hero-section .container { position: relative; z-index: 2; width: 100%; }
.hero-section .hero-sub { color: rgba(245,247,250,0.82); }
/* Interior page hero: same anatomy, lower ceiling */
.page-hero { min-height: 56vh; padding: 6rem 0 4rem; }
.page-hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 300; }
@media (prefers-reduced-motion: no-preference) {
  .hero-media img { animation: heroDrift 16s ease-out both; }
  @keyframes heroDrift { from { transform: scale(1.055); } to { transform: scale(1); } }
}

/* ---- buttons ---- */
.btn { display: inline-block; font: 600 0.95rem var(--font-body); text-decoration: none; padding: 0.95rem 2rem; transition: filter .2s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { border: 1px solid var(--line); color: var(--paper); }
.btn + .btn { margin-left: 0.8rem; }
@media (max-width: 480px) { .btn + .btn { margin-left: 0; margin-top: 0.8rem; } }
.section--light .btn-ghost { color: var(--ink); border-color: rgba(10,11,13,0.25); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- steps ---- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin-top: 3rem; }
.step h3 { font-size: 1.3rem; margin-bottom: 0.7rem; }
.step .step-k { font: 700 2.6rem var(--font-display); color: var(--accent); display: block; margin-bottom: 0.8rem; }
.step p { color: var(--gray); font-size: 0.98rem; }
.section--light .step p { color: rgba(10,11,13,0.65); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---- faq ---- */
.faq-list { max-width: 46rem; margin-top: 2.5rem; }
.accordion { border-bottom: 1px solid var(--line); }
.section--light .accordion { border-color: rgba(10,11,13,0.14); }
.accordion-trigger { width: 100%; text-align: left; background: none; border: none; cursor: pointer; font: 600 1.25rem var(--font-display); color: inherit; padding: 1.4rem 0; display: flex; justify-content: space-between; align-items: center; }
.accordion-trigger::after { content: "+"; font-size: 1.4rem; color: var(--accent); }
.accordion[data-open="true"] .accordion-trigger::after { content: "–"; }
.accordion-panel { display: none; padding: 0 0 1.4rem; color: var(--gray); max-width: 40rem; }
.section--light .accordion-panel { color: rgba(10,11,13,0.65); }
.accordion[data-open="true"] .accordion-panel { display: block; }

/* ---- email placeholder / logistics ---- */
.list-block { border: 1px solid var(--line); padding: 2.5rem; max-width: 34rem; margin-top: 2.5rem; }
.list-block .btn { margin-top: 1.2rem; }
.logistics { border: 1px solid var(--line); padding: 2rem; margin: 3rem 0; max-width: 34rem; }
.logistics dt { font: 600 0.75rem var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray); margin-top: 1rem; }
.logistics dd { margin: 0.2rem 0 0; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); padding: 4rem 0; background: transparent; position: relative; z-index: 1; }
.footer-inner { display: flex; flex-direction: column; gap: 1.2rem; }
.footer-line { font-family: var(--font-display); font-size: 1.5rem; }
.footer-links { list-style: none; display: flex; gap: 1.6rem; flex-wrap: wrap; }
.footer-links a { color: var(--gray); text-decoration: none; }
.footer-links a:hover { color: var(--paper); }
.footer-fine { color: var(--gray); font-size: 0.85rem; }

/* ---- motion: hero only (one key moment) ---- */
/* opacity:0 is gated on the `.js` flag (set in base.html head) so hero content
   stays visible when JavaScript is blocked or fails; reduced-motion also wins. */
.fade-up { opacity: 1; transform: none; }
.js .hero-section .fade-up { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.hero-section .fade-up.visible { opacity: 1; transform: none; }
.fade-in { opacity: 1; }

/* ---- asymmetric sequence (replaces card grid) ---- */
.seq { list-style: none; margin-top: 3.5rem; padding: 0; }
.seq-item { display: grid; grid-template-columns: 130px 1fr; gap: 2rem; padding: 2.4rem 0; border-top: 1px solid rgba(10,11,13,0.14); max-width: 46rem; }
.seq-item:nth-child(2) { margin-left: 10%; }
.seq-item:nth-child(3) { margin-left: 20%; }
.seq-n { font: 300 4.2rem var(--font-display); line-height: 1; color: var(--accent); }
.seq-item h3 { font-size: 1.35rem; margin-bottom: 0.7rem; }
.seq-item p { color: rgba(10,11,13,0.65); font-size: 1rem; max-width: 34rem; }
@media (max-width: 760px) { .seq-item, .seq-item:nth-child(2), .seq-item:nth-child(3) { margin-left: 0; grid-template-columns: 70px 1fr; gap: 1.2rem; } .seq-n { font-size: 2.6rem; } }

/* ---- blog (renderer classes) ---- */
.blog-article { max-width: 44rem; margin: 0 auto; padding: 5rem 24px; position: relative; z-index: 1; }
.blog-article__header { margin-bottom: 3rem; }
.blog-eyebrow { font: 600 0.75rem var(--font-body); letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.blog-headline { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 1rem 0 1.2rem; }
.blog-dek { color: var(--gray); font-size: 1.2rem; line-height: 1.6; }
.blog-byline { display: flex; gap: 0.5rem; flex-wrap: wrap; color: var(--gray); font-size: 0.9rem; margin-top: 1.6rem; }
.blog-byline__author { color: var(--paper); font-weight: 600; }
.blog-byline__sep { opacity: 0.5; }
.blog-hero { margin: 2.5rem 0; }
.blog-hero__img { }
.blog-hero__caption { color: var(--gray); font-size: 0.85rem; margin-top: 0.6rem; }
.blog-prose { font-size: 1.08rem; }
.blog-prose p { margin-bottom: 1.3rem; }
.blog-subhead { font-size: 1.7rem; margin: 3rem 0 1.2rem; }
.anchor-link { color: inherit; text-decoration: none; }
.blog-pullquote { border-left: 3px solid var(--accent); padding-left: 1.5rem; font-family: var(--font-display); font-size: 1.4rem; margin: 2.5rem 0; }
.blog-takeaways { border: 1px solid var(--line); padding: 1.8rem; margin: 2.5rem 0; }
.blog-takeaways__title { font-size: 1rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem; }
.blog-takeaways ul { padding-left: 1.2rem; }
.blog-takeaways li { margin-bottom: 0.6rem; }
.blog-cta { border: 1px solid var(--line); padding: 2.2rem; margin: 3rem 0; }
.blog-cta__headline { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 0.8rem; }
.blog-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: transparent; }
.blog-progress__bar { height: 100%; width: 0; background: var(--accent); }
.blog-related__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.blog-related__card { border: 1px solid var(--line); padding: 1.4rem; }
/* blog listing */
.blog-hero-section { padding: 6rem 0 3rem; }
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; padding-bottom: 6rem; }
.article-card { border: 1px solid var(--line); overflow: hidden; text-decoration: none; color: inherit; display: block; }
.article-card .card-body { padding: 1.5rem; }
.article-card .card-title { font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 0.6rem; }
.article-card .card-dek { color: var(--gray); font-size: 0.95rem; }

/* ---- contact form ---- */
.contact-form { max-width: 34rem; }
.form-field { display: block; margin-bottom: 1.6rem; }
.form-field span { display: block; font: 600 0.75rem var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(10,11,13,0.65); margin-bottom: 0.5rem; }
.form-field input, .form-field textarea, .form-field select { width: 100%; background: transparent; border: 1px solid rgba(10,11,13,0.25); padding: 0.85rem 1rem; font: 400 1rem var(--font-body); color: var(--ink); }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.form-check { display: flex; align-items: center; gap: 0.7rem; margin: 0 0 2rem; font-size: 0.95rem; color: rgba(10,11,13,0.75); }
.form-check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---- hear-first capture (contact) ---- */
#hear-first { scroll-margin-top: 90px; }
.hear-first { max-width: 34rem; margin-bottom: 3.5rem; padding-bottom: 3rem; border-bottom: 1px solid rgba(10,11,13,0.14); }
.form-note { max-width: 34rem; color: rgba(10,11,13,0.65); margin: 0 0 1.4rem; }
.session-status { margin-top: 1.6rem; }
