/* =====================================================================
   TREDIT DEAL ROOM LANDING PAGE : base.css (foundation, v2)
   Order: base, theme, product-ui, hero, proof, sections, closing.
   Colours come from the token contract in theme.css (see docs/BUILD-NOTES.md).
   This file holds fixed brand tokens, reset, layout, typography, buttons,
   the inline email field, shared small components, nav and footer.
   Breakpoints: 1100px, 960px (nav), 820px, 560px (max-width).
   ===================================================================== */

:root {
  --tredit-blue: #416CB3;
  --tredit-blue-bright: #78B0F8;
  --amber-deep: #9D6C19;
  --gold: #FFCF40;
  --violet: #7C3AED;
  --violet-soft: #B29BFB;
  --emerald: #34D399;

  --pui-page: #0A0F1E;
  --pui-chrome: #0E1626;
  --pui-panel: #121B30;
  --pui-panel-head: #1C2843;
  --pui-border: #26344F;
  --pui-heading: #DCE3EE;
  --pui-text: #CDD6E4;
  --pui-muted: #A3B2CF;

  --font-display: "Poppins", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --nav-h: 72px;
  --gutter: 24px;
  --maxw: 1240px;
  --section-pad: 156px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
[hidden] { display: none !important; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
}
main { display: block; padding-top: var(--nav-h); overflow-x: clip; }
section[id] { scroll-margin-top: calc(var(--nav-h) + 8px); }

/* ---------- focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 200;
  background: var(--amber); color: var(--on-accent);
  padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }
.defs-svg { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1em; height: 1em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.measure { max-width: 62ch; }

.container {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}
.span-1 { grid-column: span 1; } .span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; } .span-10 { grid-column: span 10; }
.span-11 { grid-column: span 11; } .span-12 { grid-column: span 12; }
.stack-md > * + * { margin-top: 16px; }

.section { padding-block: var(--section-pad); position: relative; }
.section--alt { background: var(--bg-alt); }
.section__head { max-width: 62ch; margin-bottom: 56px; }

/* hero mount: bleeds under the fixed nav */
.hero { position: relative; margin-top: calc(var(--nav-h) * -1); padding-top: var(--nav-h); overflow-x: clip; }

/* ---------- typography ---------- */
h1, h2, h3, .h1, .h2, .h3 {
  font-family: var(--font-display);
  color: var(--heading);
  text-wrap: balance;
}
h1, .h1 { font-size: clamp(40px, 5.2vw, 76px); line-height: 1.03; letter-spacing: -0.03em; font-weight: 600; }
h2, .h2 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 600; }
h3, .h3 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.hd-strong { font-weight: 600; }
.hd-light { font-weight: 300; }
.lead { font-size: 19px; line-height: 1.55; }
.small { font-size: 14px; }
.meta { font-size: 13px; color: var(--muted); }
p { max-width: 62ch; }
.section__head h2 + p, h2 + .lead { margin-top: 20px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px;
  border-radius: 10px; border: 1px solid transparent;
  font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.btn--primary {
  background: var(--amber); color: var(--on-accent);
  box-shadow: inset 0 0 0 1px var(--amber-edge), var(--cta-shadow);
}
.btn--primary:hover { background: var(--amber-hover); text-decoration: none; }
.btn--primary:active { transform: translateY(1px); }
.btn--secondary { background: transparent; color: var(--heading); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--pill-bg); text-decoration: none; }
.btn--nav { height: 40px; padding: 0 16px; font-size: 14px; border-radius: 10px; }
.btn--lg { height: 56px; padding: 0 28px; font-size: 18px; }
.btn--block { width: 100%; }
.text-link { font-weight: 600; }

