/* Maple Groove Financial — home-page styles
   Extracted from the reference mockup so CSP can drop unsafe-inline. */

:root {
  --bg: #000000;
  --ink: #ffffff;
  --ink-dim: #8a8a8a;
  --ink-faint: #3a3a3a;
  --rule: #1a1a1a;
  --rule-2: #262626;
  --accent: #d62828;       /* maple red */
  --accent-glow: #ff3a3a;
  --amber: #e8a634;        /* muted amber — pricing accent */
  --amber-glow: #ffc266;
  --blue: #4ab8ff;
  --violet: #8a5cff;
  --green: #4ade80;        /* "open for business" status */
  --bar-h: 56px;
  --gutter: 28px;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Mono', ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  position: relative;
}

/* ============ Subtle grid + grain texture ============ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 1;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
  mix-blend-mode: overlay;
}

/* ============ Top bar (GitHub-style) ============ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--bar-h);
  background: #000;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  z-index: 100;
  font-size: 13px;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-right: 24px;
  text-decoration: none;
}

.topbar__leaf {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(255, 58, 58, 0.4));
  transition: transform 0.4s cubic-bezier(.2,.8,.2,1);
}
.topbar__brand:hover .topbar__leaf { transform: rotate(-12deg) scale(1.1); }

.topbar__name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.topbar__name span { color: var(--ink-dim); font-weight: 400; }

.topbar__sep {
  width: 1px; height: 22px; background: var(--rule-2); margin: 0 8px;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-item {
  position: relative;
  padding: 8px 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.nav-item:hover { background: var(--rule); }
.nav-item .caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--ink-dim);
  margin-left: 2px;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search {
  background: #0d0d0d;
  border: 1px solid var(--rule-2);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: inherit;
  color: var(--ink-dim);
  font-size: 12px;
  width: 240px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search:hover { border-color: #3a3a3a; }
.search kbd {
  margin-left: auto;
  background: #1a1a1a;
  border: 1px solid var(--rule-2);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: inherit;
}

.cta {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
  padding: 7px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 0 0 var(--accent-glow);
  text-decoration: none;
  display: inline-block;
}
.cta:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 20px rgba(255, 58, 58, 0.5);
}

/* ============ Main hero ============ */
main {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding-top: var(--bar-h);
  padding-bottom: calc(var(--bar-h) + 60px);
  display: flex;
  flex-direction: column;
}

/* corner labels — portfolio energy */
.corner {
  position: fixed;
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  z-index: 50;
  pointer-events: none;
}
.corner--tl { top: calc(var(--bar-h) + 18px); left: var(--gutter); }
.corner--tr { top: calc(var(--bar-h) + 18px); right: var(--gutter); text-align: right; }
.corner--bl { bottom: calc(var(--bar-h) + 80px); left: var(--gutter); }
.corner--br { bottom: calc(var(--bar-h) + 80px); right: var(--gutter); text-align: right; }

.corner b { color: var(--ink-dim); display: block; font-weight: 400; }

/* Hero */
.hero {
  flex: 1;
  display: grid;
  place-items: center;
  position: relative;
  padding: 60px var(--gutter);
  text-align: center;
}

.hero__meta {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--green);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero__meta::before, .hero__meta::after {
  content: '';
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--rule-2));
}
.hero__meta::after { background: linear-gradient(90deg, var(--rule-2), transparent); }
.hero__meta .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero__logo {
  width: min(56vw, 640px);
  filter: drop-shadow(0 0 80px rgba(214, 40, 40, 0.45)) drop-shadow(0 0 30px rgba(214, 40, 40, 0.25));
  animation: floatLogo 6s ease-in-out infinite, fadeUp 1.2s cubic-bezier(.2,.8,.2,1);
  user-select: none;
  -webkit-user-drag: none;
}
@keyframes floatLogo {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tagline cluster */
.hero__tag {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 100%;
  padding: 0 var(--gutter);
}
.hero__kicker {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(20px, 2.6vw, 30px);
  color: var(--ink);
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  opacity: 0;
  animation: fadeUp 1.2s 0.4s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero__kicker em {
  color: var(--accent);
  font-style: italic;
  text-shadow: 0 0 20px rgba(214, 40, 40, 0.5);
}
.hero__sub {
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--ink-dim);
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 1.2s 0.6s cubic-bezier(.2,.8,.2,1) forwards;
}

/* Big background type — barely visible, portfolio touch */
.ghost-type {
  position: absolute;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(120px, 22vw, 360px);
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.04);
  pointer-events: none;
  user-select: none;
  line-height: 0.8;
  letter-spacing: -0.02em;
  z-index: 0;
}
.ghost-type--top {
  top: 80px;
  left: -3vw;
}
.ghost-type--bot {
  bottom: 100px;
  right: -3vw;
}

