/* ============================================================
   Quantic Wealth — boutique wealth practice, warm editorial theme
   Light ivory canvas, deep warm ink, muted antique gold.
   Editorial restraint over product/SaaS signals.
   ============================================================ */

:root {
  /* Warm editorial palette */
  --paper: #F5F1E8;        /* warm ivory canvas */
  --surface: #FFFFFF;      /* cards / raised */
  --surface-2: #FBF8F1;    /* alternating sections */
  --ink: #1A1712;          /* deep warm near-black — headings */
  --ink-soft: #4C4638;     /* body text */
  --ink-muted: #8B8474;    /* muted / captions */
  --line: #E5DECF;         /* hairline rules & borders */
  --line-strong: #D8CFBB;
  --accent: #9A7B38;       /* antique gold */
  --accent-hover: #7E6229;
  --accent-soft: #EFE7D2;  /* soft gold tint */
  --deep: #17140F;         /* dark grounding band (footer) */
  --deep-soft: #E9E3D5;    /* text on dark band */
  --deep-muted: #A79E8A;

  --font-body: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;

  --wrap: 1140px;
  --measure: 62ch;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--paper);
  /* subtle fine-paper grain for editorial depth */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 0 0 6px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* Shared editorial motifs -------------------------------------------------- */
.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
.accent { color: var(--accent); }
.serif { font-family: var(--font-display); }

/* short gold rule used above/below headings */
.rule {
  width: 44px; height: 1px;
  background: var(--accent);
  border: 0; margin: 0 0 1.6rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  padding: 0.72rem 1.4rem;
  border-radius: 2px;                 /* squared, editorial — not pill/SaaS */
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #000; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-hover); }

.btn-lg { padding: 0.9rem 1.7rem; font-size: 0.98rem; }

/* text link with gold underline on hover */
.link-underline { color: var(--accent-hover); }
.link-underline:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(120%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 74px; }

.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 600; letter-spacing: 0;
}
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-word-soft { color: var(--accent); margin-left: 0.2em; }

.site-nav { display: flex; gap: 2rem; margin-left: auto; font-size: 0.92rem; }
.site-nav a { color: var(--ink-soft); transition: color 0.2s var(--ease); }
.site-nav a:hover { color: var(--accent-hover); }

.header-cta { display: flex; gap: 0.7rem; align-items: center; }

.nav-toggle {
  display: none; margin-left: auto; flex-direction: column; gap: 5px;
  background: none; border: 0; padding: 8px; cursor: pointer;
}
.nav-toggle span { width: 24px; height: 1.5px; background: var(--ink); transition: transform 0.25s var(--ease), opacity 0.25s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav[hidden] { display: none; }
.mobile-nav {
  display: flex; flex-direction: column; gap: 0.4rem;
  padding: 1rem clamp(1.25rem, 5vw, 2.5rem) 1.6rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.mobile-nav a:not(.btn) { padding: 0.65rem 0; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.mobile-nav .btn { margin-top: 0.5rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100svh - 74px);   /* fill the first screen below the header */
  display: flex;
  align-items: flex-start;
  padding-block: clamp(2rem, 7svh, 4rem) clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
}
/* warm depth so the ivory canvas isn't flat */
.hero::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(58% 55% at 84% 20%, rgba(154,123,56,0.11), transparent 70%),
    radial-gradient(44% 42% at 6% 96%, rgba(154,123,56,0.06), transparent 72%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1.22fr 0.78fr;
  gap: clamp(1.5rem, 4vw, 3.25rem);
  align-items: center;
  width: 100%;
}
.hero-text { max-width: 40rem; }
.hero-title {
  font-size: clamp(2.2rem, 3.7vw, 3.3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.3rem;
  text-wrap: balance;
}
.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.5vw, 1.24rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 44ch;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero-note { margin-top: 1.8rem; font-size: 0.88rem; color: var(--ink-muted); letter-spacing: 0.01em; }

/* elegant gold ring motif + soft glow */
.hero-figure { position: relative; display: grid; place-items: center; }
.hero-figure::before {
  content: ""; position: absolute; width: 76%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(154,123,56,0.16), transparent 66%);
}
.hero-figure svg { position: relative; width: 100%; max-width: 440px; height: auto; display: block; }

@media (max-width: 940px) {
  .hero { min-height: 0; padding-block: clamp(2.5rem, 9vw, 4.5rem); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-text { max-width: none; }
  .hero-figure { display: none; }
}

/* ---------- Principles row (replaces stat tiles) ---------- */
.principles { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.principles-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}
.principle { }
.principle .p-label {
  display: block;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--accent); font-weight: 600; margin-bottom: 0.7rem;
  padding-top: 0.9rem; border-top: 1px solid var(--line-strong);
}
.principle p { margin: 0; font-family: var(--font-display); font-size: 1.08rem; color: var(--ink); line-height: 1.4; }

/* ---------- Generic section ----------
   Each content section fills one screen, content vertically centred,
   leaving free space at the top and bottom. */
.section {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;   /* content sits near the top; free space falls to the bottom */
  padding-top: clamp(5rem, 14svh, 9rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  scroll-margin-top: 0;
}
.section > .wrap { width: 100%; }
.section-alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: clamp(2.4rem, 5vw, 3.8rem); }
.section-head h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
.section-lede { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink-soft); line-height: 1.5; }

/* ---------- Practice cards (editorial, numbered, no glyphs) ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 2.4rem); }
.card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 1.6rem 0 0;
}
.card .card-num {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem; font-weight: 600; letter-spacing: 0.18em;
  color: var(--accent); margin-bottom: 1.1rem;
}
.card h3 { font-size: 1.5rem; margin-bottom: 0.6rem; }
.card p { margin: 0; color: var(--ink-soft); }

/* ---------- Perspectives (editorial notes, replaces funds) ---------- */
.perspectives { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 2.2rem); }
.perspectives-loading, .perspectives-error {
  grid-column: 1 / -1; padding: 2rem 0; color: var(--ink-muted);
}
.insight-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1.8rem;
  display: flex; flex-direction: column; gap: 0.7rem;
  transition: border-color 0.25s var(--ease);
}
.insight-card:hover { border-color: var(--line-strong); }
.insight-topic {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--accent); font-weight: 600;
}
.insight-title { font-family: var(--font-display); font-size: 1.28rem; color: var(--ink); line-height: 1.25; }
.insight-excerpt { color: var(--ink-soft); font-size: 0.98rem; margin: 0; }
.insight-meta { margin-top: auto; padding-top: 0.6rem; font-size: 0.82rem; color: var(--ink-muted); }
.perspectives-note { margin-top: 1.8rem; font-size: 0.85rem; color: var(--ink-muted); font-style: italic; font-family: var(--font-display); }

