/* =========================================================
   THEME OVERRIDE — Armi L. Lavy
   Load AFTER style.css. Delete this file to go back.
   Fraunces + Instrument Sans · Charcoal / Butter / Sage
   ========================================================= */

   :root {
    /* charcoal (replaces the greens) */
    --green: #232625;
    --green-deep: #181a19;
    --green-soft: #e6ebe0;          /* sage tint */
  
    /* surfaces */
    --cream: #f4f1e6;
    --paper: #faf8f1;
  
    /* butter yellow (used on dark surfaces + small accents) */
    --gold: #efd479;
  
    --ink: #1c1f1d;
    --muted: #5d6159;
    --line: #dad8c9;
  
    --sage: #9bae92;
    --sage-deep: #5b7154;           /* readable sage for text on light */
    --butter: #efd479;
    --butter-soft: #f7e8b2;
  
    --serif: "Fraunces", Georgia, serif;
    --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  }
  
  /* ---------- base type ---------- */
  body {
    font-size: 17px;
    line-height: 1.65;
    font-feature-settings: "kern", "liga";
    text-rendering: optimizeLegibility;
  }
  
  h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 400;
    font-optical-sizing: auto;
    text-wrap: balance;
  }
  
  p { text-wrap: pretty; }
  
  /* body copy was 13–14px; bring it up */
  .hero-content > p       { font-size: 18px; line-height: 1.6; max-width: 520px; }
  .intro-copy p,
  .section-description    { font-size: 17px; line-height: 1.7; max-width: 62ch; }
  
  /* ---------- headings ---------- */
  .hero h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(3rem, 8.2vw, 6.5rem);
    line-height: 1;
    letter-spacing: -0.03em;
    max-width: 11em;
  }
  
  .intro h2,
  .section-heading h2,
  .calculator-intro h2,
  .closing-cta h2,
  .newsletter-copy h2 {
    font-weight: 400;
    font-size: clamp(2.2rem, 4.6vw, 3.6rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
  }
  
  /* kill the AI-tell italic accent; use color instead */
  h1 em, h2 em, h3 em,
  .intro h2 em,
  .closing-cta h2 em,
  .newsletter-copy h2 em {
    font-style: normal;
    font-weight: 400;
    color: var(--sage-deep);
  }
  .closing-cta h2 em { color: var(--butter); }
  .newsletter-copy h2 em { color: var(--sage-deep); }
  
  /* ---------- eyebrows / labels: quieter ---------- */
  .section-kicker,
  .eyebrow,
  .collection-label,
  .product-eyebrow,
  .journal-category,
  .footer-label,
  .results-label {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;         /* was wide-tracked caps */
    color: var(--sage-deep);
  }
  .light-eyebrow { color: var(--butter); }
  
  /* ---------- accent text on LIGHT backgrounds (old gold) ---------- */
  .section-kicker,
  .journal-section-heading,
  .journal-card h3 a:hover,
  .journal-read-link:hover,
  .fallback-links span { color: var(--sage-deep); }
  
  .main-nav > a:hover { color: var(--sage-deep); }
  .line-icon,
  .contact-link svg,
  .faq-list summary::after { color: var(--sage-deep); }
  .journal-dot { background: var(--sage-deep); }
  .journal-read-link { border-bottom-color: var(--sage-deep); }
  .fallback-links > a:hover { border-color: var(--sage-deep); }
  .journal-featured:hover { border-color: var(--sage); }
  
  /* on dark footer keep butter */
  .footer-label { color: var(--butter); }
  
  /* ---------- accent on DARK surfaces ---------- */
  .slide-dot.is-active,
  .status-dot { background: var(--butter); }
  .calculator-note svg,
  .journal-art-empty { color: var(--butter); }
  .marquee-group li::after { color: var(--butter); }
  .marquee-group a { border-bottom-color: var(--butter); }
  .marquee-group a:focus-visible { color: var(--butter); }
  .button-light:hover { background: var(--butter-soft); }
  
  /* ---------- surfaces ---------- */
  .marquee { background: var(--green); color: #f1eee2; }
  
  .product-image-wrap,
  .product-image-wrap .product-cover,
  .journal-art { background: #e7e6d8; }
  
  .journal-art-empty {
    background:
      radial-gradient(circle at 30% 20%, #3b413d 0, transparent 60%),
      linear-gradient(145deg, #2a2d2b, #181a19);
  }
  .journal-image-missing { background: #2a2d2b; }
  
 /* ---------- HERO: photo mode ---------- */
.hero-overlay {
    background:
      linear-gradient(
        90deg,
        rgba(24, 26, 25, 0.88) 0%,
        rgba(24, 26, 25, 0.62) 45%,
        rgba(24, 26, 25, 0.15) 100%
      ),
      linear-gradient(0deg, rgba(0, 0, 0, 0.3), transparent 38%);
  }
  
  /* ---------- buttons ---------- */
  .button { font-weight: 600; letter-spacing: 0; }
  .button-light { background: var(--butter); color: var(--green-deep); }
  
  /* ---------- numbers (calculator, prices) ---------- */
  .results-label ~ *,
  .price,
  [class*="result"] strong,
  [class*="price"] { font-variant-numeric: tabular-nums; }
  
  /* ---------- motion: calmer ---------- */
  html { scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  }

  .main-nav .nav-cta {
    background: var(--butter);
    color: var(--green-deep);
  }
  .main-nav .nav-cta:hover {
    background: var(--butter-soft);
    color: var(--green-deep);
  }

  /* ---------- Softer butter ---------- */
:root {
    --butter: #f0dfa6;
    --butter-soft: #f7edc8;
    --gold: #f0dfa6;
  }
  
  /* ---------- Pill buttons ---------- */
  .button,
  .main-nav .nav-cta {
    border-radius: 999px;
    padding: 15px 28px;
    font-weight: 600;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
  }
  .button:hover,
  .main-nav .nav-cta:hover {
    transform: translateY(-1px);
  }
  
  .button-light {
    background: var(--paper);
    color: var(--green-deep);
  }
  .button-light:hover {
    background: var(--butter-soft);
    color: var(--green-deep);
  }
  
  .main-nav .nav-cta {
    background: var(--green);
    color: #fff;
  }
  .main-nav .nav-cta:hover {
    background: var(--butter-soft);
    color: var(--green-deep);
  }

  /* ---------- Nav links: bigger + underline draw on hover ---------- */
.main-nav > a:not(.nav-cta) {
    position: relative;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    padding: 6px 0;
  }
  
  .main-nav > a:not(.nav-cta)::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1.5px;
    background: var(--sage-deep);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
  }
  
  .main-nav > a:not(.nav-cta):hover,
  .main-nav > a:not(.nav-cta):focus-visible {
    color: var(--sage-deep);
  }
  
  .main-nav > a:not(.nav-cta):hover::after,
  .main-nav > a:not(.nav-cta):focus-visible::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  /* =========================================================
   MORE FREE TOOLS
   ========================================================= */
.tools-section { background: var(--cream); }

.tools-head { max-width: 640px; margin-bottom: clamp(28px, 3.5vw, 42px); }
.calculator-section.section-pad,
.overlap-section.section-pad,
.screener-section.section-pad,
.backtester-section.section-pad,
.tools-section.section-pad {
  padding-top: clamp(60px, 6vw, 84px);
  padding-bottom: clamp(60px, 6vw, 84px);
}
.overlap-section,
.screener-section,
.backtester-section { scroll-margin-top: 96px; }
.tools-head h2 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 4.2vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.tools-head p { color: var(--muted); font-size: 17px; margin: 0; }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 36px);
    align-items: stretch;
  }
@media (max-width: 900px) { .tools-grid { grid-template-columns: 1fr; } }

.tool-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(24px, 3.4vw, 40px);
}

.tool-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--sage-deep);
}
.tool-card h3 {
  margin: 10px 0 8px;
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.tool-sub { color: var(--muted); margin: 0 0 24px; font-size: 16px; }

.tool-card .field { margin-bottom: 18px; }

.tool-result {
  background: var(--green);
  color: #f1eee2;
  border-radius: 20px;
  padding: 24px 26px;
  margin-top: 26px;
}
.tool-result[hidden] { display: none; }
.tool-result-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--butter);
}
.tool-result-main {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 8px 0 10px;
  font-variant-numeric: tabular-nums;
}
.tool-result-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.tool-result-text { margin: 0; color: rgba(241, 238, 226, 0.82); font-size: 16px; line-height: 1.6; }

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
}
.tool-result .button-dark { background: var(--paper); color: var(--green-deep); }
.tool-result .button-dark:hover { background: var(--butter-soft); }
.tool-result .text-link {
  background: none;
  border: 0;
  color: #f1eee2;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  font-size: 15px;
}