/* Crosshair lines through center */
.crosshair {
  position: fixed;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(transparent, rgba(214,40,40,0.08), transparent);
}
.crosshair--v {
  top: var(--bar-h); bottom: var(--bar-h);
  left: 50%; width: 1px;
  transform: translateX(-50%);
}

/* ============ Floating quick-links (home hero flank) ============
   Two columns of cards flanking the centered hero logo: case studies
   (left, blue leaf accent), calculators (right, amber accent). Desktop:
   an absolute overlay centered on a fixed band so the cards always hug
   the logo, never the screen edge, and the hero itself is untouched.
   Below 1220px they fall back to an in-flow 2x2 grid under the hero. */
.quicklinks {
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 0;
  margin-inline: auto;
  max-width: 1200px;
  z-index: 6;
  pointer-events: none;            /* clicks pass through the gutter */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.quicklinks__col {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.qcard {
  --q-accent: var(--ink-dim);
  --q-rgb: 138,138,138;
  pointer-events: auto;
  position: relative;
  display: grid;
  gap: 5px;
  width: 200px;
  padding: 15px 17px 16px;
  text-decoration: none;
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(22,22,22,0.78), rgba(8,8,8,0.82));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 34px rgba(0,0,0,0.5);
  animation: floatCard 7s ease-in-out infinite;
  transition: scale .35s cubic-bezier(.2,.8,.2,1),
              border-color .35s ease,
              box-shadow .35s ease;
}
/* Breathing halo — a separate layer so the hover box-shadow isn't
   fought by the keyframes. Outer glow only, so it never veils text. */
.qcard::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 28px 2px rgba(var(--q-rgb), 0.30);
  opacity: 0;
  pointer-events: none;
  animation: glowCard 5.5s ease-in-out infinite;
}
.quicklinks__col--left  { --q-accent-col: var(--blue);  --q-rgb-col: 74,184,255; }
.quicklinks__col--right { --q-accent-col: var(--amber); --q-rgb-col: 232,166,52; }
.quicklinks__col .qcard { --q-accent: var(--q-accent-col); --q-rgb: var(--q-rgb-col); }

/* Desync the four cards so they don't bob/glow in lockstep. */
.quicklinks__col--left  .qcard:nth-of-type(1)        { animation-delay: 0s; }
.quicklinks__col--left  .qcard:nth-of-type(1)::after { animation-delay: -1s; }
.quicklinks__col--left  .qcard:nth-of-type(2)        { animation-delay: -3.5s; }
.quicklinks__col--left  .qcard:nth-of-type(2)::after { animation-delay: -2.4s; }
.quicklinks__col--right .qcard:nth-of-type(1)        { animation-delay: -1.7s; }
.quicklinks__col--right .qcard:nth-of-type(1)::after { animation-delay: -4s; }
.quicklinks__col--right .qcard:nth-of-type(2)        { animation-delay: -5.2s; }
.quicklinks__col--right .qcard:nth-of-type(2)::after { animation-delay: -0.6s; }

.qcard:hover,
.qcard:focus-visible {
  scale: 1.04;
  border-color: var(--q-accent);
  box-shadow: 0 20px 55px rgba(0,0,0,0.6), 0 0 30px rgba(var(--q-rgb), 0.30);
  outline: none;
  animation-play-state: paused;     /* settle while you read/click */
}
.qcard:hover::after,
.qcard:focus-visible::after {
  opacity: 1;
  animation-play-state: paused;
}

