/* ==========================================================================
   LUMEO — Continuous Financial Control Platform
   Design system implementing Brand Book & Design System v1.0 (Volume 01)
   Semantic tokens · Inter + IBM Plex Mono · WCAG 2.2 AA baseline
   ========================================================================== */

:root {
  /* --- Brand palette (reference hex from Brand Book §17) --- */
  --c-dark: #1A1A2E;          /* Primary Dark */
  --c-dark-2: #152238;        /* text on light bg (14.21:1 on #F0F2F5) */
  --c-mint: #5B9B8E;          /* Primary Mint — large text/icons/borders only */
  --c-mint-2: #6BAA96;        /* Secondary Mint */
  --c-mint-deep: #2F6F63;     /* Deep Mint — accessible action (5.87:1 white text) */
  --c-mint-deep-h: #275c52;   /* hover */
  --c-bg: #F0F2F5;            /* Light Background */
  --c-white: #FFFFFF;
  --c-info: #4F7DD4;
  --c-success: #3E8A5B;
  --c-warning: #C78318;
  --c-critical: #B84D56;
  --c-text-2: #667386;        /* Secondary text (4.81:1 on white) */
  --c-border: #D7DEE3;

  /* --- Semantic tokens --- */
  --bg-page: var(--c-white);
  --bg-alt: var(--c-bg);
  --bg-dark: var(--c-dark);
  --surface: var(--c-white);
  --text: #1A1A2E;
  --text-muted: var(--c-text-2);
  --text-invert: #F0F2F5;
  --text-invert-muted: #AEB8C7;
  --line: var(--c-border);
  --action: var(--c-mint-deep);
  --action-hover: var(--c-mint-deep-h);
  --focus: #2F6F63;

  /* --- Type --- */
  --font: "Inter", "SF Pro Text", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  /* --- Spacing (8-point) --- */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px; --s7: 64px; --s8: 96px;

  --radius: 12px; --radius-sm: 8px;
  --maxw: 1200px;
  --shadow-sm: 0 1px 2px rgba(26,26,46,.06), 0 1px 3px rgba(26,26,46,.05);
  --shadow: 0 10px 30px rgba(26,26,46,.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg-page);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

/* Typography scale (Brand Book §19) */
h1,h2,h3,h4 { color: var(--c-dark); margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
.display { font-size: clamp(2.2rem, 4.5vw, 3.5rem); line-height: 1.08; letter-spacing: -.02em; }
h1, .h1 { font-size: clamp(2rem, 3.6vw, 2.5rem); line-height: 1.2; }   /* 40/48 */
h2, .h2 { font-size: clamp(1.5rem, 2.4vw, 1.75rem); line-height: 1.28; } /* 28/36 */
h3, .h3 { font-size: 1.25rem; line-height: 1.4; }                        /* 20/28 */
p { margin: 0 0 1rem; }
.lead { font-size: 1.125rem; line-height: 1.55; color: #33405c; }        /* Body L 18/28 */
.caption { font-size: .75rem; line-height: 1.5; color: var(--text-muted); }
.data, .mono { font-family: var(--mono); font-size: .875rem; font-variant-numeric: tabular-nums; }
a { color: var(--action); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--action-hover); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s4); }
@media (max-width: 640px){ .container { padding: 0 var(--s2); } }
.narrow { max-width: 780px; }

section { padding: var(--s8) 0; }
@media (max-width: 640px){ section { padding: var(--s7) 0; } }
.tight { padding: var(--s6) 0; }
.bg-alt { background: var(--bg-alt); }
.bg-dark { background: var(--bg-dark); color: var(--text-invert); }
.bg-dark h1,.bg-dark h2,.bg-dark h3 { color: #fff; }
.bg-dark p,.bg-dark .lead { color: var(--text-invert-muted); }

/* Skip link */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--c-dark); color: #fff; padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* Eyebrow / heads */
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--c-mint-deep); margin-bottom: var(--s2); }
.bg-dark .eyebrow { color: #7fc4b6; }
.section-head { max-width: 760px; margin-bottom: var(--s6); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: inherit; font-weight: 600; font-size: 1rem; line-height: 1;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius-sm); border: 1.5px solid transparent; cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, color .12s; }
.btn-primary { background: var(--action); color: #fff; }
.btn-primary:hover { background: var(--action-hover); color: #fff; }
.btn-secondary { background: transparent; color: var(--c-dark); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--action); color: var(--action); }
.bg-dark .btn-secondary,
.cta-band .btn-secondary { color: #fff; border-color: rgba(255,255,255,.4); }
.bg-dark .btn-secondary:hover,
.cta-band .btn-secondary:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.08); }
.btn-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: var(--action); }
.btn-link:hover { text-decoration: underline; }
.btn-link .arw { transition: transform .12s; }
.btn-link:hover .arw { transform: translateX(3px); }

/* Focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px;
}

/* Header / nav */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.94); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; gap: var(--s5); height: 72px; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s4); }
@media (max-width: 640px){ .nav { padding: 0 var(--s2); } }
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 42px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: var(--s4); margin-left: auto; }
.nav-links a:not(.btn) { color: #33405c; font-weight: 500; font-size: .98rem; text-decoration: none; padding: 6px 0; }
.nav-links a:not(.btn):hover, .nav-links a[aria-current="page"] { color: var(--c-dark); }
.nav-links a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--action); }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--c-dark); margin: 4px 0; border-radius: 2px; }
@media (max-width: 900px){
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px var(--s3) var(--s3); gap: 0; }
  .nav-links.open a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav-links.open .btn { margin-top: var(--s2); justify-content: center; }
}

/* Hero */
.hero { padding: var(--s8) 0 var(--s7); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--s7); align-items: center; }
@media (max-width: 900px){ .hero-grid { grid-template-columns: 1fr; gap: var(--s5); } }
.hero .sub { font-size: 1.15rem; line-height: 1.6; color: #33405c; margin: var(--s2) 0 var(--s4); max-width: 560px; }
.hero-cta { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s3); }
.brandline { font-family: var(--font); font-weight: 600; color: var(--c-mint-deep); letter-spacing: .01em; }

/* Grid + cards */
.grid { display: grid; gap: var(--s3); }
.g2 { grid-template-columns: repeat(2,1fr); }
.g3 { grid-template-columns: repeat(3,1fr); }
.g4 { grid-template-columns: repeat(4,1fr); }
@media (max-width: 900px){ .g3,.g4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px){ .g2,.g3,.g4 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); }
.card h3 { margin-bottom: var(--s1); font-size: 1.125rem; }
.card p { color: #46536b; margin: 0; font-size: .97rem; }
.card .kicker { font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted); display: block; margin-bottom: 6px; }
a.card { text-decoration: none; color: inherit; transition: border-color .12s, transform .12s, box-shadow .12s; display: block; }
a.card:hover { border-color: var(--action); transform: translateY(-2px); box-shadow: var(--shadow); }
.ico { width: 44px; height: 44px; border-radius: 10px; background: #e7f0ed; color: var(--c-mint-deep); display: flex; align-items: center; justify-content: center; margin-bottom: var(--s2); font-size: 1.15rem; }

/* Split */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); align-items: center; }
.split.rev > :first-child { order: 2; }
@media (max-width: 860px){ .split, .split.rev { grid-template-columns: 1fr; gap: var(--s4); } .split.rev > :first-child { order: 0; } }