.tool-disclaimer { margin: 18px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* checklist */
.check-item {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 16px 0;
}
.check-item legend { padding: 0; font-size: 16px; line-height: 1.5; margin-bottom: 10px; float: left; width: 100%; }
.check-options { clear: both; display: flex; flex-wrap: wrap; gap: 8px; }
.check-options label { cursor: pointer; }
.check-options input { position: absolute; opacity: 0; pointer-events: none; }
.check-options span {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.check-options label:hover span { border-color: var(--sage-deep); }
.check-options input:checked + span {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.check-options input:focus-visible + span { outline: 2px solid var(--sage-deep); outline-offset: 2px; }

.tool-progress { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* equal-height cards, disclaimer pinned to the bottom */
.tool-card {
    display: flex;
    flex-direction: column;
  }
  .tool-disclaimer {
    margin-top: auto;
    padding-top: 20px;
  }

  .tool-card .input-with-prefix,
.tool-card select {
  border-radius: 16px;
}
.tool-card .input-with-prefix input {
  background: transparent;
}

/* ---------- Safety result: reveal animation ---------- */
.tool-result.is-revealed {
    animation: resultIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  
  .tool-result.is-revealed > * {
    animation: resultChild 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .tool-result.is-revealed > :nth-child(1) { animation-delay: 0.10s; }
  .tool-result.is-revealed > :nth-child(2) { animation-delay: 0.22s; }
  .tool-result.is-revealed > :nth-child(3) { animation-delay: 0.32s; }
  .tool-result.is-revealed > :nth-child(4) { animation-delay: 0.42s; }
  .tool-result.is-revealed > :nth-child(5) { animation-delay: 0.52s; }
  
  @keyframes resultIn {
    from { opacity: 0; transform: translateY(22px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes resultChild {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  
  /* score dots */
  .pips {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
  }
  .pip {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(241, 238, 226, 0.28);
    background: transparent;
  }
  .pip.is-yes    { background: var(--butter); border-color: var(--butter); }
  .pip.is-unsure { border-color: var(--sage); background: rgba(155, 174, 146, 0.35); }
  
  .tool-result.is-revealed .pip {
    animation: pipPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: calc(0.35s + var(--i) * 0.09s);
  }
  @keyframes pipPop {
    from { opacity: 0; transform: scale(0); }
    to   { opacity: 1; transform: scale(1); }
  }

  /* =========================================================
   RHYTHM: quote band, asymmetry, glossary
   ========================================================= */

/* ---------- glossary terms + tooltip ---------- */
.gl-term {
    all: unset;
    cursor: help;
    color: inherit;
    border-bottom: 1.5px dotted var(--sage-deep);
    transition: color 0.2s ease, border-color 0.2s ease;
  }
  .gl-term:hover,
  .gl-term:focus-visible { color: var(--sage-deep); border-bottom-style: solid; }
  .gl-term:focus-visible { outline: 2px solid var(--sage-deep); outline-offset: 3px; border-radius: 3px; }
  
  .gl-tip {
    position: fixed;
    z-index: 1000;
    max-width: 320px;
    background: var(--green);
    color: #f1eee2;
    border-radius: 16px;
    padding: 16px 18px;
    font-size: 15px;
    line-height: 1.55;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    animation: tipIn 0.18s ease both;
  }
  .gl-tip[hidden] { display: none; }
  .gl-tip strong {
    display: block;
    font-family: var(--serif);
    font-weight: 400;
    font-size: 19px;
    margin-bottom: 4px;
  }
  .gl-tip span { display: block; color: rgba(241, 238, 226, 0.85); }
  .gl-tip a {
    display: inline-block;
    margin-top: 10px;
    color: var(--butter);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  @keyframes tipIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  
  /* ---------- quote band ---------- */
  .quote-band {
    position: relative;
    overflow: hidden;
    background: var(--green-deep);
    color: #f1eee2;
    padding: clamp(80px, 12vw, 160px) var(--page-pad);
  }
  .quote-band::before {
    content: "“";
    position: absolute;
    top: -0.12em;
    left: calc(var(--page-pad) - 0.05em);
    font-family: var(--serif);
    font-size: clamp(14rem, 30vw, 28rem);
    line-height: 1;
    color: var(--sage);
    opacity: 0.14;
    pointer-events: none;
  }
  .quote-inner {
    position: relative;
    max-width: var(--content-max);
    margin: 0 auto;
    display: grid;
    gap: 40px;
  }
  .quote-band blockquote { margin: 0; }
  .quote-band blockquote p {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 4.8vw, 4rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }
  .quote-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 22px;
    border-left: 2px solid var(--butter);
  }
  .quote-name { font-weight: 600; font-size: 17px; }
  .quote-role { color: rgba(241, 238, 226, 0.7); font-size: 15px; }
  
  @media (min-width: 1001px) {
    .quote-inner { grid-template-columns: 8fr 3fr; align-items: end; gap: 80px; }
    .quote-meta { margin-bottom: 0.6em; }
  }
  
  /* ---------- asymmetric intro + staggered principles (desktop only) ---------- */
  @media (min-width: 1001px) {
    .intro-grid {
      grid-template-columns: 7fr 4fr;
      gap: clamp(48px, 8vw, 120px);
      align-items: start;
    }
    .intro h2 {
      font-size: clamp(3rem, 6vw, 5.2rem);
      line-height: 1;
      letter-spacing: -0.03em;
    }
    .intro-copy {
      margin-top: clamp(60px, 9vw, 140px);
      padding-left: 28px;
      border-left: 2px solid var(--sage);
    }
  }
  @media (min-width: 901px) {
    .principle:nth-child(2) { margin-top: 40px; }
    .principle:nth-child(3) { margin-top: 80px; }
  }
  
  /* ---------- glossary ---------- */
  .visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  
  .glossary { background: var(--cream); display: grid; gap: 40px; }
  .glossary-side h2 {
    margin: 0 0 14px;
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
  }
  .glossary-side p { color: var(--muted); font-size: 17px; margin: 0 0 22px; }
  .glossary-side input[type="search"] {
    width: 100%;
    max-width: 420px;
    padding: 14px 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    font-size: 16px;
    color: var(--ink);
  }
  .glossary-side input[type="search"]:focus-visible {
    outline: 2px solid var(--sage-deep);
    outline-offset: 2px;
  }
  
  .glossary-list { margin: 0; }
  .gl-item { padding: 22px 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
  .gl-item[hidden] { display: none; }
  .gl-item dt {
    font-family: var(--serif);
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 6px;
  }
  .gl-item dd { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.65; max-width: 62ch; }
  .gl-item:target { background: var(--green-soft); border-radius: 16px; padding-left: 20px; padding-right: 20px; }
  .gl-empty { color: var(--muted); padding: 22px 0; margin: 0; }
  .gl-empty[hidden] { display: none; }
  
  @media (min-width: 1001px) {
    .glossary { grid-template-columns: 4fr 7fr; gap: clamp(48px, 8vw, 120px); align-items: start; }
    .glossary-side { position: sticky; top: 110px; }
  }

  /* ---------- Footer is light: use sage instead of butter ---------- */
.footer-label {
    color: var(--sage-deep);
  }
  
  .brand-mark {
    border: 0;
  }
  
  .footer-links a:focus-visible {
    border-bottom-color: var(--sage-deep);
  }
  
  .contact-link:focus-visible,
  textarea:focus-visible {
    outline-color: var(--sage-deep);
  }

  /* ---------- Intro: calmer asymmetry ---------- */
@media (min-width: 1001px) {
    .intro-grid {
      grid-template-columns: 6fr 5fr;
      gap: clamp(40px, 6vw, 96px);
      align-items: start;
      margin-top: 40px;
    }
  
    /* wrap heading into 3 lines so its height matches the paragraph */
    .intro h2 {
      max-width: 8.5em;
    }
  
    /* only a slight drop, so it looks intentional */
    .intro-copy {
      margin-top: clamp(16px, 3vw, 48px);
    }
  }

  /* ---------- Intro: raise paragraph a bit ---------- */
@media (min-width: 1001px) {
    .intro-copy {
      margin-top: 12px;
    }
  }

  /* =========================================================
   SCROLL REVEAL
   ========================================================= */
html.reveal [data-reveal] {
    opacity: 0;
    transition:
      opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
      transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
      filter 0.9s cubic-bezier(0.22, 1, 0.36, 1),
      clip-path 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  }
  
  html.reveal [data-reveal="up"]    { transform: translateY(36px); }
  html.reveal [data-reveal="left"]  { transform: translateX(-48px); }
  html.reveal [data-reveal="right"] { transform: translateX(48px); }
  html.reveal [data-reveal="zoom"]  { transform: translateY(20px) scale(0.95); }
  html.reveal [data-reveal="blur"]  { transform: translateY(20px); filter: blur(14px); }
  html.reveal [data-reveal="mask"]  {
    transform: translateY(24px);
    clip-path: inset(0 0 100% 0);
  }
  
  html.reveal [data-reveal].is-in {
    opacity: 1;
    transform: none;
    filter: none;
  }
  html.reveal [data-reveal="mask"].is-in {
    clip-path: inset(-20% -5% -20% -5%);
  }
  
  /* ---------- hero: gentle entrance on page load ---------- */
  @media (prefers-reduced-motion: no-preference) {
    .hero-content > * {
      animation: heroRise 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .hero-content > :nth-child(1) { animation-delay: 0.10s; }
    .hero-content > :nth-child(2) { animation-delay: 0.25s; }
    .hero-content > :nth-child(3) { animation-delay: 0.40s; }
    .hero-content > :nth-child(4) { animation-delay: 0.55s; }
  }
  @keyframes heroRise {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ---------- Header stays visible while scrolling ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 248, 241, 0.92);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    transition: box-shadow 0.3s ease;
  }
  
  /* anchor links (About, Resources, etc.) no longer land under the header */
  html {
    scroll-padding-top: 88px;
  }
  
  /* calculator intro sticks below the header */
  .calculator-intro {
    top: 110px;
  }
  
  @media (max-width: 900px) {
    html { scroll-padding-top: 80px; }
  }

  /* =========================================================
   BACK TO TOP
   ========================================================= */
.to-top {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 40;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--green);
    color: var(--butter);
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(24, 26, 25, 0.28);
  
    /* hidden state (exit animation) */
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px) scale(0.85);
    transition:
      opacity 0.3s ease,
      transform 0.35s cubic-bezier(0.55, 0, 0.7, 0.2),
      visibility 0s linear 0.35s,
      background 0.25s ease,
      color 0.25s ease;
  }
  
  /* visible state (entrance animation) */
  .to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition:
      opacity 0.35s ease,
      transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
      visibility 0s linear 0s,
      background 0.25s ease,
      color 0.25s ease;
  }
  
  .to-top svg {
    transition: transform 0.3s ease;
  }
  .to-top:hover {
    background: var(--butter-soft);
    color: var(--green-deep);
  }
  .to-top:hover svg {
    transform: translateY(-3px);
  }
  .to-top:focus-visible {
    outline: 2px solid var(--sage-deep);
    outline-offset: 3px;
  }
  
  @media (max-width: 600px) {
    .to-top { width: 48px; height: 48px; }
  }

  /* =========================================================
   SUBPAGES: page hero, teasers, active nav
   ========================================================= */
.page-hero {
    position: relative;
    overflow: hidden;
    background: var(--green);
    color: #f1eee2;
    padding: clamp(72px, 10vw, 140px) var(--page-pad) clamp(56px, 8vw, 100px);
  }
  .page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(55% 80% at 90% 10%, rgba(155, 174, 146, 0.22), transparent 70%),
      radial-gradient(40% 50% at 5% 100%, rgba(240, 223, 166, 0.10), transparent 70%);
    pointer-events: none;
  }
  .page-hero-inner { position: relative; max-width: var(--content-max); margin: 0 auto; }
  .page-hero h1 {
    margin: 18px 0 20px;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    max-width: 12em;
    text-wrap: balance;
  }
  .page-hero p {
    margin: 0;
    max-width: 52ch;
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    line-height: 1.6;
    color: rgba(241, 238, 226, 0.82);
  }
  
  /* active nav link */
  .main-nav > a[aria-current="page"]:not(.nav-cta) { color: var(--sage-deep); }
  .main-nav > a[aria-current="page"]:not(.nav-cta)::after { transform: scaleX(1); }
  
  /* learn page: target highlight (works with JS-rendered items) */
  .gl-item.is-target {
    background: var(--green-soft);
    border-radius: 16px;
    padding-left: 20px;
    padding-right: 20px;
  }
  
  /* ---------- homepage teasers ---------- */
  .teasers { background: var(--paper); }
  .teasers-head { margin-bottom: clamp(28px, 4vw, 48px); max-width: 640px; }
  .teasers-head h2 {
    margin: 0;
    font-size: clamp(2.2rem, 4.4vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
  }
  .teasers-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(18px, 3vw, 32px);
  }
  .teasers-grid-single { grid-template-columns: minmax(0, 680px); }
  .teasers-grid-learn { grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr); }
  @media (max-width: 900px) { .teasers-grid { grid-template-columns: 1fr; } }
  
  .teaser-card {
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    padding: clamp(26px, 3.6vw, 44px);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
  }
  .teaser-card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(24, 26, 25, 0.14); }
  .teaser-dark  { background: var(--green); color: #f1eee2; }
  .teaser-light { background: var(--green-soft); color: var(--ink); }
  
  .teaser-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; }
  .teaser-dark .teaser-label  { color: var(--butter); }
  .teaser-light .teaser-label { color: var(--sage-deep); }
  
  .teaser-card h3 {
    margin: 14px 0 10px;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
  }
  .teaser-card p { margin: 0 0 20px; font-size: 17px; line-height: 1.6; max-width: 40ch; opacity: 0.85; }
  .teaser-list { list-style: none; margin: 0 0 32px; padding: 0; }
  .teaser-list li { padding: 11px 0; border-top: 1px solid rgba(127, 136, 120, 0.35); font-size: 16px; }
  .teaser-cta {
    margin-top: auto;
    font-weight: 600;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }
  .teaser-cta span { transition: transform 0.3s ease; }
  .teaser-card:hover .teaser-cta span { transform: translateX(6px); }

  .term-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: clamp(26px, 3.6vw, 44px);
    border: 1px solid rgba(127, 136, 120, 0.35);
    border-radius: 28px;
    background: var(--butter-soft);
    color: var(--ink);
  }
  .term-card .teaser-label { color: var(--sage-deep); }
  .term-card-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    margin: 14px 0 10px;
  }
  .term-card h3 {
    margin: 0;
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1;
    letter-spacing: -0.03em;
  }
  .term-card-count {
    color: var(--sage-deep);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }
  .term-card p {
    max-width: 30ch;
    margin: 0;
    font-size: 18px;
    line-height: 1.55;
  }
  .term-card-controls {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 30px;
  }
  .term-card-button {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(127, 136, 120, 0.5);
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 18px;
    transition: background .2s ease, color .2s ease, transform .2s ease;
  }
  .term-card-button:hover { background: var(--green); color: #f1eee2; transform: translateY(-2px); }
  .term-card-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: fit-content;
    margin-top: 22px;
    color: var(--ink);
    font-weight: 600;
  }
  .term-card-link span { transition: transform .25s ease; }
  .term-card-link:hover span { transform: translateX(5px); }
  .term-card.is-changing h3,
  .term-card.is-changing p { opacity: .35; transform: translateY(4px); }
  .term-card h3, .term-card p { transition: opacity .18s ease, transform .18s ease; }

  @media (max-width: 900px) {
    .teasers-grid-learn { grid-template-columns: 1fr; }
    .term-card { min-height: 280px; }
  }

  /* ---------- featured ETF tools ---------- */
  .featured-tools { background: var(--green-soft); }
  .featured-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2.5vw, 26px);
  }
  .featured-tool-card {
    display: flex;
    flex-direction: column;
    min-height: 290px;
    padding: clamp(24px, 3vw, 34px);
    border-radius: 24px;
    color: var(--ink);
    transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s ease;
  }
  .featured-tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(24, 26, 25, .14);
  }
  .featured-tool-card-dark { background: var(--green); color: #f1eee2; }
  .featured-tool-card-light { background: #fbfaf5; }
  .featured-tool-card-butter { background: var(--butter-soft); }
  .featured-tool-card-dark .teaser-label { color: var(--butter); }
  .featured-tool-card-light .teaser-label,
  .featured-tool-card-butter .teaser-label { color: var(--sage-deep); }
  .featured-tool-card h3 {
    margin: 16px 0 12px;
    font-size: clamp(1.65rem, 2.4vw, 2.15rem);
    line-height: 1.1;
    letter-spacing: -.02em;
  }
  .featured-tool-card p { margin: 0 0 24px; line-height: 1.55; opacity: .82; }
  .featured-tool-card .teaser-cta { margin-top: auto; }
  @media (max-width: 1000px) {
    .featured-tools-grid { grid-template-columns: 1fr 1fr; }
    .featured-tool-card:last-child { grid-column: 1 / -1; }
  }
  @media (max-width: 650px) {
    .featured-tools-grid { grid-template-columns: 1fr; }
    .featured-tool-card:last-child { grid-column: auto; }
  }

  /* =========================================================
   PAGE LOAD ANIMATION
   ========================================================= */
@media (prefers-reduced-motion: no-preference) {
    body {
      animation: pageIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
  
    @keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
  }

  /* Hide primary hero button on mobile */
@media (max-width: 600px) {
    .hero-actions .button {
      display: none;
    }
  }
/* ===== ETF overlap tool ===== */
.screener-section { background: var(--paper); }
.screener-card { border: 1px solid var(--line, #d8d5c9); border-radius: 22px; padding: clamp(20px, 4vw, 32px); background: #fbfaf5; }
.screener-controls { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 16px; margin-bottom: 18px; align-items: end; }
.screener-controls label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.screener-controls input, .screener-controls select { width: 100%; border: 1px solid #d8d5c9; border-radius: 8px; padding: 12px; background: #fffef9; color: var(--ink, #232625); font: inherit; text-transform: none; letter-spacing: normal; }
.screener-meta { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.screener-scroll-hint { display: none; margin: -2px 0 10px; color: var(--muted); font-size: 12px; }
.screener-reset { white-space: nowrap; }
.screener-table-wrap {
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #d8d5c9;
  border-radius: 10px;
}
.screener-table { width: 100%; min-width: 1040px; border-collapse: collapse; font-size: 14px; }
.screener-table th, .screener-table td { padding: 13px 12px; text-align: left; border-bottom: 1px solid #e3e0d6; vertical-align: top; }
.screener-table th { position: sticky; top: 0; z-index: 1; background: #f2f1eb; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.screener-table tr:last-child td { border-bottom: 0; }
.screener-empty { text-align: center !important; color: var(--muted); padding: 28px !important; }
.screener-status { display: block; width: fit-content; margin-top: 7px; padding: 3px 7px; border: 1px solid #cfcbbd; border-radius: 999px; color: #6d6b60; font-size: 10px; line-height: 1.2; letter-spacing: .04em; text-transform: uppercase; }
.screener-status[data-status="excluded"] { border-color: #d6b2a8; color: #8c4e43; }
.screener-status[data-status="unverified"] { border-color: #e0c47d; color: #876518; }
.screener-na { color: #77766d; border-bottom: 1px dotted currentColor; cursor: help; }

@media (max-width: 1000px) { .screener-controls { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) {
  .screener-controls { grid-template-columns: 1fr; }
  .screener-table-wrap {
    max-height: 430px;
    position: relative;
    box-shadow: inset -18px 0 18px -18px rgba(35, 38, 37, .45);
  }
  .screener-scroll-hint {
    display: block;
    max-width: 38ch;
    line-height: 1.45;
  }
}
.backtester-section { background: var(--paper); }
.backtester-card { border: 1px solid var(--line, #d8d5c9); border-radius: 22px; padding: clamp(20px, 4vw, 32px); background: #fbfaf5; }
.backtester-controls { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.backtester-controls label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.backtester-controls input { width: 170px; border: 1px solid #d8d5c9; border-radius: 8px; padding: 12px; background: #fffef9; color: var(--ink, #232625); font: inherit; }
.backtester-range { color: var(--muted); font-size: 14px; margin-right: auto; }
.backtester-chart { display: grid; gap: 12px; margin: 18px 0 28px; }
.backtest-bar-row { display: grid; grid-template-columns: 52px 1fr 100px; align-items: center; gap: 10px; font-size: 14px; }
.backtest-bar-track { height: 14px; background: #e6e4db; border-radius: 99px; overflow: hidden; }
.backtest-bar { height: 100%; background: var(--green-deep, #315348); border-radius: inherit; }
.backtester-table-wrap { overflow-x: auto; border: 1px solid #d8d5c9; }
.backtester-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.backtester-table th, .backtester-table td { padding: 13px 12px; text-align: left; border-bottom: 1px solid #e3e0d6; }
.backtester-table th { background: #f2f1eb; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 700px) { .backtester-controls { align-items: stretch; flex-direction: column; } .backtester-controls input { width: 100%; } .backtest-bar-row { grid-template-columns: 45px 1fr 86px; } }
@media (max-width: 700px) {
  .calculator-section.section-pad,
  .overlap-section.section-pad,
  .screener-section.section-pad,
  .backtester-section.section-pad,
  .tools-section.section-pad {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .tools-head { margin-bottom: 28px; }
}
.overlap-card {
  max-width: 1100px;
  margin: 0 auto;
}

.overlap-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.overlap-stat {
  border: 1px solid var(--line, #d8e0dc);
  background: #f5f7f5;
  padding: 16px;
}

.overlap-stat span {
  display: block;
  color: var(--muted, #667078);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.35;
}

.overlap-stat strong {
  display: block;
  color: var(--ink, #273137);
  font-size: 24px;
  margin-top: 7px;
}

.overlap-status {
  color: var(--muted, #667078);
  font-size: 14px;
  margin: 12px 0 16px;
}

.overlap-status[data-state="success"] {
  color: #55715f;
}

.overlap-status[data-state="error"] {
  color: #a33a2f;
}

.overlap-interpretation {
  color: var(--ink, #202321);
  background: rgba(231, 238, 226, 0.65);
  border-left: 3px solid #71846b;
  padding: 12px 14px;
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
}

.overlap-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line, #d8e0dc);
}

.overlap-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-size: 14px;
}

.overlap-table th,
.overlap-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line, #d8e0dc);
  text-align: left;
}

.overlap-table th {
  background: #f5f7f5;
  color: var(--muted, #667078);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overlap-empty {
  color: var(--muted, #667078);
  text-align: center !important;
  padding: 24px !important;
}

.overlap-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted, #667078);
  font-size: 12px;
}

.overlap-sources a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 700px) {
  .overlap-summary {
    grid-template-columns: 1fr;
  }
}

/* Keep the transparent brand asset inside its fixed header mark. */
html,
body {
  overflow-x: clip;
}

.site-header .brand {
  min-width: 0;
  max-width: 100%;
}

.site-header .brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 39px !important;
  height: 39px !important;
  min-width: 39px !important;
  max-width: 39px !important;
  flex: 0 0 39px !important;
  overflow: hidden !important;
  border-radius: 6px;
}

.site-header .brand-mark img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  object-fit: contain !important;
  border-radius: inherit;
}

/* Fixed Facebook contact button, positioned above the back-to-top control. */
.facebook-chat-head {
  position: fixed !important;
  top: auto !important;
  left: auto !important;
  right: clamp(18px, 2.4vw, 32px);
  bottom: clamp(118px, 14vh, 148px);
  z-index: 1100;
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  place-items: center;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 1px solid rgba(113, 132, 107, 0.42);
  border-radius: 50%;
  background: #f8f6ef;
  box-shadow: 0 8px 22px rgba(31, 36, 34, 0.18),
    0 0 0 0 rgba(113, 132, 107, 0.45);
  overflow: hidden;
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  will-change: transform, opacity;
  animation: facebook-chat-head-glow 2.8s ease-in-out infinite;
}

.facebook-chat-head img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.facebook-chat-head:hover,
.facebook-chat-head:focus-visible {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 26px rgba(31, 36, 34, 0.22),
    0 0 0 6px rgba(113, 132, 107, 0.18);
}

.facebook-chat-head.is-scrolling,
.facebook-chat-head.is-scrolling:hover,
.facebook-chat-head.is-scrolling:focus-visible {
  opacity: 0 !important;
  transform: translateY(10px) scale(0.86);
  pointer-events: none !important;
}

.facebook-chat-head:focus-visible {
  outline: 2px solid #71846b;
  outline-offset: 3px;
}

@keyframes facebook-chat-head-glow {
  0%,
  100% {
    box-shadow: 0 8px 22px rgba(31, 36, 34, 0.18),
      0 0 0 0 rgba(113, 132, 107, 0.42);
  }

  50% {
    box-shadow: 0 10px 25px rgba(31, 36, 34, 0.2),
      0 0 0 7px rgba(113, 132, 107, 0.14);
  }
}

@media (max-width: 700px) {
  .facebook-chat-head {
    right: 16px;
    bottom: 104px;
    width: 54px;
    height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .facebook-chat-head {
    animation: none;
  }
}

/* Interactive draggable Facebook chat head */
.facebook-chat-head {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.facebook-chat-head:active {
  cursor: grabbing;
}

/* Small close control */
.facebook-chat-head::after {
  content: "�";
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #202422;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.22);

  opacity: 0;
  visibility: hidden;
  transform: scale(0.75);
  pointer-events: none;

  transition:
    opacity 150ms ease,
    transform 150ms ease,
    visibility 0s linear 150ms;
}

/* Desktop: reveal close button on hover */
@media (hover: hover) and (pointer: fine) {
  .facebook-chat-head:hover::after {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition-delay: 0s;
  }
}

/* Mobile/tablet: first tap arms the chat head */
.facebook-chat-head.is-armed::after {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  transition-delay: 0s;
}

.facebook-chat-head.is-dragging {
  cursor: grabbing;
  transition: none !important;
  animation: none !important;
}

.facebook-chat-head.is-dismissed {
  display: none !important;
}

/* Chat-head interaction reliability */
.facebook-chat-head::after {
  top: 2px !important;
  right: 2px !important;
  z-index: 5;
}

.facebook-chat-head img {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* Make armed/hover close control unmistakably visible */
.facebook-chat-head.is-armed::after {
  opacity: 1 !important;
  visibility: visible !important;
  transform: scale(1) !important;
}

@media (hover: hover) and (pointer: fine) {
  .facebook-chat-head:hover::after {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) !important;
  }
}

/* Final chat-head close button placement */
.facebook-chat-head {
  overflow: visible !important;
}

/* Keep the logo itself circular even though parent overflow is visible */
.facebook-chat-head img {
  border-radius: 50%;
}

.facebook-chat-head::after {
  content: "\00D7" !important;
  position: absolute !important;
  top: -8px !important;
  right: -8px !important;

  width: 20px !important;
  height: 20px !important;

  display: grid !important;
  place-items: center !important;

  border-radius: 50%;
  background: #202422 !important;
  color: #ffffff !important;

  font-family: Arial, sans-serif !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 20px !important;

  z-index: 10 !important;
  box-shadow: 0 3px 9px rgba(0,0,0,.22);
}

/* Desktop default chat-head position beside Back to Top */
@media (min-width: 701px) {
  .facebook-chat-head {
    top: auto !important;
    left: auto !important;

    right: 92px !important;
    bottom: 20px !important;
  }
}

/* =========================================================
   CHAT HEAD SCROLL VISIBILITY
   ========================================================= */

/* Hidden before halfway through the page */
.facebook-chat-head {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Show after halfway */
.facebook-chat-head.is-halfway {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Do not hide it again merely because the page is scrolling */
.facebook-chat-head.is-halfway.is-scrolling {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Desktop: normal position at bottom-right */
@media (min-width: 701px) {
  .facebook-chat-head.is-halfway {
    top: auto !important;
    left: auto !important;
    right: 20px !important;
    bottom: 20px !important;
  }

  /* Footer: move left so Back to Top can occupy far-right */
  .facebook-chat-head.is-halfway.is-footer-zone {
    right: 92px !important;
    bottom: 20px !important;
  }
}

/* Mobile: normal bottom-right */
@media (max-width: 700px) {
  .facebook-chat-head.is-halfway {
    top: auto !important;
    left: auto !important;
    right: 16px !important;
    bottom: 20px !important;
  }

  .facebook-chat-head.is-halfway.is-footer-zone {
    right: 80px !important;
    bottom: 20px !important;
  }
}

/* Final footer parking position for chat head */
@media (min-width: 701px) {
  .facebook-chat-head.is-halfway.is-footer-zone {
    top: auto !important;
    left: auto !important;
    right: 92px !important;
    bottom: 72px !important;
  }
}

@media (max-width: 700px) {
  .facebook-chat-head.is-halfway.is-footer-zone {
    top: auto !important;
    left: auto !important;
    right: 16px !important;
    bottom: 92px !important;
  }
}

/* Final chat-head alignment + smooth footer parking */
.facebook-chat-head {
  transition:
    right 420ms cubic-bezier(0.22, 1, 0.36, 1),
    bottom 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease !important;
}

/* Normal floating position */
.facebook-chat-head.is-halfway {
  right: 20px !important;
  bottom: 20px !important;
}

/* Footer parking: directly above Back to Top, perfectly aligned */
.facebook-chat-head.is-halfway.is-footer-zone {
  right: 20px !important;
  bottom: 92px !important;
}

/* Keep transition active during the footer movement */
.facebook-chat-head.is-halfway.is-footer-zone:not(.is-dragging) {
  transition:
    right 420ms cubic-bezier(0.22, 1, 0.36, 1),
    bottom 420ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease !important;
}

/* Featured original article inside Insights */
.insight-feature-card {
  margin-bottom: clamp(28px, 4vw, 48px);
  padding: clamp(24px, 4vw, 42px);
  border-top: 1px solid rgba(35, 38, 37, 0.22);
  border-bottom: 1px solid rgba(35, 38, 37, 0.22);
}

.insight-feature-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.65;
}

.insight-feature-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(24px, 5vw, 72px);
}

.insight-feature-content h3 {
  margin: 0 0 12px;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4vw, 3.7rem);
  font-weight: 400;
  line-height: 1.02;
}

.insight-feature-content p {
  max-width: 680px;
  margin: 0;
  line-height: 1.7;
}

@media (max-width: 700px) {
  .insight-feature-content {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .insight-feature-meta {
    flex-direction: column;
    gap: 6px;
  }
}

/* ========================================
   EDITORIAL ARTICLE PAGE
======================================== */

.article-page main {
  background: #f4f1e9;
  color: #232625;
}

.article-page main .container {
  width: min(100% - 40px, 860px);
  margin-inline: auto;
}

.article-page .article-hero {
  padding-top: clamp(72px, 10vw, 130px);
  padding-bottom: clamp(56px, 8vw, 96px);
  border-bottom: 1px solid rgba(35, 38, 37, 0.14);
}

.article-page .article-hero .section-kicker {
  margin-bottom: 24px;
}

.article-page .article-hero h1 {
  max-width: 820px;
  margin: 0 0 28px;
  font-family: "Fraunces", serif;
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.article-page .article-hero p {
  max-width: 720px;
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 1.72;
}

.article-page main section:not(.article-hero) {
  padding-top: clamp(54px, 7vw, 88px);
  padding-bottom: clamp(54px, 7vw, 88px);
  border-bottom: 1px solid rgba(35, 38, 37, 0.1);
}

.article-page main h2 {
  max-width: 760px;
  margin: 0 0 26px;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4vw, 3.3rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.article-page main p,
.article-page main li {
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.8;
}

.article-page main p {
  margin-top: 0;
  margin-bottom: 22px;
}

.article-page main ul {
  margin: 26px 0 30px;
  padding-left: 1.4rem;
}

.article-page main li + li {
  margin-top: 8px;
}

.article-page main a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.article-page main a:hover {
  text-decoration-thickness: 2px;
}

.article-formula {
  display: block;
  margin: 32px 0;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(35, 38, 37, 0.16);
  background: rgba(255, 255, 255, 0.4);
  font-family: "Fraunces", serif;
  font-size: clamp(1.25rem, 2.8vw, 2rem);
  font-weight: 400;
  line-height: 1.35;
}

@media (max-width: 700px) {
  .article-page main .container {
    width: min(100% - 32px, 860px);
  }

  .article-page .article-hero {
    padding-top: 64px;
  }

  .article-page .article-hero h1 {
    font-size: clamp(2.7rem, 13vw, 4.5rem);
  }

  .article-page main section:not(.article-hero) {
    padding-top: 48px;
    padding-bottom: 48px;
  }
}

/* Featured Insights article title link */
.insight-feature-content h3 a {
  color: inherit;
  text-decoration: none;
}

.insight-feature-content h3 a:hover {
  opacity: 0.72;
}

/* Article metadata and back link */
.article-back-link {
  display: inline-block;
  margin-bottom: 28px;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none !important;
}

.article-back-link:hover {
  opacity: 0.68;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 24px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  opacity: 0.64;
}

.article-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 18px;
}

@media (max-width: 700px) {
  .article-meta {
    gap: 8px 12px;
  }

  .article-meta span:not(:last-child)::after {
    margin-left: 12px;
  }
}

/* Article navigation + metadata */
.article-back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none !important;
}

.article-back-link:hover {
  opacity: 0.65;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 24px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  opacity: 0.62;
}

.article-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 18px;
}

@media (max-width: 700px) {
  .article-meta {
    gap: 8px 12px;
  }

  .article-meta span:not(:last-child)::after {
    margin-left: 12px;
  }
}

/* Glossary links to deeper educational articles */
.gl-article-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.gl-article-link:hover {
  opacity: 0.68;
}

/* Supporting editorial article card */
.insight-support-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(24px, 5vw, 72px);
  margin-bottom: clamp(30px, 5vw, 52px);
  padding: 26px 0;
  border-bottom: 1px solid rgba(35, 38, 37, 0.18);
}

.insight-support-label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.insight-support-card h3 {
  margin: 0 0 10px;
  font-family: "Fraunces", serif;
  font-size: clamp(1.7rem, 3vw, 2.7rem);
  font-weight: 400;
  line-height: 1.05;
}

.insight-support-card h3 a {
  color: inherit;
  text-decoration: none;
}

.insight-support-card h3 a:hover {
  opacity: 0.72;
}

.insight-support-card p {
  max-width: 650px;
  margin: 0;
}

@media (max-width: 700px) {
  .insight-support-card {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

/* Tighten supporting comparison card spacing */
.insight-support-card {
  margin-top: -8px;
  margin-bottom: clamp(24px, 3vw, 36px);
  padding: 20px 0 22px;
}

.insight-support-card h3 {
  font-size: clamp(1.55rem, 2.4vw, 2.25rem);
}

/* About Armi story */
.about-story {
  background: var(--paper);
}

.about-story-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  min-width: 0;
}

.about-story-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  background: var(--sage);
}

.about-story-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-story-photo::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 45%, rgba(24, 26, 25, 0.72));
  pointer-events: none;
}

.about-story-photo-caption {
  position: absolute;
  z-index: 1;
  left: 24px;
  bottom: 22px;
  color: #fff;
  font: 500 14px/1.2 var(--sans);
  letter-spacing: 0.02em;
  opacity: 1;
}

.about-story-copy {
  max-width: 620px;
  min-width: 0;
}

.about-story-copy h2 {
  margin: 10px 0 20px;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.04em;
}

.about-story-copy p {
  max-width: 52ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.about-story-copy p + p {
  margin-top: 18px;
}

@media (max-width: 700px) {
  .about-story-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .about-story-photo {
    max-width: 420px;
    aspect-ratio: 4 / 5;
  }

  .about-story-photo-caption {
    opacity: 1;
    transform: none;
  }

  .about-story-copy h2 {
    font-size: clamp(2.2rem, 11vw, 3.4rem);
  }
}


/* Contact form */
.contact-section {
  background: #f6f3ea;
}

.contact-inner {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: clamp(48px, 8vw, 110px);
  align-items: start;
}

.contact-copy h2 {
  margin: 10px 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
}

.contact-copy p:not(.section-kicker) {
  max-width: 430px;
  color: #65685f;
  line-height: 1.7;
}

.contact-form {
  display: grid;
  gap: 20px;
}

.contact-field {
  display: grid;
  gap: 8px;
}

.contact-field label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(25, 29, 26, .35);
  border-radius: 0;
  background: transparent;
  padding: 11px 0;
  color: inherit;
  font: inherit;
  outline: none;
}

.contact-field textarea {
  resize: vertical;
  min-height: 130px;
}

.contact-field input:focus,
.contact-field textarea:focus {
  border-bottom-color: #667b62;
}

.contact-submit {
  justify-self: start;
  border: 1px solid #1e211f;
  border-radius: 999px;
  background: #1e211f;
  color: #fff;
  padding: 13px 24px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.contact-status {
  min-height: 1.4em;
  margin: 0;
  font-size: .9rem;
  color: #667b62;
}

.contact-status.is-error {
  color: #9b3f35;
}

.contact-botcheck {
  display: none !important;
}

@media (max-width: 760px) {
  .contact-inner {
    width: min(100% - 36px, 1120px);
    grid-template-columns: 1fr;
    gap: 38px;
  }
}

/* Contact success modal */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity .22s ease,
    visibility .22s ease;
}

.contact-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 20, .5);
  backdrop-filter: blur(4px);
}

.contact-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  background: #f6f3ea;
  border: 1px solid rgba(25, 29, 26, .14);
  padding: 42px 38px 36px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .18);
  transform: translateY(12px) scale(.98);
  transition: transform .22s ease;
}

.contact-modal.is-open .contact-modal-card {
  transform: translateY(0) scale(1);
}

.contact-modal-card h3 {
  margin: 10px 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
}

.contact-modal-card p {
  margin-bottom: 0;
  color: #65685f;
  line-height: 1.6;
}

.contact-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: transparent;
  color: #1e211f;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .contact-modal-card {
    padding: 38px 28px 30px;
  }
}

/* Contact modal polish */
.contact-modal {
  transition:
    opacity .28s ease,
    visibility .28s ease;
}

.contact-modal-backdrop {
  transition: opacity .28s ease;
}

.contact-modal-card {
  border-radius: 18px;
  overflow: hidden;
  transform: translateY(18px) scale(.96);
  opacity: 0;
  transition:
    transform .32s cubic-bezier(.22, 1, .36, 1),
    opacity .24s ease;
}

.contact-modal.is-open .contact-modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.contact-modal-close {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  transition:
    background-color .2s ease,
    transform .2s ease,
    opacity .2s ease;
}

.contact-modal-close:hover {
  background: rgba(30, 33, 31, .08);
  transform: rotate(90deg);
}

.contact-modal:not(.is-open) .contact-modal-card {
  transform: translateY(12px) scale(.97);
  opacity: 0;
}

/* Premium contact modal finish */
.contact-modal-card {
  background: #f8f6ef;
  border: 1px solid rgba(111, 133, 111, .28);
  box-shadow:
    0 18px 55px rgba(28, 32, 29, .14),
    0 4px 16px rgba(28, 32, 29, .06);
}

.contact-modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.contact-modal-card .section-kicker {
  color: #6f856f;
}

.contact-modal-close {
  color: #4f5f50;
}

.contact-modal-close:hover {
  background: rgba(111, 133, 111, .10);
}

/* Contact inquiry dropdown */
.contact-field select {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(25, 29, 26, .35);
  border-radius: 0;
  background: transparent;
  padding: 11px 0;
  color: inherit;
  font: inherit;
  outline: none;
  cursor: pointer;
}

.contact-field select:focus {
  border-bottom-color: #667b62;
}