/* ---------- inline email ---------- */
.email-inline {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  max-width: 520px;
}
.email-inline__input {
  flex: 1 1 220px; min-width: 0; height: 48px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--input-border);
  background: var(--input-bg); color: var(--heading);
}
.email-inline__input::placeholder { color: var(--muted); opacity: 1; }
.email-inline__input[aria-invalid="true"] { border-color: var(--error); }
.email-inline__error, .field__error {
  flex: 1 0 100%; font-size: 14px; color: var(--error); margin-top: 2px;
}
.email-inline--glass .email-inline__input {
  background: var(--surface);
  border-color: var(--input-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- card, pills, placeholders ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: 14px;
  padding: 28px;
  position: relative;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px; border-radius: 999px;
  background: var(--pill-bg); color: var(--text);
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.status--available { color: var(--ok); }
.status--development { color: var(--warn); }
.status--planned { color: var(--muted); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5;
  color: var(--chip-c); background: color-mix(in srgb, var(--chip-c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-c) 35%, transparent);
}
.chip--arranger { --chip-c: var(--party-arranger); }
.chip--lender { --chip-c: var(--party-lender); }
.chip--borrower { --chip-c: var(--party-borrower); }

.placeholder {
  border: 1px dashed var(--ph-line);
  border-radius: 12px;
  position: relative;
}
.placeholder-tag {
  display: inline-flex; align-items: center;
  padding: 1px 9px; border-radius: 999px;
  background: var(--pill-bg); color: var(--muted);
  font-size: 11px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.placeholder-tag--corner { position: absolute; top: 8px; right: 8px; }
.preview-label { font-size: 13px; color: var(--muted); margin-top: 12px; }

/* ---------- logos ---------- */
.lockup { height: 38px; width: auto; overflow: visible; }
.footer__brand .lockup { height: 30px; }
.lockup--dealroom, .lockup--core { aspect-ratio: 3862 / 660; }
.lockup--tredit { aspect-ratio: 1600 / 660; }
.lk-word { fill: var(--logo-word); }
.lk-sub { fill: var(--logo-sub); }
.lk-fm { fill: var(--logo-folder-m); }
.lk-fl { fill: var(--logo-folder-l); }
.lk-core { fill: var(--gold-text); }

/* ---------- header / nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color .2s, border-color .2s;
}
.site-header.is-scrolled, .site-header.is-open {
  background: var(--nav-bg-scrolled);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}
.site-header.is-open { background: var(--bg); }
.nav { height: 100%; display: flex; align-items: center; gap: 28px; }
.nav__brand { display: inline-flex; align-items: center; text-decoration: none; flex: none; border-radius: 6px; }
.nav__menu { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav__menu ul { display: flex; gap: 2px; }
.nav__link {
  display: inline-flex; align-items: center; height: 40px; padding: 0 12px;
  color: var(--text); font-size: 14px; font-weight: 500; text-decoration: none; border-radius: 8px;
}
.nav__link:hover { color: var(--heading); text-decoration: underline; text-underline-offset: 6px; }
.nav__cta { margin-left: 12px; }
.nav__toggle {
  display: none; margin-left: auto; width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--heading);
}
.nav__toggle .icon { width: 22px; height: 22px; }
.nav__toggle .i-close { display: none; }
.nav__toggle[aria-expanded="true"] .i-open { display: none; }
.nav__toggle[aria-expanded="true"] .i-close { display: block; }
.nav__cta-mobile { display: none; }

/* theme toggle: the icon is the destination (sun in dark, moon in light) */
.theme-btn {
  width: 40px; height: 40px; margin-left: 12px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 10px; color: var(--heading);
  transition: background-color .15s, border-color .15s;
}
.theme-btn:hover { background: var(--pill-bg); border-color: var(--border-strong); }
.theme-btn .icon { width: 20px; height: 20px; }
html[data-theme="dark"] .theme-btn__moon, html[data-theme="light"] .theme-btn__sun { display: none; }
.theme-row { display: none; }
.theme-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.theme-seg button {
  height: 44px; padding: 0 20px; background: transparent; border: 0; color: var(--text);
  font-size: 15px; font-weight: 600;
}
.theme-seg button + button { border-left: 1px solid var(--border-strong); }
.theme-seg button[aria-pressed="true"] { background: var(--heading); color: var(--bg); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: 48px; background: var(--bg); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; }
.footer__brand { display: inline-flex; border-radius: 6px; }
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__links a { color: var(--text); font-size: 14px; }
.footer__copy { font-size: 14px; color: var(--muted); }
.footer__note { margin-left: auto; font-size: 13px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 959px) {
  .nav__toggle { display: inline-flex; margin-left: 0; }
  .nav__cta-mobile { display: inline-flex; margin-left: auto; }
  .nav__menu {
    display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 8px; margin: 0;
    padding: 12px var(--gutter) 24px; background: var(--bg); border-bottom: 1px solid var(--border);
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
  }
  .nav__menu.is-open { display: flex; }
  .nav__menu ul { flex-direction: column; gap: 0; }
  .nav__link { height: 48px; padding: 0 4px; font-size: 16px; border-bottom: 1px solid var(--border); border-radius: 0; width: 100%; }
  .nav__menu > .nav__cta, .nav__menu > .theme-btn { display: none; }
  .theme-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px 0; }
  .theme-row__label { font-size: 16px; font-weight: 500; color: var(--text); }
}
@media (max-width: 820px) {
  :root { --section-pad: 118px; --nav-h: 64px; }
  .grid > [class*="span-"] { grid-column: 1 / -1; }
  .section__head { margin-bottom: 40px; }
  .footer__note { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 560px) {
  :root { --gutter: 20px; --section-pad: 88px; }
  .btn--nav { padding: 0 12px; font-size: 13px; }
  .lockup { height: 30px; }
  .footer__brand .lockup { height: 30px; }
  .nav { gap: 10px; }
  .card { padding: 22px; }
  .email-inline .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- mobile QA pass: tap targets, gutters, small text (phones and tablets only) ---------- */
@media (max-width: 820px) {
  .nav__toggle { flex: none; }
  .text-link, .footer__links a, .footer__brand { display: inline-flex; align-items: center; min-height: 44px; }
  .footer__links { gap: 0 12px; }
  .footer__links a { padding-inline: 6px; }
  .ea-pill span { min-height: 44px; height: auto; }
  .preview-label, .ea-privacy, .footer__note, .footer__copy { font-size: 14px; }
  .hero--c .hc-label__line { font-size: 14px; }
  .hero--c .hc-preview { font-size: 13px; }
}
@media (max-width: 400px) {
  .nav { gap: 8px; }
  .site-header .lockup { height: 25px; }
  .btn--nav { padding: 0 10px; font-size: 13px; }
  .nav__cta-mobile { margin-left: auto; }
}
