/* ─────────────────────────────────────────────────────────────────
   scalar-motion.css
   shared layer for all four content pages — adds:
     · serif accent (Instrument Serif)
     · reveal-on-scroll states
     · hover lift on interactive elements
     · drop shadow on orange threads
     · slate-section dot grid + section-tone variants
     · type-contrast pass (bigger hero, lighter body)
   loaded AFTER each page's inline <style>, so these rules win.
   ───────────────────────────────────────────────────────────────── */

/* ─── 1. serif accent ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

.serif-accent {
  font-family: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ─── 2. type-contrast push ────────────────────────────────────
   the page reads flat partly because h1, h2, body all sit at
   similar visual weight. push the hierarchy: hero h1 lighter and
   bigger, body slightly lighter, sec-num just a bit smaller so
   headings dominate. */
.hero h1 {
  font-weight: 200;
  font-size: clamp(3rem, 5.8vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
}
h2 {
  font-weight: 300;
  letter-spacing: -0.022em;
}
.lede {
  color: var(--slate-light);
}
body { color: var(--slate); }
p { color: var(--muted); }
.illus-caption { color: var(--muted); }

/* ─── 3. reveals on scroll ─────────────────────────────────────
   default: hidden (translated down 14px, opacity 0).
   .is-visible (added by JS observer): settled state.
   no transition pre-visible to avoid initial-paint flash. */
.reveal,
.reveal-up,
.reveal-fade {
  opacity: 0;
  will-change: opacity, transform;
}
.reveal-up { transform: translateY(14px); }
.reveal-fade { transform: none; }

.reveal.is-visible,
.reveal-up.is-visible,
.reveal-fade.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 600ms cubic-bezier(.22,.61,.36,1),
    transform 600ms cubic-bezier(.22,.61,.36,1);
}

/* slight stagger via inline --i (set in markup) */
.reveal[style*="--i"].is-visible,
.reveal-up[style*="--i"].is-visible {
  transition-delay: calc(var(--i, 0) * 70ms);
}

/* ─── 4. orange thread shadow + draw-on-reveal ─────────────────
   thread paths get a faint slate drop shadow so they read as
   floating above the perspective planes. drawing animation is
   driven by stroke-dasharray on the path itself (set by JS).
   nodes + terminus block fade in after the thread completes. */
.illus-block svg path[stroke="#F04A2C"][fill="none"],
.hero-vis svg path[stroke="#F04A2C"][fill="none"],
.hero-illus svg path[stroke="#F04A2C"][fill="none"] {
  filter: drop-shadow(0 1px 2px rgba(48, 58, 58, 0.18));
}

/* nodes + terminus start invisible if illustration is observed */
.illus-block[data-illus] svg circle,
.illus-block[data-illus] svg rect[fill="#F04A2C"],
.hero-vis[data-illus] svg circle,
.hero-vis[data-illus] svg rect[fill="#F04A2C"],
.hero-illus[data-illus] svg circle,
.hero-illus[data-illus] svg rect[fill="#F04A2C"] {
  opacity: 0;
  transition: opacity 320ms ease-out;
}
.illus-block[data-illus].is-drawn svg circle,
.illus-block[data-illus].is-drawn svg rect[fill="#F04A2C"],
.hero-vis[data-illus].is-drawn svg circle,
.hero-vis[data-illus].is-drawn svg rect[fill="#F04A2C"],
.hero-illus[data-illus].is-drawn svg circle,
.hero-illus[data-illus].is-drawn svg rect[fill="#F04A2C"] {
  opacity: 1;
}

/* ─── 5. parallax target — JS translates Y on scroll ──────────
   only affects elements with data-parallax. transform applied
   inline by JS; we just hint the browser. */
[data-parallax] {
  will-change: transform;
}

/* ─── 6. hover lift — one consistent move ─────────────────────
   translateY(-1px) + faint slate shadow + orange accent thickens
   from 1→2px (where present). applied on .btn, .pa, .principle,
   .model, .pillar, .nav-link, .info-row dd a. */
.btn,
.btn-ghost,
.pa,
.principle,
.pillar {
  transition:
    transform 180ms cubic-bezier(.22,.61,.36,1),
    box-shadow 180ms cubic-bezier(.22,.61,.36,1),
    background 180ms,
    border-color 180ms,
    color 180ms !important;
}