/* ---------- Approach (full-width header + two aligned columns) ---------- */
.approach-head { max-width: none; margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem); }
.approach-head h2 { font-size: clamp(1.7rem, 2.9vw, 2.2rem); }
.approach-head .section-lede { max-width: 74ch; }
.approach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2.5rem, 6vw, 4.5rem); align-items: start; }
.col-label {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.68rem;
  font-weight: 600; color: var(--accent); margin: 0 0 0.4rem;
}

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  position: relative; padding: 0.95rem 0 0.95rem 1.4rem; color: var(--ink-soft);
  border-top: 1px solid var(--line);
}
.check-list li:last-child { border-bottom: 1px solid var(--line); }
.check-list li::before { content: ""; position: absolute; left: 0; top: 1.28rem; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.check-list strong { color: var(--ink); font-weight: 600; }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: flex; gap: 1.2rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 1px solid var(--line); }
.step-n {
  flex: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  color: var(--accent); letter-spacing: 0.1em; padding-top: 0.15rem;
  min-width: 1.9rem;
}
.steps h4 { margin: 0 0 0.25rem; font-size: 1.12rem; }
.steps p { margin: 0; font-size: 0.95rem; color: var(--ink-muted); line-height: 1.45; }

@media (max-width: 940px) {
  .approach-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* ---------- Discretion (centred closing composition) ---------- */
#discretion { justify-content: center; }   /* balanced whitespace for this sparser section */
.discretion-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2.75rem, 8vh, 5.5rem);
  text-align: center;
}
.discretion-head { max-width: 660px; margin: 0 auto; text-align: center; }
.discretion-head .rule { margin-inline: auto; }
.discretion-head h2 { font-size: clamp(2.2rem, 4.6vw, 3.2rem); }
.discretion-head .section-lede { max-width: 56ch; margin-inline: auto; }
.discretion-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  width: 100%;
  text-align: left;
}
.disc-item { border-top: 1px solid var(--line-strong); padding-top: 1.3rem; }
.disc-item h4 {
  margin: 0 0 0.45rem; font-size: 1.05rem;
  font-family: var(--font-body); font-weight: 600; letter-spacing: 0.01em; color: var(--ink);
}
.disc-item p { margin: 0; color: var(--ink-muted); font-size: 0.96rem; line-height: 1.5; }

@media (max-width: 720px) {
  .discretion-cols { grid-template-columns: 1fr; gap: 0; }
  .disc-item { padding-block: 1.1rem; }
  .disc-item:last-child { border-bottom: 1px solid var(--line-strong); }
}

