/* ================================================================
   STONEWOOD ADVISORS — Main Stylesheet
   ================================================================
   Sections:
     1.  Tokens
     2.  Reset & Base
     3.  Accessibility
     4.  Layout & Shared
     5.  Buttons
     6.  Header & Nav
     7.  Hero
     8.  Services
     9.  Philosophy
    10.  Approach
    11.  Who We Serve
    12.  Contact
    13.  Footer
    14.  Reveal Animations & Reduced Motion
   ================================================================ */


/* ── 1. Tokens ────────────────────────────────────────────────── */

:root {
  --bg:        #161615;
  --bg2:       #1d1c1a;
  --bg3:       #24231f;
  --text:      #ebe6dc;
  --muted:     #b7b0a3;
  --dim:       #8f887b;
  --stone:     #b3a58c;          /* brass/stone accent */
  --stone-ink: #161615;

  --line:        rgba(179, 165, 140, 0.14);
  --line-strong: rgba(179, 165, 140, 0.30);

  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans:  "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --space-xs: clamp(0.5rem, 0.9vw, 0.75rem);
  --space-s:  clamp(0.875rem, 1.4vw, 1.25rem);
  --space-m:  clamp(1.5rem, 2.8vw, 2.25rem);
  --space-l:  clamp(2.5rem, 5vw, 4rem);
  --space-xl: clamp(4.5rem, 9vw, 8rem);

  --container-max: 1180px;
  --container-pad: clamp(1rem, 5vw, 2.5rem);
  --header-h: 72px;

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.2s ease;
  --t-base: 0.35s ease;
}


/* ── 2. Reset & Base ──────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.3vw + 0.92rem, 1.0625rem);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
em { font-style: italic; }


/* ── 3. Accessibility ─────────────────────────────────────────── */

:focus-visible { outline: 2px solid var(--stone); outline-offset: 4px; }

.skip-link {
  position: absolute; top: -200%; left: 1rem; z-index: 9999;
  padding: 0.55em 1.2em;
  background: var(--stone); color: var(--stone-ink);
  font-size: 0.875rem; font-weight: 500;
}
.skip-link:focus { top: 0.75rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}


/* ── 4. Layout & Shared ───────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section { padding-block: var(--space-xl); }
.section-alt {
  background: var(--bg2);
  border-block: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.9em;
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--stone);
  margin-bottom: var(--space-s);
}
.eyebrow::before {
  content: ''; width: 28px; height: 1px; background: currentColor; opacity: 0.6;
}

.section-head { max-width: 720px; margin-bottom: var(--space-l); }

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.005em;
  color: var(--text);
  text-wrap: balance;
}


/* ── 5. Buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  padding: 1.05em 2em;
  font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid transparent;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.btn-primary { background: var(--stone); color: var(--stone-ink); border-color: var(--stone); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--text); border-color: var(--text); }

.btn-ghost { color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--stone); color: var(--stone); }

.btn-block { width: 100%; margin-top: var(--space-s); }


/* ── 6. Header & Nav ──────────────────────────────────────────── */

.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  border-bottom: 1px solid transparent;
  transition: background var(--t-base), border-color var(--t-base);
}

.site-header.scrolled,
.site-header.nav-open {
  background: rgba(22, 22, 21, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; }

.logo { display: inline-flex; align-items: center; gap: 0.75rem; }
.logo-mark { width: 34px; height: 34px; color: var(--stone); flex-shrink: 0; }
.logo-text {
  font-family: var(--serif);
  font-size: 1.25rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  line-height: 1;
}
.logo-text span { color: var(--muted); font-weight: 400; }

.site-nav { display: flex; align-items: center; gap: clamp(1.25rem, 2.5vw, 2.25rem); }
.site-nav a {
  font-size: 0.8125rem; font-weight: 400;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  transition: color var(--t-fast);
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--text); }
.site-nav .nav-cta {
  padding: 0.6em 1.3em;
  border: 1px solid var(--line-strong);
  color: var(--text);
}
.site-nav .nav-cta:hover { border-color: var(--stone); color: var(--stone); }

