/* ══════════════════════════════════════════════
   UnderwriteAI — Shared Design System
   Light theme · Electric Blue · Plus Jakarta Sans
   ══════════════════════════════════════════════ */

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

:root {
  --bg:        #F8F9FC;
  --surface:   #FFFFFF;
  --border:    #E4E8F0;
  --border2:   #D0D6E4;
  --blue:      #2B5FF3;
  --blue-lt:   #EEF2FF;
  --blue-dim:  #6B8EFF;
  --ink:       #0D1117;
  --ink2:      #374151;
  --ink3:      #6B7280;
  --ink4:      #9CA3AF;
  --green:     #059669;
  --green-lt:  #D1FAE5;
  --amber:     #D97706;
  --amber-lt:  #FEF3C7;
  --red:       #DC2626;
  --red-lt:    #FEE2E2;
  --purple:    #7C3AED;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,.08), 0 8px 32px rgba(0,0,0,.06);

  /* legacy var aliases (older markup) */
  --navy: var(--ink);
  --teal: var(--blue);
  --white: #ffffff;
  --text: var(--ink2);
  --muted: var(--ink3);
  --gray: var(--bg);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ── LAYOUT ── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }
.section-white { background: var(--surface); padding: 96px 0; }
.section-gray { background: var(--bg); padding: 96px 0; }
.section-navy, .section-teal, .stack-section-page {
  background: var(--ink); color: #E2E8F0; padding: 96px 0;
}
.section-teal { background: var(--blue); color: #fff; }
hr.section-divider { border: none; border-top: 1px solid var(--border); margin: 0; }

.section-header { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-header h2 { font-size: clamp(26px, 3.5vw, 38px); font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.15; margin-bottom: 12px; }
.section-navy .section-header h2, .stack-section-page .section-header h2 { color: #F2F4F8; }
.section-header p { font-size: 15px; color: var(--ink3); line-height: 1.65; }
.section-navy .section-header p, .stack-section-page .section-header p { color: #8A99B3; }

.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); margin-bottom: 14px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-20 { gap: 20px; }

/* ── NAV ── */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(248,249,252,.88);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s;
}
.header.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,.06); }
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo-link { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 30px; height: 30px; background: var(--blue); border-radius: 7px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-mark svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.logo-text { font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.logo-text span { color: var(--blue); }

.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-link { font-size: 13px; font-weight: 500; color: var(--ink2); padding: 6px 12px; border-radius: 6px; transition: all .15s; }
.nav-link:hover, .nav-link.active { background: var(--blue-lt); color: var(--blue); }
.header-btn { font-size: 13px; font-weight: 600; background: var(--blue); color: #fff !important; padding: 8px 18px !important; border-radius: 7px; margin-left: 6px; }
.header-btn:hover { background: #1E4FE0 !important; box-shadow: 0 2px 8px rgba(43,95,243,.3); }

.mobile-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.mobile-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: all .2s; }

/* ── HERO (inner pages) ── */
.hero {
  padding: 148px 0 72px; background: var(--ink); color: #F2F4F8; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(#1E2430 1px, transparent 1px), linear-gradient(90deg, #1E2430 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, black 20%, transparent 100%);
  opacity: .6;
}
.hero .container { position: relative; }
.hero h1 { font-size: clamp(30px, 4.5vw, 46px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 16px; }
.hero-sub { font-size: 16px; color: #8A99B3; max-width: 620px; margin: 0 auto; line-height: 1.65; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 11px 22px; border-radius: 8px; transition: all .15s; cursor: pointer; border: none; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 2px 8px rgba(43,95,243,.25); }
.btn-primary:hover { background: #1E4FE0; box-shadow: 0 4px 16px rgba(43,95,243,.35); transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--blue); border: 1px solid var(--border2); }
.btn-secondary:hover { border-color: var(--blue-dim); background: var(--blue-lt); }
.section-teal .btn-secondary { background: #fff; color: var(--blue); border: none; }
.btn-ghost { background: transparent; color: var(--blue); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--blue-lt); border-color: var(--blue-dim); }
.btn-sm { font-size: 12px; padding: 8px 16px; }
.btn-disabled { background: var(--border); color: var(--ink4); cursor: not-allowed; }

/* ── CARDS ── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; display: flex; flex-direction: column; transition: all .2s;
}
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-navy-top { border-top: 3px solid var(--blue); }
.card-teal-top { border-top: 3px solid var(--blue); }
.text-center { text-align: center; align-items: center; }

/* ── PILLS / BADGES ── */
.credential-pill, .badge-domain, .badge-layer {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: var(--bg); border: 1px solid var(--border); color: var(--ink3);
  padding: 4px 10px; border-radius: 20px; margin: 2px;
}
.badge-domain { background: var(--blue-lt); color: var(--blue); border-color: transparent; font-weight: 700; }
.badge-layer { font-family: 'Courier New', monospace; font-size: 10px; }
.pill-container { display: flex; flex-wrap: wrap; gap: 6px; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 4px 12px; border-radius: 20px; }
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-in-build { background: var(--amber-lt); color: var(--amber); }
.badge-scoped { background: var(--border); color: var(--ink3); }
.badge-complete { background: var(--green-lt); color: var(--green); }
.badge-coming { font-size: 10px; color: var(--ink4); font-weight: 500; }

/* ── TIMELINE (about.html) ── */
.timeline-container { max-width: 760px; margin: 0 auto; position: relative; padding-left: 32px; }
.timeline-container::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border2); }
.timeline-item { position: relative; padding-bottom: 32px; }
.timeline-item::before { content: ''; position: absolute; left: -32px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--blue); border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--blue); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-year { font-size: 12px; font-weight: 700; color: var(--blue); letter-spacing: .04em; margin-bottom: 4px; font-family: 'Courier New', monospace; }
.timeline-role { font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.timeline-org { font-size: 13px; font-weight: 600; color: var(--ink3); margin: 2px 0 6px; }
.timeline-desc { font-size: 13px; color: var(--ink3); line-height: 1.6; max-width: 560px; }

/* ── TEAM ── */
.team-card { padding: 32px; }
.team-photo { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; }
.team-photo-placeholder { width: 72px; height: 72px; border-radius: 12px; background: var(--blue-lt); color: var(--blue); font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.team-title { font-size: 12px; color: var(--blue); font-weight: 600; }
.team-bio-full p { font-size: 13px; color: var(--ink3); line-height: 1.65; margin-bottom: 12px; }
.team-social-links { display: flex; gap: 10px; }
.team-social-link { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border2); display: flex; align-items: center; justify-content: center; color: var(--ink3); transition: all .15s; }
.team-social-link:hover { color: var(--blue); border-color: var(--blue-dim); background: var(--blue-lt); }

/* ── LAYER SECTIONS (framework.html) ── */
.layer-section { padding: 56px 0; }
.layer-layout { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 32px; position: relative; }
.layer-num-watermark { font-size: 88px; font-weight: 800; color: var(--border2); line-height: 1; text-align: center; font-family: 'Courier New', monospace; }
.layer-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); background: var(--blue-lt); padding: 4px 12px; border-radius: 20px; margin-bottom: 12px; }
.layer-title { font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; margin-bottom: 8px; }
.layer-question { font-size: 15px; font-style: italic; color: var(--ink2); margin-bottom: 12px; }
.layer-desc { font-size: 14px; color: var(--ink3); line-height: 1.65; margin-bottom: 14px; max-width: 640px; }
.layer-ai-role { font-size: 13px; color: var(--ink2); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; display: inline-block; }
.layer-ai-role strong { color: var(--blue); }

/* ── RATE TABLE ── */
.rate-table-container { overflow-x: auto; margin: 20px 0; }
.rate-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rate-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink4); padding: 10px 14px; border-bottom: 2px solid var(--border); }
.rate-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--ink2); }
.rate-table tr:last-child td { border-bottom: none; }

