/* ============================================================
   Flank Insights — shared design system
   Canonical stylesheet. Edit here, not in page <style> blocks.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --black: #000000;
  --white: #FFFFFF;
  --grey: #9E9E9E;
  --light-grey: #F6F6F6;
  --purple: #8F87FF;
  --purple-light: #D5DAEF;
  --red: #FF8787;
  --red-light: #EFD5D5;
  --green: #E1EFD5;
  --orange: #FFBF87;
}

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

html, body { max-width: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── HERO ── */
.hero { background: var(--black); color: var(--white); padding: 80px 60px 100px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -200px; right: -200px; width: 600px; height: 600px; background: radial-gradient(circle, rgba(143,135,255,0.12) 0%, transparent 70%); pointer-events: none; }
.hero-label { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--purple); margin-bottom: 32px; font-weight: 600; }
.hero h1 { font-family: 'DM Serif Display', serif; font-size: clamp(36px, 5vw, 64px); line-height: 1.08; max-width: 820px; margin-bottom: 28px; font-weight: 400; }
.hero-sub { font-size: 18px; color: var(--grey); max-width: 660px; line-height: 1.6; }
.hero-meta { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 40px; font-size: 13px; color: var(--grey); }
.hero-meta span { color: var(--white); font-weight: 500; }
.hero-nav { margin-top: 48px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-nav a { display: inline-block; padding: 8px 20px; border-radius: 40px; font-size: 13px; font-weight: 500; text-decoration: none; color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.15); transition: all 0.25s; }
.hero-nav a:hover, .hero-nav a.active { color: var(--white); border-color: var(--purple); background: rgba(143,135,255,0.12); }

/* ── CONTAINER ── */
.container { max-width: 860px; margin: 0 auto; padding: 0 32px; }