.qcard__eyebrow {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--q-accent);
}
.qcard__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 23px;
  line-height: 1.04;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.qcard__desc {
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-dim);
}
.qcard__arrow {
  margin-top: 3px;
  color: var(--q-accent);
  font-size: 14px;
  transition: transform .3s ease;
}
.qcard:hover .qcard__arrow,
.qcard:focus-visible .qcard__arrow { transform: translateX(4px); }

@keyframes floatCard {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -9px; }
}
@keyframes glowCard {
  0%, 100% { opacity: 0; }
  50%      { opacity: 0.65; }
}

/* Tablet / narrow: drop the overlay, flow as a 2x2 grid under the hero
   (display:contents lets all four cards share one grid). */
@media (max-width: 1220px) {
  .quicklinks {
    position: static;
    max-width: 680px;
    margin: 4px auto 0;
    padding: 0 var(--gutter) 26px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    pointer-events: auto;
  }
  .quicklinks__col { display: contents; }
  .qcard { width: auto; }
  /* The cards are now an in-flow sibling, so keep the hero from
     collapsing (which would overlap the logo and tagline) — reserve
     the full-screen height it had as the lone flex child, and let the
     cards scroll in below it. */
  .hero { min-height: calc(100vh - 2 * var(--bar-h) - 60px); }
}
@media (max-width: 600px) {
  .quicklinks {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .qcard, .qcard::after { animation: none; }
}

/* ============ Bottom marquee bar ============ */
.bottombar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #000;
  border-top: 1px solid var(--rule);
  z-index: 100;
}

.marquee {
  overflow: hidden;
  height: 60px;
  display: flex;
  align-items: center;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

.marquee__track {
  display: flex;
  gap: 60px;
  animation: scroll 90s linear infinite;
  white-space: nowrap;
  padding-left: 60px;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee__item {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--ink-dim);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.15em;
  transition: color 0.3s;
}
.marquee__item:hover { color: var(--ink); }
.marquee__item::after {
  content: '✦';
  color: var(--accent);
  font-size: 14px;
  margin-left: 60px;
}

/* status footer below marquee */
.statusbar {
  border-top: 1px solid var(--rule);
  padding: 8px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ============ Dropdown ============ */
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #0a0a0a;
  border: 1px solid var(--rule-2);
  border-radius: 8px;
  min-width: 280px;
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.18s ease;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.02);
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a {
  display: block;
  padding: 10px 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  border-radius: 5px;
  letter-spacing: 0.02em;
}
.dropdown a small {
  display: block;
  color: var(--ink-dim);
  font-weight: 400;
  font-size: 11px;
  margin-top: 2px;
  letter-spacing: 0;
}
.dropdown a:hover { background: var(--rule); }
.dropdown a:hover small { color: var(--ink); }

/* Right-anchored variant (for nav items at the end of the bar so
   the menu doesn't run off the right edge of the viewport). */
.dropdown--right { left: auto; right: 0; }

/* Grouped variant — section headers separating clusters of links. */
.dropdown--grouped { min-width: 320px; }
.dropdown__group + .dropdown__group {
  border-top: 1px solid var(--rule);
  margin-top: 6px;
  padding-top: 6px;
}
.dropdown__group-label {
  padding: 6px 12px 4px;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber);
}

/* ============ Mobile hamburger ============ */
/* Visually hidden checkbox; clicking the label toggles :checked. */
.topbar__toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0; height: 0;
}
/* Hamburger button — desktop default is hidden; mobile media query
   reveals it. */
.topbar__hamburger {
  display: none;
}

/* Responsive */
@media (max-width: 980px) {
  .search, .topbar__nav .label-md { display: none; }
  .corner { display: none; }
}