.btn:hover,
.btn-ghost:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(48, 58, 58, 0.12);
}

.pa { position: relative; }
.pa::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 1px;
  background: var(--orange);
  transition: width 220ms cubic-bezier(.22,.61,.36,1);
}
.pa:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(48, 58, 58, 0.08);
  z-index: 2;
}
.pa:hover::after { width: 100%; }

.principle { position: relative; }
.principle::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 1px;
  background: var(--orange);
  transition: width 220ms cubic-bezier(.22,.61,.36,1);
}
.principle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(48, 58, 58, 0.08);
  background: var(--cream);
  z-index: 2;
}
.principle:hover::after { width: 100%; }

.pillar { position: relative; }
.pillar::after {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 1px;
  background: var(--orange);
  transition: width 220ms cubic-bezier(.22,.61,.36,1);
}
.pillar:hover::after { width: 100%; }

/* nav rail tick widens on hover */
.rail .nav-link {
  transition: border-color 180ms, background 180ms, color 180ms, padding-left 180ms !important;
}

/* form info anchor underline thickens */
.info-row dd a {
  transition: color 160ms, border-bottom-width 160ms, padding-bottom 160ms !important;
}
.info-row dd a:hover {
  border-bottom-width: 2px;
}

/* contact-info sidebar (homepage variant) */
.contact-info dd a {
  transition: color 160ms, border-bottom 160ms !important;
}

/* ─── 7. slate section variant + dot grid ─────────────────────
   .section-slate inverts the section to slate ground with a
   very faint cream dot-grid. the section-numbering tick switches
   to cream so the spine stays visible. */
section.section-slate {
  background: var(--slate);
  color: var(--cream);
  border-bottom: 1px solid rgba(234, 229, 218, 0.08);
  position: relative;
}
section.section-slate::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background-image: radial-gradient(
    rgba(234, 229, 218, 0.06) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  background-position: 12px 12px;
}
section.section-slate > * { position: relative; z-index: 1; }

section.section-slate h1,
section.section-slate h2,
section.section-slate h3,
section.section-slate h4 { color: var(--cream); font-weight: 300; }
section.section-slate p,
section.section-slate .lede { color: rgba(234, 229, 218, 0.78); }
section.section-slate .eyebrow { color: rgba(234, 229, 218, 0.55); }
section.section-slate .sec-num { border-top-color: var(--orange); color: var(--orange); }
section.section-slate .sec-num .of { color: rgba(234, 229, 218, 0.4); }

/* slate-section illus block — flip card to slate */
section.section-slate .illus-block {
  background: rgba(234, 229, 218, 0.04);
  border-color: rgba(234, 229, 218, 0.16);
}
section.section-slate .illus-block svg path[fill="#EAE5DA"] {
  fill: var(--slate);
}
section.section-slate .illus-block svg path[stroke="#303A3A"][fill="#EAE5DA"] {
  fill: rgba(234, 229, 218, 0.04);
  stroke: rgba(234, 229, 218, 0.55);
}
section.section-slate .illus-block svg circle[fill="#EAE5DA"] {
  fill: var(--slate);
}
section.section-slate .illus-block svg line[stroke="#303A3A"] {
  stroke: rgba(234, 229, 218, 0.35);
}
section.section-slate .illus-caption { color: rgba(234, 229, 218, 0.6); }

/* slate-section principle / pa / model card surfaces */
section.section-slate .principle,
section.section-slate .pa,
section.section-slate .model,
section.section-slate .pillar {
  border-color: rgba(234, 229, 218, 0.12);
  color: rgba(234, 229, 218, 0.85);
}
section.section-slate .principle h4,
section.section-slate .pa h4,
section.section-slate .model h3,
section.section-slate .pillar h4 { color: var(--cream); }
section.section-slate .principle p,
section.section-slate .pa p,
section.section-slate .model p,
section.section-slate .pillar p { color: rgba(234, 229, 218, 0.66); }
section.section-slate .principle:hover,
section.section-slate .pa:hover,
section.section-slate .pillar:hover { background: rgba(234, 229, 218, 0.04); }

section.section-slate .principles,
section.section-slate .practice {
  border-top-color: rgba(234, 229, 218, 0.16);
  border-left-color: rgba(234, 229, 218, 0.16);
}