/* ---------- CTA band (dark grounding) ---------- */
.cta-band { padding: clamp(4rem, 9vw, 7rem) 0; background: var(--deep); color: var(--deep-soft); text-align: center; }
.cta-inner { max-width: 640px; margin-inline: auto; }
.cta-band .rule { margin-inline: auto; }
.cta-band h2 { color: #F3EFE4; font-size: clamp(2rem, 4.5vw, 3.1rem); }
.cta-band p { color: var(--deep-muted); margin-bottom: 2rem; font-family: var(--font-display); font-size: 1.15rem; }
.cta-band .hero-actions { justify-content: center; }
.cta-band .btn-primary { background: var(--accent); color: #17140F; }
.cta-band .btn-primary:hover { background: var(--accent-hover); color: #fff; }
.cta-band .btn-ghost { color: #F3EFE4; border-color: rgba(233,227,213,0.35); }
.cta-band .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { background: var(--deep); color: var(--deep-soft); border-top: 1px solid rgba(233,227,213,0.12); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2.5rem; padding-block: clamp(3rem, 6vw, 4rem); }
.footer-brand { max-width: 320px; }
.footer-brand .brand-word { font-family: var(--font-display); font-size: 1.3rem; color: #F3EFE4; }
.footer-brand .brand-word-soft { color: var(--accent); }
.footer-brand p { margin: 0.7rem 0 0; color: var(--deep-muted); font-size: 0.95rem; font-family: var(--font-display); }
.footer-links { display: flex; gap: 3.5rem; }
.footer-links h5 { font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.7rem; color: var(--deep-muted); margin: 0 0 1rem; font-weight: 600; }
.footer-links a { display: block; color: var(--deep-soft); padding: 0.28rem 0; font-size: 0.92rem; }
.footer-links a:hover { color: var(--accent); }
.footer-legal { border-top: 1px solid rgba(233,227,213,0.12); padding-block: 1.6rem 2.2rem; color: var(--deep-muted); font-size: 0.8rem; }
.footer-legal p { margin: 0 0 0.4rem; }
.footer-legal .disclaimer { max-width: 78ch; line-height: 1.6; }

.footer-link-btn {
  display: block; background: none; border: 0; padding: 0.28rem 0; margin: 0;
  font: inherit; font-size: 0.92rem; color: var(--deep-soft); cursor: pointer; text-align: left;
}
.footer-link-btn:hover { color: var(--accent); }

/* ---------- Scroll reveal (subtle) ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ============================================================
   Request-an-introduction modal
   ============================================================ */
.btn-block { width: 100%; margin-top: 0.5rem; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.2rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(23,20,15,0.55); backdrop-filter: blur(3px); animation: fade 0.2s var(--ease); }
.modal-card {
  position: relative; width: 100%; max-width: 460px;
  max-height: calc(100vh - 2.4rem); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 3px;
  box-shadow: 0 30px 70px -30px rgba(23,20,15,0.4);
  padding: clamp(1.7rem, 4vw, 2.5rem);
  animation: pop 0.24s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal-backdrop, .modal-card { animation: none; } }

.modal-close {
  position: absolute; top: 0.8rem; right: 1rem; width: 34px; height: 34px;
  display: grid; place-items: center; background: none; border: 0;
  color: var(--ink-muted); font-size: 1.5rem; line-height: 1; cursor: pointer; border-radius: 4px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.modal-close:hover { color: var(--ink); background: var(--surface-2); }

.modal-card .eyebrow { margin-bottom: 0.7rem; }
.modal-card h2 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.modal-lede { color: var(--ink-muted); font-size: 0.98rem; margin-bottom: 1.5rem; font-family: var(--font-display); }

.field { margin-bottom: 1.05rem; }
.field label { display: block; font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 0.4rem; font-weight: 500; letter-spacing: 0.02em; }
.field input {
  width: 100%; padding: 0.72rem 0.85rem;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 2px;
  color: var(--ink); font: inherit; font-size: 0.98rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.field input::placeholder { color: var(--ink-muted); }
.field input:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[aria-invalid="true"] { border-color: #a8443b; }

.mobile-input {
  display: flex; align-items: stretch;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 2px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.mobile-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.mobile-input .cc { display: grid; place-items: center; padding: 0 0.85rem; color: var(--ink-soft); border-right: 1px solid var(--line-strong); font-size: 0.95rem; }
.mobile-input input { border: 0; background: transparent; border-radius: 0; }
.mobile-input input:focus { box-shadow: none; }
.mobile-input.invalid { border-color: #a8443b; }

.field-error { display: block; min-height: 1em; margin-top: 0.35rem; font-size: 0.8rem; color: #a8443b; }
.form-note { margin: 1.1rem 0 0; font-size: 0.78rem; color: var(--ink-muted); line-height: 1.5; }

.modal-success { text-align: center; padding: 1rem 0.5rem 0.5rem; }
.success-mark {
  width: 54px; height: 54px; margin: 0 auto 1.1rem;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-hover); font-size: 1.5rem;
}
.modal-success h3 { font-size: 1.5rem; }
.modal-success p { color: var(--ink-soft); margin-bottom: 1.5rem; font-family: var(--font-display); }

body.modal-open { overflow: hidden; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 940px) {
  .site-nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .cards { grid-template-columns: 1fr; gap: 0; }
  .card { padding-block: 1.6rem; }
  .perspectives { grid-template-columns: 1fr; }
  .approach-grid, .security-grid { grid-template-columns: 1fr; }
  .principles-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem 2rem; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .principles-grid { grid-template-columns: 1fr; }
  .hero-actions .btn, .cta-band .btn { flex: 1 1 auto; }
  .footer-inner { flex-direction: column; gap: 2rem; }
  .footer-links { gap: 2.5rem; }
}