/* ── PROJECT DETAIL CARDS (projects.html) ── */
.project-detail-card { margin-bottom: 20px; }
.project-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.project-card-title-group { display: flex; flex-direction: column; gap: 2px; }
.project-num { font-size: 11px; font-weight: 700; color: var(--blue); letter-spacing: .08em; font-family: 'Courier New', monospace; }
.project-card-title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.project-card-desc { font-size: 13px; color: var(--ink3); line-height: 1.65; margin-bottom: 20px; }
.project-card-assets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.asset-indicator { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; transition: all .15s; }
.asset-indicator.asset-active { border-color: var(--blue-dim); background: var(--blue-lt); }
.asset-indicator.asset-active:hover { box-shadow: var(--shadow); }
.asset-label { font-size: 11px; font-weight: 700; color: var(--ink); }
.asset-status { font-size: 11px; color: var(--ink4); }
.asset-in-progress .asset-status { color: var(--amber); font-weight: 600; }
.project-grid-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.project-legend { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; font-size: 13px; }

/* ── INSIGHTS CARDS ── */
.filter-controls { display: flex; gap: 8px; justify-content: center; margin-bottom: 40px; flex-wrap: wrap; }
.filter-btn { font-size: 13px; font-weight: 600; color: var(--ink3); background: var(--surface); border: 1px solid var(--border); padding: 8px 18px; border-radius: 20px; cursor: pointer; transition: all .15s; }
.filter-btn:hover { border-color: var(--blue-dim); color: var(--blue); }
.filter-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.insight-detail-card { display: flex; gap: 0; padding: 0; overflow: hidden; margin-bottom: 20px; }
.insight-media-wrapper { width: 220px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; position: relative; }
.insight-media-text { font-size: 13px; font-weight: 800; letter-spacing: .12em; color: rgba(255,255,255,.5); }
.play-button-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.play-button-overlay svg { width: 44px; height: 44px; background: rgba(255,255,255,.15); border-radius: 50%; padding: 10px; fill: #fff; }
.insight-content-wrapper { padding: 24px 28px; flex: 1; }
.insight-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.insight-link-coming { font-size: 12px; color: var(--ink4); font-weight: 500; }

/* ── FORM ── */
.form-container { max-width: 640px; margin: 0 auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border2); border-radius: 8px; padding: 11px 14px;
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-lt); }
.form-textarea { min-height: 120px; resize: vertical; }
.form-error { display: none; font-size: 12px; color: var(--red); margin-top: 5px; }
.form-group.error .form-input, .form-group.error .form-select, .form-group.error .form-textarea { border-color: var(--red); }
.form-group.error .form-error { display: block; }