/* slate-section model card overrides — defeat inline last-child fill
   and lift the list-item type off the dark ground */
section.section-slate .models { border-color: rgba(234, 229, 218, 0.16); }
section.section-slate .model { border-right-color: rgba(234, 229, 218, 0.16); }
section.section-slate .model:last-child { background: transparent; }
section.section-slate .model ul {
  border-top-color: rgba(234, 229, 218, 0.16);
}
section.section-slate .model ul li {
  color: rgba(234, 229, 218, 0.78);
  border-bottom-color: rgba(234, 229, 218, 0.1);
}
section.section-slate .model .m-sub { color: rgba(234, 229, 218, 0.5); }

/* ─── 8. cream-dark section variant ────────────────────────────
   alternate the second section of each page to cream-dark for
   tonal rhythm. */
section.section-cream-dark { background: var(--cream-dark); }

/* ─── 9. cream-dark form section + slate hero option ──────────
   contact page: hero illustration + h1 sit on slate band, while
   the form section keeps cream so inputs read clearly. */
section.section-slate .hero-illus {
  background: rgba(234, 229, 218, 0.04);
  border-color: rgba(234, 229, 218, 0.18);
}
section.section-slate .hero-illus svg path[fill="#EAE5DA"] { fill: var(--slate); }
section.section-slate .hero-illus svg path[stroke="#303A3A"][fill="#EAE5DA"] {
  fill: rgba(234, 229, 218, 0.04);
  stroke: rgba(234, 229, 218, 0.55);
}
section.section-slate .hero-illus svg rect[fill="#EAE5DA"] {
  fill: rgba(234, 229, 218, 0.04);
  stroke: rgba(234, 229, 218, 0.55);
}
section.section-slate .hero-illus svg circle[fill="#EAE5DA"] { fill: var(--slate); }
section.section-slate .hero-illus svg line[stroke="#303A3A"] { stroke: rgba(234, 229, 218, 0.35); }

/* ─── 10. comparison-table on slate section ───────────────────
   keep the table itself on cream so the data stays legible —
   only the outer section is slate. */
section.section-slate .compare {
  background: var(--cream);
  color: var(--slate);
  border-color: rgba(234, 229, 218, 0.16);
}
section.section-slate .compare tbody th { color: var(--muted); }
section.section-slate .compare tbody td { color: var(--slate-light); }

/* ─── 11. column line on slate section ─────────────────────────
   the page::before spine is hairline-on-cream by default; needs
   to fade to a cream-on-slate hairline within slate sections. */
section.section-slate { /* no-op; spine is on .page, see JS for masked variant if needed */ }

/* ─── 12. mobile pass — phone-tier overrides ──────────────────
   the per-page 960px breakpoints handle tablet collapse (rail
   becomes a topbar, multi-column grids become single column).
   below 640 we have a real phone: tighten gutters, kill the
   spine, stack the section-number above its heading, drop hero
   illustration whitespace, stack ctas, stack info-rows, and pull
   hero type back so 7-word lines don't wrap mid-word. these are
   shared across every page via this stylesheet. */