/* Steps */
.steps { display: grid; gap: 0; max-width: 840px; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .n { width: 36px; height: 36px; border-radius: 9px; background: var(--c-dark); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.bg-dark .step { border-color: rgba(255,255,255,.12); }
.bg-dark .step .n { background: var(--c-mint-deep); }
.step h3 { margin-bottom: 4px; }
.step p { color: #46536b; margin: 0; }
.bg-dark .step p { color: var(--text-invert-muted); }

/* Checklist */
.check { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.check li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; color: #46536b; }
.check li::before { content: "✓"; color: var(--c-success); font-weight: 800; }
.bg-dark .check li { color: var(--text-invert-muted); }

/* Boundary list */
.bounds { display: grid; gap: 12px; }
.bound { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: baseline; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.bound .no { color: var(--c-critical); font-weight: 800; font-size: .72rem; letter-spacing: .05em; }
.bound strong { color: var(--c-dark); }
.bound span { color: #46536b; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font-size: .9rem; color: #33405c; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; text-decoration: none; }
a.chip:hover { border-color: var(--action); color: var(--action); }
.chip.solid { background: #e7f0ed; color: var(--c-mint-deep); border-color: transparent; font-weight: 600; }

/* Outcome dimension list (no numbers) */
.dims { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--s2); }
@media (max-width: 900px){ .dims { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px){ .dims { grid-template-columns: 1fr; } }
.dim { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s2) var(--s3); background: var(--surface); }
.dim strong { display: block; color: var(--c-dark); font-size: .98rem; }
.dim span { font-size: .85rem; color: var(--text-muted); }

/* Diagram frames */
.diagram-frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); }
.bg-dark .diagram-frame { background: #12203a; border-color: rgba(255,255,255,.12); }
.diagram { width: 100%; height: auto; display: block; }
figcaption, .fig-cap { font-size: .78rem; color: var(--text-muted); margin-top: 10px; }

/* Status / disclosure notes */
.note { border-radius: var(--radius-sm); padding: 14px 16px; font-size: .9rem; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.note .tag { font-weight: 700; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.note-info { background: #eef3fb; color: #29457e; } .note-info .tag { background: #4F7DD4; color: #fff; }
.note-warn { background: #fbf3e3; color: #7a5210; } .note-warn .tag { background: #C78318; color: #fff; }
.note-status { background: #eef3fb; border: 1px dashed #9fb6df; color: #29457e; }
.disclosure { font-size: .85rem; color: var(--text-muted); border-left: 3px solid var(--line); padding: 4px 0 4px 14px; margin-top: var(--s2); }

/* Approval placeholder (staging only, high-visibility) */
.placeholder { background: repeating-linear-gradient(45deg,#fff5f5,#fff5f5 10px,#ffecec 10px,#ffecec 20px); border: 1.5px dashed var(--c-critical); border-radius: var(--radius-sm); padding: 12px 14px; color: #8f2f38; font-size: .9rem; }
.placeholder strong { color: #8f2f38; }
.ph { font-family: var(--mono); background: #ffe3e3; color: #8f2f38; padding: 1px 6px; border-radius: 4px; font-size: .85em; }

/* Breadcrumb */
.crumb { font-size: .85rem; color: var(--text-muted); padding: var(--s3) 0 0; }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--action); }

/* Page hero */
.page-hero { padding: var(--s6) 0 var(--s5); border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 800px; }
.page-hero .lead { max-width: 720px; margin-top: var(--s1); }

/* CTA band */
.cta-band { background: var(--c-dark); color: #fff; border-radius: 16px; padding: var(--s7); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--text-invert-muted); max-width: 620px; margin: 0 auto var(--s4); }
.cta-actions { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; }
@media (max-width: 600px){ .cta-band { padding: var(--s5) var(--s3); } }

/* Data table (Brand Book §25) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.matrix { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.matrix th, table.matrix td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.matrix thead th { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
table.matrix .role { font-weight: 700; color: var(--c-dark); white-space: nowrap; }
table.matrix tbody tr:hover { background: var(--bg-alt); }
.num { text-align: right !important; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Forms */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); }
.field { margin-bottom: var(--s3); }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--c-dark); }
.field .req { color: var(--c-critical); }
.field input, .field select, .field textarea { width: 100%; padding: 12px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-family: inherit; font-size: 1rem; color: var(--text); background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--action); }
.field .hint { font-size: .82rem; color: var(--text-muted); margin-top: 5px; }
.field .err { display: none; color: #8f2f38; font-size: .85rem; margin-top: 5px; font-weight: 600; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--c-critical); background: #fff8f8; }
.field.invalid .err { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { background: #fbf3e3; border: 1px solid #efd8a8; border-radius: var(--radius-sm); padding: 12px 14px; font-size: .88rem; color: #7a5210; margin-bottom: var(--s3); }
.privacy-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: var(--s2); }
.form-status { margin-top: var(--s3); border-radius: var(--radius-sm); padding: 14px 16px; font-size: .95rem; }
.form-status[data-state="success"] { background: #e8f4ec; border: 1px solid #b9dcc6; color: #1f6a41; }
.form-status[data-state="error"] { background: #fdeceD; border: 1px solid #f0c2c6; color: #8f2f38; }

/* Footer */
.site-footer { background: var(--c-dark); color: var(--text-invert-muted); padding: var(--s7) 0 var(--s4); }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4,1fr); gap: var(--s4); }
@media (max-width: 860px){ .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px){ .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { color: #fff; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer a { color: var(--text-invert-muted); font-size: .92rem; display: block; margin-bottom: 9px; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand img { height: 40px; margin-bottom: 12px; }
.footer-brand p { font-size: .9rem; max-width: 280px; }
.footer-facts { font-size: .82rem; color: #8a94a6; margin-top: 12px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: var(--s5); padding-top: var(--s3); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: #8a94a6; }
.footer-bottom a { display: inline; color: #8a94a6; }

/* Utilities */
.center { text-align: center; } .mx-auto { margin-left:auto; margin-right:auto; }
.mt-2 { margin-top: var(--s2);} .mt-3 { margin-top: var(--s3);} .mt-4 { margin-top: var(--s4);}
.mb-0 { margin-bottom: 0; }
.visually-hidden { position:absolute!important; width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0; }

/* Product screenshots */
.shot { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: #0c1524; }
.shot-fig { margin: 0; }
.shot-fig figcaption { font-size: .8rem; color: var(--text-muted); margin-top: 10px; }
.shot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
@media (max-width: 820px){ .shot-grid { grid-template-columns: 1fr; } }

/* Cookie consent banner */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 300; max-width: 920px; margin: 0 auto;
  background: var(--c-dark); color: #eef2f8; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.35);
  padding: 16px 18px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cookie-banner p { margin: 0; font-size: .92rem; color: #cfd7e4; max-width: 560px; }
.cookie-banner a { color: #7fc4b6; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-banner .btn { min-height: 40px; padding: 0 18px; }
.cookie-banner .btn-secondary { color: #fff; border-color: rgba(255,255,255,.4); }
.cookie-banner .btn-secondary:hover { border-color: #fff; background: rgba(255,255,255,.08); }
@media (max-width: 560px){ .cookie-banner { flex-direction: column; align-items: stretch; } .cookie-actions .btn { flex: 1; justify-content: center; } }