@media (max-width: 768px) {
  /* Hide the inline nav, show the hamburger. */
  .topbar__hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    cursor: pointer;
    margin-left: auto;       /* push to the right of the brand */
    margin-right: 12px;
    flex: 0 0 auto;
  }
  .topbar__hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
    transform-origin: 4px center;
  }
  /* Hamburger -> X when checkbox is checked. The :has() selector
     scopes the toggle's checked state to the topbar so we can style
     siblings in any order. */
  .topbar:has(.topbar__toggle:checked) .topbar__hamburger span:nth-child(1) {
    transform: rotate(45deg);
  }
  .topbar:has(.topbar__toggle:checked) .topbar__hamburger span:nth-child(2) {
    opacity: 0;
  }
  .topbar:has(.topbar__toggle:checked) .topbar__hamburger span:nth-child(3) {
    transform: rotate(-45deg);
  }

  /* Mobile nav as overlay below topbar; hidden by default.
     max-height + overflow-y so the menu scrolls within itself when
     it would otherwise overflow the viewport (e.g. expanded Links
     dropdown on a small phone with browser chrome eating real estate). */
  .topbar__nav {
    display: none;
    position: fixed;
    top: var(--bar-h);
    left: 0;
    right: 0;
    /* dvh = dynamic viewport height; on mobile this shrinks when the
       browser URL bar is visible, so the menu never extends below the
       actual visible area (vh would over-allocate). */
    max-height: calc(100dvh - var(--bar-h));
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    background: #000;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 6px var(--gutter) 10px;
    /* Above the .bottombar (z:100). */
    z-index: 105;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Hide the bottom marquee + statusbar entirely while the mobile
     menu is open — they were eating ~80px of viewport that the menu
     needed. The user can read the marquee after closing the menu. */
  body:has(.topbar__toggle:checked) .bottombar {
    display: none;
  }
  /* And reclaim the bottom padding main was reserving for it. */
  body:has(.topbar__toggle:checked) main {
    padding-bottom: 0;
  }
  .topbar:has(.topbar__toggle:checked) .topbar__nav {
    display: flex;
  }

  /* Mobile nav rows — full-width, dividers between, tap-friendly but
     compact enough for 5 items + expanded Links dropdown to fit on
     ~600px-tall viewports (phone w/ browser chrome). */
  .nav-item {
    padding: 11px 4px;
    font-size: 14px;
    border-bottom: 1px solid var(--rule);
    border-radius: 0;
    flex: 0 0 auto;
    align-items: flex-start;
  }
  .nav-item:last-child { border-bottom: none; }

  /* Dropdown — collapsible accordion on mobile. Hidden by default,
     expanded on tap (the parent nav-item with tabindex="0" gets focus,
     :focus-within shows the dropdown). Tap outside to collapse. */
  .dropdown,
  .dropdown--right.dropdown--grouped {
    position: static;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transform: none;
    transition: max-height 0.22s ease, opacity 0.18s ease, margin-top 0.22s ease;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    min-width: auto;
    margin-top: 0;
    width: 100%;
  }
  .nav-item:focus-within .dropdown,
  .nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
    max-height: 600px;
    margin-top: 8px;
  }
  .dropdown a { padding: 7px 4px 7px 14px; }
  .dropdown__group + .dropdown__group { margin-top: 6px; padding-top: 6px; }
  .dropdown__group-label { padding: 4px 12px 2px; }

  /* Caret rotates when any nav dropdown is open. */
  .nav-item .caret { transition: transform 0.22s ease; }
  .nav-item:focus-within .caret,
  .nav-item:hover .caret {
    transform: rotate(180deg);
  }

  /* Hide the brand "/ FINANCIAL" suffix at the tightest viewports
     to give the hamburger and CTA more breathing room. */
  .topbar__name span { display: none; }

  /* Outlined CTA on phone — solid red fill is too loud at this scale,
     stroke-only reads cleaner alongside the hamburger. Hover/tap
     swaps back to filled. */
  .cta {
    background: transparent;
    color: var(--accent-glow);
  }
  .cta:hover, .cta:active {
    background: var(--accent);
    color: white;
  }
}

@media (max-width: 680px) {
  .topbar__name { font-size: 14px; }
  .hero__logo { width: 78vw; }
  .ghost-type { display: none; }

  /* Hero meta: let the kicker wrap on narrow viewports. */
  .hero__meta {
    white-space: normal;
    font-size: 9px;
    letter-spacing: 0.2em;
    padding: 0 var(--gutter);
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .hero__meta::before, .hero__meta::after {
    width: 24px;
  }

  /* Status bar: stack the three regions vertically and tighten. */
  .statusbar {
    flex-direction: column;
    gap: 6px;
    padding: 10px var(--gutter);
    text-align: center;
  }

  /* Marquee: a touch smaller so the ✦ separators sit closer. */
  .marquee__item { font-size: 18px; }
  .marquee__track { gap: 36px; }
  .marquee__item::after { margin-left: 36px; }
}

/* ============ Interior pages (About / Planning / Pricing / Product Labs) ============
   Hybrid layout — keeps ghost-type + topbar + bottombar from home, drops
   crosshair / corner labels / hero. Content-first, dark-portfolio vibe. */
.page {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  padding-top: calc(var(--bar-h) + 80px);
  padding-bottom: calc(var(--bar-h) + 100px);
  display: flex;
  flex-direction: column;
}

.page__inner {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.page__eyebrow {
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--ink-dim);
  text-transform: uppercase;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.page__eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--accent);
}

