/* =========================================================================
   BILLET VENTURES — Redesign
   Faithful to the live brand (editorial/brutalist fintech) + UX, a11y &
   mobile improvements. Tokens: Sora 800 display, IBM Plex Mono UI,
   warm paper, single clay accent, zero radius, hairline dividers.
   ========================================================================= */
/* Fonts are loaded via <link rel="preconnect"> + <link rel="stylesheet"> in the
   document <head> (non-blocking, faster than a CSS @import). */

:root {
  --paper:        #F7F5F2;   /* warm paper bg */
  --paper-2:      #EFEBE5;   /* subtle panel */
  --surface-hover:#EDE9E3;
  --ink:          #1A1A1A;   /* headings / primary text */
  --body:         #5A5248;   /* body copy */
  --accent:       #8C7B6B;   /* brand clay — fills, marks */
  --accent-hover: #7A6A5A;
  --label:        #6F5D4C;   /* AA-safe clay for small labels (fixes a11y) */
  --accent-on:    #F7F5F2;   /* text on accent */
  --border:       #C8BFB0;   /* hairline */
  --border-strong:#B3A795;
  --placeholder:  #A89F96;
  --focus:        #1A1A1A;

  --ff-display: 'Sora', system-ui, sans-serif;
  --ff-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;

  --gut: clamp(20px, 5vw, 64px);
  --maxw: 1320px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* dark "engine room" theme (Tweak) */
[data-theme="dark"] {
  --paper:        #15130F;
  --paper-2:      #1E1B16;
  --surface-hover:#22201A;
  --ink:          #F4F1EA;
  --body:         #B6AC9C;
  --accent:       #B7A48F;
  --accent-hover: #C8B6A1;
  --label:        #B7A48F;
  --accent-on:    #15130F;
  --border:       #3A352D;
  --border-strong:#4A443A;
  --placeholder:  #6E665A;
  --focus:        #F4F1EA;
}

/* accent variants (Tweak) */
[data-accent="graphite"] { --accent:#5C5A55; --accent-hover:#4A4844; --label:#4F4D48; }
[data-accent="ink"]      { --accent:#2A2A2A; --accent-hover:#1A1A1A; --label:#2A2A2A; }
[data-theme="dark"][data-accent="graphite"] { --accent:#9A988F; --accent-hover:#ABA99F; --label:#9A988F; }
[data-theme="dark"][data-accent="ink"]      { --accent:#D8D4CB; --accent-hover:#E8E4DB; --label:#D8D4CB; }

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--ff-mono);
  background: var(--paper); color: var(--body);
  line-height: 1.5; -webkit-font-smoothing: antialiased;
  overflow-x: hidden; transition: background .45s var(--ease), color .45s var(--ease);
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-on); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ---- Primitives ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.mono { font-family: var(--ff-mono); }
.display {
  font-family: var(--ff-display); font-weight: 800; text-transform: uppercase;
  letter-spacing: -0.04em; line-height: 0.9; color: var(--ink); text-wrap: balance;
}
.eyebrow {
  font-family: var(--ff-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.28em; color: var(--label);
}
.lede { font-size: 14px; line-height: 1.75; color: var(--body); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--ff-mono); font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.2em; padding: 14px 24px; border: 1px solid transparent; border-radius: 0;
  min-height: 48px; transition: background .2s var(--ease), color .2s var(--ease), opacity .2s, border-color .2s;
}
.btn svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn-fill { background: var(--accent); color: var(--accent-on); }
.btn-fill:hover { background: var(--accent-hover); }
.btn-outline { border-color: var(--accent); color: var(--ink); }
.btn-outline:hover { background: var(--accent); color: var(--accent-on); }
.btn-outline:hover svg { transform: none; }
.btn-block { width: 100%; }

/* =========================================================================
   NAV (real nav + sticky + mobile menu — UX upgrade over hairline-only bar)
   ========================================================================= */
.nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px var(--gut); border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px); transition: padding .3s var(--ease), border-color .3s;
}
.nav-brand { font-family: var(--ff-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.22em; color: var(--ink); display: inline-flex; align-items: center; gap: 11px; }
.nav-brand .glyph { width: 13px; height: 13px; position: relative; flex-shrink: 0; }
.nav-brand .glyph i { position: absolute; bottom: 0; width: 3px; background: var(--accent); transition: height .4s var(--ease); }
.nav-brand .glyph i:nth-child(1){ left:0; height:7px; } .nav-brand .glyph i:nth-child(2){ left:5px; height:13px; } .nav-brand .glyph i:nth-child(3){ left:10px; height:10px; }
.nav-brand:hover .glyph i:nth-child(1){ height:13px; } .nav-brand:hover .glyph i:nth-child(3){ height:5px; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-family: var(--ff-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--label); position: relative; padding: 4px 0; transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a::after { content:""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-tag { font-family: var(--ff-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--label); }
.nav-cta { font-family: var(--ff-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--accent-on); background: var(--accent); padding: 11px 18px; min-height: 42px; display: inline-flex; align-items: center; gap: 8px; transition: background .2s; }
.nav-cta:hover { background: var(--accent-hover); }
.nav-cta svg { width: 13px; height: 13px; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--border); align-items: center; justify-content: center; }
.nav-toggle span { width: 18px; height: 1.5px; background: var(--ink); position: relative; transition: .3s var(--ease); }
.nav-toggle span::before, .nav-toggle span::after { content:""; position: absolute; left: 0; width: 18px; height: 1.5px; background: var(--ink); transition: .3s var(--ease); }
.nav-toggle span::before { top: -6px; } .nav-toggle span::after { top: 6px; }
.nav-toggle.x span { background: transparent; }
.nav-toggle.x span::before { top: 0; transform: rotate(45deg); }
.nav-toggle.x span::after { top: 0; transform: rotate(-45deg); }

.m-menu { position: fixed; inset: 0; z-index: 55; background: var(--paper); transform: translateY(-100%); transition: transform .45s var(--ease); display: flex; flex-direction: column; padding: 92px var(--gut) 36px; }
.m-menu.open { transform: none; }
.m-menu a { font-family: var(--ff-display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; font-size: clamp(34px, 11vw, 56px); color: var(--ink); padding: 14px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; line-height: 1; }
.m-menu a .mi { font-family: var(--ff-mono); font-size: 11px; color: var(--label); letter-spacing: 0.2em; }
.m-menu-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding-top: 28px; }

/* =========================================================================
   HERO
   ========================================================================= */
.hero { min-height: calc(100vh - 61px); display: grid; align-items: center; padding-block: clamp(48px, 9vh, 96px); position: relative; }
.hero-inner { max-width: 1000px; }
.hero h1 { font-size: clamp(3rem, 8.4vw, 7rem); margin-top: 22px; }
.hero .lede { margin-top: 30px; max-width: 60ch; font-size: 14px; }
.hero-stats { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 36px; font-family: var(--ff-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--body); }
.hero-stats .s { display: inline-flex; align-items: center; gap: 9px; }
.hero-stats .s strong { color: var(--ink); font-weight: 600; }
.hero-stats svg { width: 13px; height: 13px; color: var(--accent); }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-scroll { position: absolute; bottom: 20px; left: 0; font-family: var(--ff-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.26em; color: var(--label); display: inline-flex; align-items: center; gap: 10px; }
.hero-scroll .ln { width: 40px; height: 1px; background: var(--border-strong); position: relative; overflow: hidden; }
.hero-scroll .ln::after { content:""; position: absolute; inset: 0; width: 40%; background: var(--accent); animation: scrollLine 2.4s var(--ease) infinite; }
@keyframes scrollLine { 0%{ transform: translateX(-100%);} 60%,100%{ transform: translateX(280%);} }

/* =========================================================================
   SECTION SHELL
   ========================================================================= */
.section { padding-block: clamp(64px, 9vw, 110px); }
.media-figure { margin: 0; }
.media { width: 100%; height: clamp(240px, 38vw, 420px); object-fit: cover; filter: grayscale(1) contrast(1.02); }
.media-cap { font-family: var(--ff-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--label); padding: 12px var(--gut) 0; display: flex; align-items: center; gap: 10px; }
.media-cap::before { content: ""; width: 18px; height: 1px; background: var(--accent); flex-shrink: 0; }
.sec-grid { display: grid; gap: 28px; }
@media (min-width: 1000px){ .sec-grid.cols { grid-template-columns: 260px 1fr; gap: 40px; } }
.sec-head h2 { font-size: clamp(2.4rem, 6vw, 5.2rem); }
.sec-head .sub { margin-top: 22px; max-width: 60ch; }

/* Approach pillars — gives the section (and the four firm words) real substance */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); margin-top: clamp(40px, 6vw, 72px); }
.pillar { padding: 28px 26px 34px; border-right: 1px solid var(--border); transition: background .25s var(--ease); }
.pillar:last-child { border-right: none; }
.pillar:hover { background: var(--surface-hover); }
.pillar .p-no { font-family: var(--ff-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--label); }
.pillar h3 { font-family: var(--ff-display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.02em; font-size: clamp(18px, 1.8vw, 24px); color: var(--ink); margin: 16px 0 12px; line-height: 1; }
.pillar p { font-size: 13px; line-height: 1.7; color: var(--body); text-wrap: pretty; }

/* =========================================================================
   LIFECYCLE — Gate selector (interactive, accessible, scaffolding metaphor)
   ========================================================================= */
.lifecycle-head { display: grid; gap: 24px; margin-bottom: 44px; }
@media (min-width: 1000px){ .lifecycle-head { grid-template-columns: 1fr 0.62fr; gap: 56px; align-items: end; } }
.lifecycle-head h2 { font-size: clamp(1.6rem, 3.2vw, 2.9rem); line-height: 1.04; }
.lifecycle-head .support { font-size: 14px; line-height: 1.75; }

/* scaffold progress rail */
.gate-rail { position: relative; height: 1px; background: var(--border); margin-bottom: -1px; }
.gate-rail .fill { position: absolute; top: 0; left: 0; height: 1px; background: var(--accent); transition: width .5s var(--ease); }

.gates { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--border); border-bottom: none; }
.gate {
  text-align: left; padding: 20px 18px 22px; border-right: 1px solid var(--border); position: relative;
  display: flex; flex-direction: column; gap: 10px; min-height: 112px;
  background: var(--paper); color: var(--body); transition: background .25s var(--ease), color .25s var(--ease);
}
.gate:last-child { border-right: none; }
.gate:hover { background: var(--surface-hover); }
.gate[aria-selected="true"] { background: var(--accent); color: var(--accent-on); }
.gate .g-no { font-family: var(--ff-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--label); }
.gate[aria-selected="true"] .g-no { color: var(--accent-on); opacity: .8; }
.gate .g-name { font-family: var(--ff-display); font-weight: 800; text-transform: uppercase; font-size: clamp(14px, 1.5vw, 21px); letter-spacing: -0.02em; line-height: 1; color: var(--ink); margin-top: auto; }
.gate[aria-selected="true"] .g-name { color: var(--accent-on); }
.gate .g-dot { position: absolute; top: -4px; left: 18px; width: 7px; height: 7px; background: var(--border-strong); border-radius: 0; transition: background .25s; }
.gate[aria-selected="true"] .g-dot { background: var(--accent); }

/* detail panel */
.gate-detail { border: 1px solid var(--border); border-top: none; padding: clamp(26px, 4vw, 44px); display: grid; gap: 22px; }
@media (min-width: 760px){ .gate-detail { grid-template-columns: 1fr auto; align-items: center; } }
.gate-detail .gd-label { font-family: var(--ff-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--label); }
.gate-detail h3 { font-family: var(--ff-display); font-weight: 800; text-transform: uppercase; letter-spacing: -0.03em; font-size: clamp(1.7rem, 3vw, 2.4rem); color: var(--ink); margin-top: 8px; line-height: 1; }
.gate-detail p { font-size: 14px; line-height: 1.7; color: var(--body); margin-top: 14px; max-width: 46ch; }
.gate-detail .gd-index { font-family: var(--ff-mono); font-size: clamp(40px, 7vw, 80px); font-weight: 600; color: var(--accent); line-height: 1; letter-spacing: -0.04em; }
.gate-swap { animation: gateFade .4s var(--ease); }
@keyframes gateFade { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }

/* =========================================================================
   CONTACT
   ========================================================================= */
.contact-grid { display: grid; gap: 40px; }
@media (min-width: 1000px){ .contact-grid { grid-template-columns: 1fr 1fr; gap: 72px; } }
.contact h2 { font-size: clamp(2.4rem, 6vw, 4.8rem); }
.contact .sub { margin-top: 22px; max-width: 46ch; font-size: 14px; line-height: 1.75; }
.contact-meta { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--border); padding-top: 28px; }
.contact-meta a, .contact-meta span { font-family: var(--ff-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--body); display: inline-flex; align-items: center; gap: 12px; }
.contact-meta a:hover { color: var(--accent); }
.contact-meta .k { color: var(--label); min-width: 92px; }

.form { display: grid; gap: 18px; }
.field label { display: block; font-family: var(--ff-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.22em; color: var(--label); margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; font-family: var(--ff-mono); font-size: 14px; color: var(--ink);
  background: transparent; border: 1px solid var(--border); border-radius: 0;
  padding: 14px 14px; outline: none; transition: border-color .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); }
.field input:focus, .field textarea:focus { border-color: var(--accent); background: var(--surface-hover); }
.field input.err, .field textarea.err { border-color: #B0492E; }
.field .msg { display: block; font-family: var(--ff-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: #B0492E; margin-top: 6px; min-height: 13px; }
.form-row { display: grid; gap: 18px; }
@media (min-width: 560px){ .form-row { grid-template-columns: 1fr 1fr; } }

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer { border-top: 1px solid var(--border); padding-block: 28px; }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; }
.footer .brand { font-family: var(--ff-mono); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.22em; color: var(--ink); }
.footer .footer-tag { font-family: var(--ff-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--label); }
.footer .mailto { font-family: var(--ff-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--accent); }
.footer .mailto:hover { color: var(--ink); }

/* =========================================================================
   REVEAL + TOAST
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
[data-motion="off"] .reveal { opacity: 1; transform: none; transition: none; }
[data-motion="off"] .hero-scroll .ln::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-scroll .ln::after, .gate-swap { animation: none; }
}

.toast { position: fixed; bottom: 24px; right: 24px; z-index: 200; background: var(--ink); color: var(--paper); padding: 16px 22px; font-family: var(--ff-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.16em; display: flex; align-items: center; gap: 12px; transform: translateY(120%); opacity: 0; transition: all .45s var(--ease); max-width: calc(100vw - 48px); }
.toast.show { transform: none; opacity: 1; }
.toast .dot { width: 7px; height: 7px; background: var(--accent); flex-shrink: 0; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 920px){
  .nav-links, .nav-tag { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 760px){
  .pillars { grid-template-columns: 1fr 1fr; }
  .pillar:nth-child(2n){ border-right: none; }
  .pillar:nth-child(-n+2){ border-bottom: 1px solid var(--border); }
  .gates { grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
  .gate { border-bottom: 1px solid var(--border); min-height: 96px; }
  .gate:nth-child(2n){ border-right: none; }
  .gate .g-dot { display: none; }
  .gate-rail { display: none; }
  .gate-detail { border-top: 1px solid var(--border); margin-top: -1px; }
}
@media (max-width: 480px){
  .pillars { grid-template-columns: 1fr; }
  .pillar { border-right: none; border-bottom: 1px solid var(--border); }
  .pillar:last-child { border-bottom: none; }
  .hero-stats { gap: 22px; }
  .hero-scroll { display: none; }
  .footer-in { flex-direction: column; align-items: flex-start; gap: 14px; }
}