.nav-toggle { display: none; width: 44px; height: 44px; position: relative; }
.nav-toggle-bar {
  position: absolute; left: 11px; right: 11px; height: 1px; background: var(--text);
  transition: transform var(--t-fast), top var(--t-fast);
}
.nav-toggle-bar:nth-child(2) { top: 18px; }
.nav-toggle-bar:nth-child(3) { top: 26px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { top: 22px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { top: 22px; transform: rotate(-45deg); }

@media (max-width: 760px) {
  .logo-text { font-size: 1.05rem; }
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.5rem var(--container-pad) 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  }
  .site-header.nav-open .site-nav { opacity: 1; visibility: visible; transform: none; }
  .site-nav a { padding: 1rem 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
  .site-nav .nav-cta { margin-top: 1rem; text-align: center; border: 1px solid var(--stone); color: var(--stone); }
}


/* ── 7. Hero ──────────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: calc(var(--header-h) + var(--space-l));
  padding-bottom: var(--space-m);
  overflow: hidden;
}

.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 70% at 78% 45%, rgba(179, 165, 140, 0.09) 0%, transparent 60%),
    radial-gradient(ellipse 110% 50% at 50% 100%, rgba(0, 0, 0, 0.45) 0%, transparent 60%);
}

.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero > .container { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-l);
  flex: 1;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5.4vw, 4.6rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.hero-title em { color: var(--stone); }

.hero-lede {
  max-width: 560px;
  margin-top: var(--space-m);
  font-size: clamp(1.0625rem, 1.2vw, 1.1875rem);
  color: var(--muted);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.875rem; margin-top: var(--space-l); }

.hero-mark { display: flex; justify-content: center; }
.hero-seal {
  width: min(100%, 380px); aspect-ratio: 1;
  color: var(--stone); opacity: 0.85;
  filter: drop-shadow(0 0 60px rgba(179, 165, 140, 0.18));
}

.hero-pillars {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: var(--space-xl);
  border-top: 1px solid var(--line);
}
.hero-pillars li {
  padding: 1.25rem 0;
  font-family: var(--serif); font-size: 1.25rem; color: var(--text);
}
.hero-pillars li + li { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.hero-pillars span {
  font-family: var(--sans); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.12em; color: var(--stone); margin-right: 0.75rem;
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-mark { order: -1; justify-content: flex-start; }
  .hero-seal { width: 88px; }
  .hero .eyebrow { letter-spacing: 0.16em; font-size: 0.6875rem; }
  .hero-pillars { grid-template-columns: 1fr; margin-top: var(--space-l); }
  .hero-pillars li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .hero-pillars li { padding: 0.9rem 0; font-size: 1.125rem; }
}


/* ── 8. Services ──────────────────────────────────────────────── */

.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line);
}

.service {
  background: var(--bg2);
  padding: clamp(1.75rem, 3vw, 2.75rem);
  display: flex; flex-direction: column;
  transition: background var(--t-base);
}
.service:hover { background: var(--bg3); }

.service-num {
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em;
  color: var(--stone);
}
.service-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.3vw, 2rem);
  font-weight: 500; line-height: 1.15;
  margin: 1.5rem 0 0.75rem;
}
.service-body { color: var(--muted); }

.service-list {
  margin-top: var(--space-m); padding-top: var(--space-s);
  border-top: 1px solid var(--line);
  display: grid; gap: 0.55rem;
}
.service-list li {
  position: relative; padding-left: 1.25rem;
  font-size: 0.9375rem; color: var(--text);
}
.service-list li::before {
  content: ''; position: absolute; left: 0; top: 0.75em;
  width: 8px; height: 1px; background: var(--stone);
}

@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; }
}


/* ── 8b. Fractional CFO ───────────────────────────────────────── */

.cfo-intro {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-l); align-items: end;
  margin-bottom: var(--space-l);
}
.cfo-intro .section-head { margin-bottom: 0; }
.cfo-lede { color: var(--muted); font-size: clamp(1.0625rem, 1.2vw, 1.1875rem); }

.subhead {
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--dim);
  margin-bottom: var(--space-s);
}

.cfo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line);
}
.cfo-area {
  background: var(--bg);
  padding: clamp(1.5rem, 2.6vw, 2.25rem);
  transition: background var(--t-base);
}
.cfo-area:hover { background: var(--bg3); }
.cfo-title {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2vw, 1.7rem);
  font-weight: 500; line-height: 1.15;
  margin-top: 1rem;
}
.cfo-area .service-list { margin-top: var(--space-s); }

.cfo-bottom {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-l);
  margin-top: var(--space-xl);
}

.signal-list { border-top: 1px solid var(--line); }
.signal-list li {
  position: relative;
  padding: 0.95rem 0 0.95rem 2rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.signal-list li::before {
  content: ''; position: absolute; left: 0.2rem; top: 1.55rem;
  width: 7px; height: 7px; background: var(--stone); transform: rotate(45deg);
}

.cfo-models { display: grid; gap: 1rem; align-content: start; }
.cfo-models .subhead { margin-bottom: 0; }
.model {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--stone);
  background: var(--bg);
}
.model-title {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 500;
  line-height: 1.2; margin-bottom: 0.25rem;
}
.model p { color: var(--muted); font-size: 0.9688rem; }