.page__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(40px, 6vw, 72px);
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.05;
  margin-bottom: 36px;
}
.page__title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--accent);
  font-size: 0.55em;
  margin-left: 0.4em;
  letter-spacing: 0;
  vertical-align: 0.18em;
  text-shadow: 0 0 20px rgba(214, 40, 40, 0.4);
}
.page__title em sup {
  font-size: 0.5em;
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
  text-shadow: none;
}

.page__lede {
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 36px;
}

.page__bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}
.page__bullets li {
  position: relative;
  padding: 16px 0 16px 32px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--rule);
}
.page__bullets li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 16px;
  color: var(--accent);
  font-size: 12px;
}
.page__bullets li:last-child {
  border-bottom: none;
}

/* Pull-quote — Instrument Serif italic, sets voice for interior pages. */
.page__quote {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.45;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 24px;
  margin: 0 0 36px;
}
.page__quote--accent {
  color: var(--accent-glow);
  text-shadow: 0 0 24px rgba(214, 40, 40, 0.25);
}

/* Body paragraph — denser than the lede, dimmer ink. */
.page__body {
  font-size: clamp(14px, 1.4vw, 16px);
  line-height: 1.75;
  color: var(--ink-dim);
  margin: 0 0 24px;
}
.page__body em {
  color: var(--ink);
  font-style: italic;
}

/* Sub-section header — eyebrow style with red rule, but for in-page sections. */
.page__subhead {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 48px 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.page__subhead::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--accent);
}

/* Active nav item — subtle accent so the current page reads. */
.nav-item[aria-current="page"] {
  color: var(--accent-glow);
}

/* ============ Planning Strategies — bento grid + slide-over sheet ============ */
.page__inner--wide {
  max-width: 1100px;
}

.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.filter {
  background: transparent;
  border: 1px solid var(--rule-2);
  color: var(--ink-dim);
  padding: 6px 14px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.filter:hover {
  border-color: var(--ink-dim);
  color: var(--ink);
}
.filter--active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.bento {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-auto-flow: dense;
  gap: 14px;
}
.bento__card {
  position: relative;
  background: #0a0a0a;
  border: 1px solid var(--rule-2);
  border-radius: 10px;
  padding: 22px 20px 48px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.bento__card:hover {
  border-color: var(--accent);
  background: #111;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(214, 40, 40, 0.12);
}
.bento__card--wide {
  grid-column: span 2;
}
.bento__card--hidden {
  display: none;
}
.bento__icon {
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1;
}
.bento__cat {
  color: var(--ink-faint);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.bento__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
  line-height: 1.1;
  color: var(--ink);
}
.bento__card--wide .bento__title {
  font-size: 28px;
}
.bento__teaser {
  margin: 0;
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.55;
  flex: 1;
}
.bento__card::after {
  content: '→';
  position: absolute;
  bottom: 16px;
  right: 18px;
  color: var(--ink-faint);
  font-size: 14px;
  transition: transform 0.2s ease, color 0.2s ease;
}
.bento__card:hover::after {
  color: var(--accent);
  transform: translateX(4px);
}
@media (max-width: 600px) {
  .bento__card--wide { grid-column: auto; }
}

/* Slide-over sheet — pinned right, slides in over backdrop. */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.sheet[aria-hidden="false"] {
  pointer-events: auto;
}
.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.sheet[aria-hidden="false"] .sheet__backdrop {
  opacity: 1;
}
.sheet__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: clamp(420px, 50%, 720px);
  max-width: 100vw;
  background: #0a0a0a;
  border-left: 1px solid var(--rule-2);
  box-shadow: -20px 0 60px rgba(0,0,0,0.7);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
  padding: 60px 48px 48px;
}
.sheet[aria-hidden="false"] .sheet__panel {
  transform: translateX(0);
}
.sheet__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
  font-family: inherit;
  line-height: 1;
  padding: 0;
}
.sheet__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
body.sheet-locked {
  overflow: hidden;
}
@media (max-width: 600px) {
  .sheet__panel {
    width: 100%;
    padding: 60px 24px 40px;
  }
}