/* ── TRUST SIGNALS / STATS ── */
.trust-signals { text-align: center; }
.trust-col p { font-size: 14px; color: var(--ink3); line-height: 1.6; max-width: 280px; margin: 0 auto; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat-item .stat-number { font-size: 30px; font-weight: 800; color: #F2F4F8; letter-spacing: -.02em; }
.stat-item .stat-label { font-size: 12px; color: #8A99B3; margin-top: 4px; }

/* ── FOOTER ── */
.footer { background: var(--ink); color: #6B7A99; padding: 48px 0 32px; }
.footer-top { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.logo-placeholder { font-size: 15px; font-weight: 700; color: #E2E8F0; letter-spacing: -.02em; }
.footer-tagline { font-size: 12px; color: #4B5A77; line-height: 1.6; margin-top: 10px; max-width: 240px; }
.footer-links-col a, .footer-links-col p, .footer-links-col span { font-size: 13px; color: #6B7A99; display: block; margin-bottom: 8px; transition: color .15s; }
.footer-link:hover { color: #E2E8F0; }
.footer-socials { display: flex; gap: 12px; }
.footer-social-link { color: #6B7A99; transition: color .15s; }
.footer-social-link:hover { color: var(--blue-dim); }
.footer-bottom { padding-top: 24px; border-top: 1px solid #1E2430; }
.footer-bottom-flex { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.footer-copyright, .footer-disclaimer { font-size: 12px; color: #3B4A6B; }

/* ── ANIMATIONS ── */
.fade-in-up, .fade-up { opacity: 0; transform: translateY(20px); transition: opacity .5s, transform .5s; }
.fade-in-up.visible, .fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4, .stats-grid, .footer-top { grid-template-columns: 1fr 1fr; }
  .project-card-assets { grid-template-columns: 1fr 1fr; }
  .layer-layout { grid-template-columns: 1fr; text-align: center; }
  .layer-num-watermark { font-size: 56px; }
}
@media (max-width: 768px) {
  .nav-menu { display: none; }
  .mobile-toggle { display: flex; }
  .grid-2, .grid-3, .grid-4, .stats-grid, .footer-top { grid-template-columns: 1fr; }
  .insight-detail-card { flex-direction: column; }
  .insight-media-wrapper { width: 100%; height: 100px; }
  .form-row { grid-template-columns: 1fr; }
  .project-card-assets { grid-template-columns: 1fr 1fr; }
}

/* Mobile nav open state */
.nav-menu.mobile-open {
  display: flex; flex-direction: column; position: fixed; top: 60px; left: 0; right: 0;
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px 24px; gap: 4px;
  box-shadow: var(--shadow-md);
}