@media (max-width: 960px) {
  .cfo-grid { grid-template-columns: repeat(2, 1fr); }
  .cfo-intro, .cfo-bottom { grid-template-columns: 1fr; }
  .cfo-intro { gap: var(--space-s); }
}
@media (max-width: 600px) {
  .cfo-grid { grid-template-columns: 1fr; }
}


/* ── 9. Philosophy ────────────────────────────────────────────── */

.philosophy-grid {
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: var(--space-l); align-items: start;
}
.section-head-left { margin-bottom: 0; position: sticky; top: calc(var(--header-h) + 2rem); }

.principle {
  display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem;
  padding-block: var(--space-m);
  border-top: 1px solid var(--line);
}
.principle:last-child { border-bottom: 1px solid var(--line); }

.principle-num {
  font-family: var(--serif); font-size: 1.125rem; font-weight: 500;
  color: var(--stone); padding-top: 0.35rem;
}
.principle-quote {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.2; color: var(--text);
}
.principle-note { margin-top: 0.6rem; color: var(--muted); max-width: 520px; }

@media (max-width: 860px) {
  .philosophy-grid { grid-template-columns: 1fr; }
  .section-head-left { position: static; }
  .principle { grid-template-columns: 2.5rem 1fr; }
}


/* ── 10. Approach ─────────────────────────────────────────────── */

.steps {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-m);
  counter-reset: step;
}

.step { position: relative; padding-top: 1.75rem; border-top: 1px solid var(--line-strong); }
.step::before {
  content: ''; position: absolute; top: -4px; left: 0;
  width: 7px; height: 7px; background: var(--stone); transform: rotate(45deg);
}
.step-num {
  display: block; font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.14em; color: var(--stone);
}
.step-title {
  font-family: var(--serif); font-size: 1.6rem; font-weight: 500;
  margin: 0.5rem 0 0.6rem;
}
.step p { color: var(--muted); font-size: 0.9688rem; }

@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); row-gap: var(--space-l); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }


/* ── 11. Who We Serve ─────────────────────────────────────────── */

.clients-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
}
.client {
  padding: var(--space-m) var(--space-m) var(--space-m) 0;
  border-bottom: 1px solid var(--line);
}
.client:nth-child(even) { padding-left: var(--space-m); border-left: 1px solid var(--line); }
.client-title {
  font-family: var(--serif); font-size: clamp(1.4rem, 2vw, 1.75rem);
  font-weight: 500; margin-bottom: 0.4rem;
}
.client p { color: var(--muted); max-width: 440px; }

@media (max-width: 700px) {
  .clients-grid { grid-template-columns: 1fr; }
  .client, .client:nth-child(even) { padding-inline: 0; border-left: 0; }
}


/* ── 12. Contact ──────────────────────────────────────────────── */

.section-contact {
  background:
    radial-gradient(ellipse 70% 90% at 0% 100%, rgba(179, 165, 140, 0.08) 0%, transparent 60%),
    var(--bg);
  border-top: 1px solid var(--line);
}

.contact-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-l); align-items: center;
}

.contact-title {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.2vw, 3.5rem);
  font-weight: 400; line-height: 1.08;
  text-wrap: balance;
}
.contact-lede { margin-top: var(--space-s); color: var(--muted); max-width: 520px; }

.contact-card {
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.contact-row {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}
.contact-row:first-child { padding-top: 0; }
.contact-label {
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim);
}
.contact-value {
  font-family: var(--serif); font-size: 1.375rem; color: var(--text);
  overflow-wrap: anywhere;
  transition: color var(--t-fast);
}
a.contact-row:hover .contact-value, a.contact-row:focus-visible .contact-value { color: var(--stone); }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}


/* ── 13. Footer ───────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-l);
}
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-m);
}
.logo-footer .logo-mark { width: 28px; height: 28px; }
.logo-footer .logo-text { font-size: 1rem; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-nav a {
  font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); transition: color var(--t-fast);
}
.footer-nav a:hover { color: var(--text); }

.footer-legal { width: 100%; font-size: 0.8125rem; color: var(--dim); }


/* ── 14. Reveal Animations & Reduced Motion ──────────────────── */

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0; transform: translateY(18px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
    transition-delay: var(--delay, 0s);
  }
  .reveal.visible { opacity: 1; transform: none; }

  .hero-copy > * { animation: rise 0.9s var(--ease-out) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.08s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.16s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.24s; }
  .hero-seal { animation: fade 1.4s var(--ease-out) 0.2s both; }
}

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 0.85; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