/* Strategy article inside the sheet. */
.strategy__cat {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.strategy__cat::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
}
.strategy__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0 0 28px;
  color: var(--ink);
}
.strategy p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-dim);
  margin: 0 0 18px;
}
.strategy p em {
  color: var(--ink);
  font-style: italic;
}

/* ============ Pricing — two-card layout with muted-amber accent ============ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 32px 0 64px;
}
@media (max-width: 760px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

.price-card {
  position: relative;
  background: #0a0a0a;
  border: 1px solid var(--rule-2);
  border-radius: 12px;
  padding: 36px 32px 32px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.price-card:hover {
  border-color: var(--ink-faint);
  transform: translateY(-2px);
}

/* Preferred card — amber-glow ring + slightly raised. */
.price-card--preferred {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), 0 12px 40px rgba(232, 166, 52, 0.12);
  padding-top: 44px;
}
.price-card--preferred:hover {
  border-color: var(--amber-glow);
  box-shadow: 0 0 0 1px var(--amber-glow), 0 16px 50px rgba(232, 166, 52, 0.22);
}

/* Floating "Preferred" pill — sits across the top edge. */
.price-card__pill {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--amber);
  color: #0a0a0a;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 0 24px rgba(232, 166, 52, 0.4);
}

.price-card__eyebrow {
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
}
.price-card--preferred .price-card__eyebrow {
  color: var(--amber);
}

.price-card__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0 0 28px;
  color: var(--ink);
}

.price-card__tier {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.price-card__tier-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 700;
}
.price-card__tier-meta {
  color: var(--ink-faint);
  font-weight: 400;
  letter-spacing: 0.08em;
  margin-left: 4px;
}

.price-card__amount {
  font-family: 'Space Mono', monospace;
  font-size: clamp(32px, 4.4vw, 46px);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.price-card--preferred .price-card__amount {
  color: var(--amber);
  text-shadow: 0 0 28px rgba(232, 166, 52, 0.35);
}
.price-card__amount--free {
  letter-spacing: 0.04em;
}
.price-card__unit {
  font-size: 0.45em;
  color: var(--ink-dim);
  font-weight: 400;
  margin-left: 2px;
  letter-spacing: 0;
}
.price-card__then {
  font-size: 0.42em;
  color: var(--ink-faint);
  font-weight: 400;
  margin: 0 6px 0 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.price-card__detail {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-dim);
  margin: 0;
}

.price-card__divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 24px 0;
}

.price-card__fit {
  margin-top: auto;
  padding-top: 24px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-dim);
}
.price-card__fit-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.price-card--preferred .price-card__fit-label {
  color: var(--amber);
}

/* What's included panel — sits below the cards. */
.included {
  margin-top: 24px;
  padding-top: 56px;
  border-top: 1px solid var(--rule);
}
.included__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--ink);
}
.included__lede {
  font-size: clamp(14px, 1.4vw, 16px);
  line-height: 1.75;
  color: var(--ink-dim);
  margin: 0 0 32px;
  max-width: 720px;
}
.included__list {
  max-width: 820px;
}
.included__list li strong {
  color: var(--ink);
  font-weight: 700;
  margin-right: 4px;
}

.price-footnote {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-faint);
  max-width: 720px;
}