/* ── SECTIONS + TYPOGRAPHY ── */
section { padding: 72px 0; }
section + section { border-top: 1px solid #eee; }
.section-num { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--purple); font-weight: 600; margin-bottom: 16px; }
h2 { font-family: 'DM Serif Display', serif; font-size: 32px; line-height: 1.15; margin-bottom: 24px; font-weight: 400; }
h3 { font-family: 'DM Serif Display', serif; font-size: 22px; line-height: 1.3; margin-bottom: 16px; margin-top: 40px; font-weight: 400; }
p { font-size: 16px; color: #333; margin-bottom: 20px; line-height: 1.7; }
p.lead { font-size: 19px; color: var(--black); line-height: 1.65; }
em.key { font-style: normal; color: var(--black); font-weight: 600; }

/* ── ARCHITECTURE / FEATURE GRID ── */
.arch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 40px 0; }
.arch-grid.three-col { grid-template-columns: 1fr 1fr 1fr; }
.arch-card { border-radius: 14px; padding: 28px 24px; }
.arch-card .a-num { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 600; margin-bottom: 8px; }
.arch-card .a-title { font-family: 'DM Serif Display', serif; font-size: 18px; margin-bottom: 8px; font-weight: 400; }
.arch-card .a-text { font-size: 14px; color: #555; line-height: 1.55; }

/* ── TASK LIST ── */
.task-list { margin: 40px 0; }
.task-item { display: flex; align-items: baseline; gap: 16px; padding: 16px 0; border-bottom: 1px solid #eee; }
.task-item:first-child { border-top: 1px solid #eee; }
.task-name { font-weight: 600; font-size: 15px; min-width: 160px; flex-shrink: 0; color: var(--black); }
.task-desc { font-size: 14px; color: #555; line-height: 1.55; }
.task-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); flex-shrink: 0; margin-top: 6px; }

/* ── TWO-COLUMN + CHECK LISTS ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 40px 0; }
.col-title { font-family: 'DM Serif Display', serif; font-size: 20px; margin-bottom: 20px; font-weight: 400; }
.check-list { list-style: none; }
.check-list li { font-size: 14px; color: #333; padding: 8px 0; border-bottom: 1px solid #f0f0f0; display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.check-list li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 7px; }
.check-list.purple li::before { background: var(--purple); }
.check-list.orange li::before { background: var(--orange); }
.check-list.green li::before { background: #6fad6f; }
.check-list.red li::before { background: var(--red); }

/* ── CALLOUTS ── */
.callout { background: var(--black); color: var(--white); border-radius: 16px; padding: 40px 36px; margin: 48px 0; position: relative; overflow: hidden; }
.callout::after { content: ''; position: absolute; bottom: -80px; right: -80px; width: 250px; height: 250px; background: radial-gradient(circle, rgba(143,135,255,0.15) 0%, transparent 70%); }
.callout .callout-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--purple); margin-bottom: 12px; font-weight: 600; }
.callout p { color: rgba(255,255,255,0.85); font-size: 15px; line-height: 1.65; position: relative; z-index: 1; }
.callout p strong { color: var(--white); }
.callout.question { background: var(--light-grey); color: var(--black); border: 2px solid #e0e0e0; }
.callout.question::after { background: radial-gradient(circle, rgba(143,135,255,0.06) 0%, transparent 70%); }
.callout.question p { color: #444; font-size: 16px; }
.callout.question p strong { color: var(--black); }

/* ── SPEC / DATA TABLE ── */
.spec-table { width: 100%; border-collapse: collapse; margin: 40px 0; font-size: 14px; }
.spec-table thead th { background: var(--black); color: var(--white); text-align: left; padding: 14px 16px; font-weight: 600; font-size: 12px; letter-spacing: 0.5px; text-transform: uppercase; }
.spec-table thead th:first-child { border-radius: 8px 0 0 0; }
.spec-table thead th:last-child { border-radius: 0 8px 0 0; }
.spec-table tbody td { padding: 14px 16px; border-bottom: 1px solid #eee; vertical-align: top; line-height: 1.5; }
.spec-table tbody tr:nth-child(even) { background: var(--light-grey); }
.spec-table .label-cell { font-weight: 600; white-space: nowrap; min-width: 180px; }

/* ── FLOW STEPS ── */
.flow-step { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 28px; }
.flow-num { width: 36px; height: 36px; border-radius: 50%; background: var(--purple); color: var(--white); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.flow-content { flex: 1; }
.flow-content .flow-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.flow-content .flow-desc { font-size: 14px; color: #555; line-height: 1.55; }

/* ── STAT CARDS ── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; margin: 40px 0; }
.stat-card { background: var(--light-grey); border-radius: 12px; padding: 28px 24px; text-align: center; }
.stat-card .num { font-family: 'DM Serif Display', serif; font-size: 40px; color: var(--black); line-height: 1; margin-bottom: 8px; }
.stat-card .label { font-size: 13px; color: var(--grey); line-height: 1.4; }

/* ── TIMELINE ── */
.timeline { position: relative; margin: 48px 0; padding-left: 32px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--purple), var(--red), var(--grey)); }
.tl-item { position: relative; margin-bottom: 36px; padding-left: 24px; }
.tl-item::before { content: ''; position: absolute; left: -30px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 3px solid var(--purple); }
.tl-item.fail::before, .tl-item.warn::before { border-color: var(--red); }
.tl-item.money::before { border-color: var(--orange); }
.tl-item.gov::before { border-color: #6fad6f; }
.tl-item .tl-date { font-size: 12px; font-weight: 600; color: var(--purple); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.tl-item.fail .tl-date, .tl-item.warn .tl-date { color: var(--red); }
.tl-item.money .tl-date { color: var(--orange); }
.tl-item.gov .tl-date { color: #6fad6f; }
.tl-item .tl-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.tl-item .tl-desc { font-size: 14px; color: #666; line-height: 1.55; }

/* ── BAR CHART ── */
.chart-container { margin: 48px 0; background: var(--light-grey); border-radius: 16px; padding: 36px 32px; }
.chart-title { font-family: 'DM Serif Display', serif; font-size: 20px; margin-bottom: 8px; }
.chart-subtitle { font-size: 13px; color: var(--grey); margin-bottom: 32px; }
.bar-group { display: flex; align-items: center; margin-bottom: 18px; }
.bar-label { width: 160px; flex-shrink: 0; font-size: 13px; font-weight: 500; text-align: right; padding-right: 16px; }
.bar-track { flex: 1; height: 32px; background: #e8e8e8; border-radius: 6px; overflow: visible; position: relative; }
.bar-fill { height: 100%; border-radius: 6px; display: flex; align-items: center; justify-content: flex-end; padding-right: 12px; font-size: 12px; font-weight: 600; color: var(--white); white-space: nowrap; }
.bar-fill.label-out { justify-content: flex-start; padding: 0; overflow: visible; position: relative; }
.bar-fill.label-out span { position: absolute; left: calc(100% + 10px); color: #333; font-size: 12px; font-weight: 600; }
.bar-fill.purple { background: var(--purple); }
.bar-fill.red { background: var(--red); }
.bar-fill.orange { background: var(--orange); color: var(--black); }
.bar-fill.dark { background: #333; }
.bar-fill.green { background: #6fad6f; }

/* ── PRICING COLUMNS ── */
.pricing-vis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 48px 0; }
.price-col { background: var(--white); border: 2px solid #eee; border-radius: 16px; padding: 32px 24px; text-align: center; transition: transform 0.3s, border-color 0.3s; }
.price-col:hover { transform: translateY(-4px); border-color: var(--purple); }
.price-col .era { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--grey); margin-bottom: 12px; }
.price-col .model-name { font-family: 'DM Serif Display', serif; font-size: 20px; margin-bottom: 16px; }
.price-col .price-range { font-size: 32px; font-weight: 700; color: var(--black); margin-bottom: 4px; }
.price-col .price-unit { font-size: 13px; color: var(--grey); margin-bottom: 20px; }
.price-col .price-detail { font-size: 13px; color: #666; line-height: 1.6; text-align: left; }

/* ── DILEMMA / TRI GRIDS ── */
.dilemma-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 40px 0; }
.dilemma-card { border-radius: 14px; padding: 28px 24px; }
.dilemma-card .d-icon { font-size: 28px; margin-bottom: 12px; }
.dilemma-card .d-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.dilemma-card .d-text { font-size: 14px; color: #555; line-height: 1.55; }
.tri-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin: 40px 0; }
.tri-card { border-radius: 14px; padding: 28px 24px; }
.tri-card .d-icon { font-size: 28px; margin-bottom: 12px; }
.tri-card .d-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.tri-card .d-text { font-size: 14px; color: #555; line-height: 1.55; }

/* ── DIRECTORY CHIPS ── */
.directory-strip { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0; }
.dir-chip { background: var(--light-grey); border-radius: 40px; padding: 10px 20px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.dir-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); }
.dir-chip.startup .dot { background: var(--orange); }
.dir-chip.patent .dot { background: #6fad6f; }
.dir-chip.enterprise .dot { background: var(--red); }

/* ── CTA BANNER ── */
.cta-banner { background: var(--black); padding: 72px 60px; position: relative; overflow: hidden; }
.cta-banner::before { content: ''; position: absolute; top: -150px; right: -150px; width: 500px; height: 500px; background: radial-gradient(circle, rgba(143,135,255,0.1) 0%, transparent 70%); pointer-events: none; }
.cta-inner { max-width: 860px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.cta-card { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 16px; padding: 36px 28px; position: relative; z-index: 1; }
.cta-card:hover { border-color: var(--purple); transition: border-color 0.3s; }
.cta-card .cta-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--purple); font-weight: 600; margin-bottom: 12px; }
.cta-card h3 { font-family: 'DM Serif Display', serif; font-size: 20px; color: var(--white); margin-bottom: 12px; font-weight: 400; margin-top: 0; }
.cta-card p { font-size: 14px; color: rgba(255,255,255,0.65); line-height: 1.6; margin-bottom: 20px; }
.cta-btn { display: inline-block; padding: 12px 24px; border-radius: 8px; font-size: 14px; font-weight: 600; text-decoration: none; transition: opacity 0.2s; }
.cta-btn:hover { opacity: 0.85; }
.cta-btn.purple { background: var(--purple); color: var(--white); }
.cta-btn.orange { background: var(--orange); color: var(--black); }

/* ── FOOTER ── */
.footer { background: var(--black); color: var(--grey); padding: 48px 60px; font-size: 13px; line-height: 1.6; border-top: 1px solid rgba(255,255,255,0.08); }
.footer a { color: var(--purple); text-decoration: none; }
.footer p { color: var(--grey); margin-bottom: 0; }
.footer .footer-brand { font-family: 'DM Serif Display', serif; font-size: 20px; color: var(--white); margin-bottom: 12px; }

/* ============================================================
   RESPONSIVE — mobile (<=700px)
   Primary goal: no horizontal page scroll. Content that can't
   fit is stacked, wrapped, or scrolled within its own container.
   ============================================================ */
@media (max-width: 700px) {
  /* Safety net against any overflow bleeding through */
  html, body { overflow-x: hidden; }

  /* Hero + CTA banner: narrower horizontal padding */
  .hero { padding: 48px 24px 64px; }
  .hero-meta { flex-direction: column; gap: 8px; }
  .hero-nav { gap: 8px; }
  .hero-nav a { padding: 6px 14px; font-size: 12px; }

  /* Grids collapse to single column */
  .arch-grid, .arch-grid.three-col, .two-col, .dilemma-grid, .tri-grid, .pricing-vis, .cta-inner { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }

  /* Task items: stack name above description */
  .task-item { flex-wrap: wrap; align-items: flex-start; }
  .task-name { min-width: 0; flex: 0 0 auto; }
  .task-desc { flex: 1 1 100%; padding-left: 24px; margin-top: 2px; }

  /* Spec tables: allow cell wrapping, fall back to horizontal scroll within the table */
  .spec-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .spec-table thead, .spec-table tbody, .spec-table tr { width: 100%; }
  .spec-table .label-cell { white-space: normal; min-width: 0; }
  .spec-table thead th, .spec-table tbody td { word-break: break-word; padding: 10px 12px; }

  /* Bar chart labels narrower on mobile */
  .bar-label { width: 100px; font-size: 11px; }

  /* CTA banner tighter padding */
  .cta-banner { padding: 48px 24px; }

  /* Footer a bit tighter */
  .footer { padding: 36px 24px; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  @page { size: A4; margin: 18mm 16mm; }
  body { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; font-size: 10px; }
  .hero { padding: 40px 36px 52px; }
  .hero h1 { font-size: 36px; } .hero-sub { font-size: 14px; }
  .hero-meta { font-size: 11px; gap: 24px; margin-top: 28px; }
  .hero-nav { display: none; }
  .container { padding: 0 8px; } section { padding: 36px 0; }
  h2 { font-size: 24px; margin-bottom: 16px; } h3 { font-size: 18px; margin-top: 24px; margin-bottom: 10px; }
  p { font-size: 12px; margin-bottom: 12px; line-height: 1.6; } p.lead { font-size: 14px; }
  .section-num { font-size: 9px; margin-bottom: 10px; }
  .arch-grid { gap: 12px; margin: 20px 0; } .arch-card { padding: 16px 14px; border-radius: 8px; }
  .arch-card .a-num { font-size: 9px; } .arch-card .a-title { font-size: 14px; } .arch-card .a-text { font-size: 10px; }
  .flow-step { margin-bottom: 14px; gap: 12px; } .flow-num { width: 24px; height: 24px; font-size: 11px; }
  .flow-content .flow-title { font-size: 12px; } .flow-content .flow-desc { font-size: 10px; }
  .task-list { margin: 20px 0; } .task-item { padding: 8px 0; gap: 10px; }
  .task-name { font-size: 11px; min-width: 120px; } .task-desc { font-size: 10px; }
  .spec-table { font-size: 10px; margin: 20px 0; } .spec-table thead th { padding: 8px 10px; font-size: 9px; }
  .callout { padding: 20px 22px; margin: 24px 0; border-radius: 10px; } .callout p { font-size: 11px; }
  .two-col { gap: 24px; margin: 20px 0; } .col-title { font-size: 15px; } .check-list li { font-size: 10px; padding: 5px 0; }
  .footer { padding: 28px 36px; }
  .cta-banner { display: none; }
  .page-break-before { break-before: page; }
  section, .arch-grid, .spec-table, .callout, .two-col, .task-list { break-inside: avoid; }
}