@media (max-width: 640px) {
  :root {
    --gutter: 20px;
  }

  /* spine line — was at calc(var(--gutter) + 16px). on a 360px
     phone with 20px gutters that's a 36px column gutter eating
     real estate. hide it and let the section numbers carry the
     vertical rhythm on their own. */
  .page::before { display: none; }

  /* frame: tighten side padding so headlines have room */
  .frame {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
  footer {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }

  /* section-num spine: stack the 01/05 marker ABOVE the heading
     instead of beside it, so the headline gets full width. the
     marker becomes a short orange-rule chip — preserves the same
     visual signal in less space. */
  .sec-grid {
    grid-template-columns: 1fr !important;
    column-gap: 0;
    row-gap: 18px;
  }
  .sec-num {
    border-top: none;
    padding-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: max-content;
  }
  .sec-num::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 2px;
    background: var(--orange);
  }

  /* hero — pull the headline tighter so it doesn't run wide */
  .hero h1 {
    font-size: clamp(2.4rem, 9vw, 3.2rem) !important;
    max-width: none !important;
    letter-spacing: -0.02em;
  }
  .hero .lede {
    font-size: 1.05rem;
    margin-top: 22px;
  }

  /* hero CTA row — stack buttons full-width, ghost link left-aligned */
  .cta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .cta-row .btn,
  .cta-row .btn-ghost {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  /* hero illustration — reduce padding so SVG can breathe */
  .hero-vis,
  .hero-illus {
    margin-top: 36px;
    padding: 14px 14px 10px;
  }
  .hero-vis svg,
  .hero-illus svg {
    max-height: 280px;
  }
  .illus-block {
    padding: 14px 14px 10px;
  }
  .illus-block svg {
    max-height: 240px;
  }

  /* section vertical rhythm */
  section {
    padding: 48px 0 56px;
  }
  .hero {
    padding: 40px 0 48px !important;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem !important; line-height: 1.12; }
  h3 { font-size: 1.2rem; }

  /* body copy: kill max-widths that fight the narrow viewport */
  p, .lede {
    max-width: none !important;
  }

  /* ─── per-page grid collapse, tightened to 1col ─── */
  /* services: industries 4→2 by default, then 2→1 here */
  .industries { grid-template-columns: 1fr !important; }
  .industries .industry {
    border-right: none !important;
    border-bottom: 1px solid var(--hairline-faint);
  }
  .industries .industry:last-child { border-bottom: none; }

  /* contact: info rows label-above-value */
  .info-row {
    grid-template-columns: 1fr !important;
    row-gap: 6px;
    padding: 14px 0;
  }

  /* form fields full-width (already 1col at 960; tighten padding) */
  .form-side,
  .info-side {
    padding: 24px 20px !important;
  }
  .field input,
  .field textarea,
  .field select {
    font-size: 16px; /* prevent iOS zoom on focus */
  }

  /* about: attorney cards, affiliations, brand cards */
  .attorney {
    padding: 24px 20px 28px !important;
  }
  .affil {
    grid-template-columns: 1fr !important;
  }
  .affil .affil-body {
    padding: 24px 20px !important;
  }
  .brand-card {
    padding: 24px 20px 28px !important;
  }

  /* models / pa cards / pillars / principles — tighten padding */
  .model { padding: 24px 20px 28px !important; }
  .pa { padding: 22px 20px 26px !important; min-height: 0 !important; }
  .pillar { padding: 22px 20px 26px !important; }
  .principle { padding: 24px 20px 28px !important; }

  /* team teaser */
  .team-teaser .tt-head { padding: 24px 20px !important; }
  .team-teaser .tt-person { padding: 24px 20px !important; }

  /* contact info sidebar (homepage variant) */
  .contact-info {
    padding: 28px 20px !important;
  }

  /* tail CTA row */
  .tail-cta {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 16px;
  }

  /* footer: stack columns */
  footer .foot {
    flex-direction: column;
    gap: 18px;
    align-items: flex-start;
  }
  footer .foot-r {
    gap: 18px 22px;
  }

  /* nav rail tabs: allow horizontal scroll if too many */
  .rail nav {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .rail nav::-webkit-scrollbar { display: none; }
  .rail .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* comparison table — already pivots at 960; ensure tight padding */
  .compare tbody tr { padding: 14px 16px !important; }

  /* slate-section dot grid — finer on phone so it doesn't read striped */
  section.section-slate::before {
    background-size: 18px 18px;
  }

  /* page-level horizontal-overflow guard */
  body, html {
    overflow-x: hidden;
  }
}

/* ─── ultra-narrow (≤380px) — iPhone SE, older Android ─── */
@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .hero h1 {
    font-size: clamp(2rem, 10vw, 2.6rem) !important;
  }
  h2 { font-size: 1.4rem !important; }
  .eyebrow { font-size: 9.5px !important; letter-spacing: 0.18em !important; }
}

/* ─── 13. reduced-motion ───────────────────────────────────────
   strip all transitions and reveals when user prefers less. */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-up, .reveal-fade {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .illus-block[data-illus] svg circle,
  .illus-block[data-illus] svg rect[fill="#F04A2C"],
  .hero-vis[data-illus] svg circle,
  .hero-vis[data-illus] svg rect[fill="#F04A2C"],
  .hero-illus[data-illus] svg circle,
  .hero-illus[data-illus] svg rect[fill="#F04A2C"] { opacity: 1 !important; }
  [data-parallax] { transform: none !important; }
  .btn:hover, .btn-ghost:hover, .pa:hover, .principle:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  * { transition: none !important; animation: none !important; }
}