/* ============ Insurance — multi-section page with TOC pills ============ */
.page-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 16px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}
.page-toc a {
  background: transparent;
  border: 1px solid var(--rule-2);
  color: var(--ink-dim);
  padding: 6px 14px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.page-toc a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.insurance-section {
  scroll-margin-top: calc(var(--bar-h) + 24px);
  padding: 56px 0;
  border-top: 1px solid var(--rule);
}
.insurance-section:first-of-type {
  border-top: none;
  padding-top: 32px;
}
.insurance-section .section-eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.insurance-section .section-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--accent);
}
.insurance-section h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: 0.02em;
  line-height: 1.1;
  margin: 0 0 28px;
  color: var(--ink);
  font-weight: 400;
}
.insurance-section h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(17px, 1.8vw, 21px);
  letter-spacing: 0.04em;
  margin: 32px 0 12px;
  color: var(--ink);
  font-weight: 400;
}

/* Legal disclaimer block — small print at page bottom. */
.legal-disclaimer {
  margin-top: 56px;
  padding: 28px 0 0;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  line-height: 1.75;
  color: var(--ink-faint);
}
.legal-disclaimer__label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
  font-weight: 700;
}
.legal-disclaimer p {
  margin: 0 0 14px;
}

/* ============ 404 page ============ */
.notfound {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--gutter);
}
.notfound__code {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(120px, 22vw, 280px);
  line-height: 0.85;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.15);
}
.notfound__head {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: clamp(22px, 2.6vw, 32px);
  margin-top: -0.3em;
}
.notfound__head em { color: var(--accent); font-style: italic; }
.notfound__sub {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.notfound__cta {
  display: inline-block;
  margin-top: 32px;
  padding: 9px 18px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 6px;
  transition: all 0.2s;
}
.notfound__cta:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 20px rgba(255, 58, 58, 0.5);
}

/* ============ Calculator iframe wrappers ============
   Each calc page = site chrome (topbar + bottombar) + an <iframe>
   loading /calculators/sources/<slug>. The iframe owns its own
   styles + scripts; this page just frames it. JS in /calculators/calc-frame.js
   reads the inner doc's scrollHeight (same-origin) and sizes the frame
   so we get one continuous scrollable page, not nested scroll regions. */
.page--calc {
  /* Tighter than reading-pages — get to the tool fast. */
  padding-top: calc(var(--bar-h) + 24px);
  padding-bottom: calc(var(--bar-h) + 24px);
}
.calc-eyebrow {
  position: relative;
  z-index: 5;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
  max-width: 1600px;
  margin: 0 auto 16px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
}
.calc-eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
}
.calc-eyebrow span {
  color: var(--ink);
  font-weight: 700;
}
.calc-frame-wrap {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.calc-frame {
  width: 100%;
  border: 0;
  display: block;
  background: transparent;
  /* Initial fallback while calc-frame.js measures the inner doc. */
  min-height: 80vh;
}
@media (max-width: 680px) {
  .calc-frame-wrap { padding: 0 12px; }
  .calc-eyebrow { padding: 0 12px; font-size: 10px; letter-spacing: 0.24em; }
}

/* ============ Case study — read-more chevron + narrative ============ */
/* Reading-width narrative (page__inner) sits above the full-width iframe
   model. The chevron is a native <details> — zero JS, collapsed by default. */
.page--case .calc-eyebrow--case { margin-top: 48px; }

.case-readmore {
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.015);
  margin-bottom: 8px;
}
.case-readmore > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.2s ease;
}
.case-readmore > summary::-webkit-details-marker { display: none; }
.case-readmore > summary:hover { color: var(--ink); }
/* Chevron: a rotated corner that points right when closed, down when open. */
.case-readmore > summary::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
.case-readmore[open] > summary::before { transform: rotate(45deg); }
.case-readmore[open] > summary { border-bottom: 1px solid var(--rule); }
.case-readmore__body { padding: 8px 24px 28px; }
.case-readmore__body .page__subhead:first-child { margin-top: 24px; }

/* Numbered routes — Bebas Neue red numerals, same rhythm as page__bullets. */
.case-ol {
  list-style: none;
  counter-reset: route;
  padding: 0;
  margin: 0 0 24px;
}
.case-ol li {
  position: relative;
  counter-increment: route;
  padding: 14px 0 14px 40px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--rule);
}
.case-ol li:last-child { border-bottom: none; }
.case-ol li::before {
  content: counter(route);
  position: absolute;
  left: 0;
  top: 11px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
}
.case-ol li b { color: var(--ink); font-weight: 700; }

.case-disclaimer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-dim);
  font-style: italic;
}
