/* Design system read from cloudsaathi.com's live JS bundle — the shipped
   palette, not the stale /assets/*.css build artifact. */
  :root {
    /* Palette read from cloudsaathi.com's live bundle — light, cream, forest green. */
    --ground: #F5F1E8;          /* bg    — page */
    --panel: #FDFBF7;           /* bgW   — cards, raised surfaces */
    --panel-2: #E6EEEA;         /* greenL— accent-tinted surface, hover */
    --surface: #FDFBF7;
    --ink: #1A1A24;             /* ink   — headings */
    --text: #4A4A58;            /* inkS  — body */
    --muted: #4A4A58;
    --faint: #8A8A96;           /* inkM  — labels, meta */
    --hair: #E4DCCE;            /* bdr, lightened for hairlines */
    --hair-strong: #D4CBBB;     /* bdr   — visible borders */
    --accent: #2D6A4F;          /* green — primary */
    --accent-bright: #1B4332;   /* greenD— pressed/hover */
    --seal: #E6EEEA;            /* greenL— accent wash */
    --glow: rgba(45, 106, 79, 0.18);
    --warm: #C4956A;
    --ok: #2D6A4F;
    --ok-bg: #E6EEEA;
    --info: #5BB8A6;            /* teal */
    --info-bg: rgba(91, 184, 166, 0.14);
    --crit: #B5574E;            /* red */
    --crit-bg: rgba(181, 87, 78, 0.12);
    --code-bg: #0D0D14;         /* bgDark— terminal blocks only */
    --shadow: 0 1px 2px rgba(26, 26, 36, .04), 0 8px 28px rgba(26, 26, 36, .06);
    --radius: 14px;
    --radius-sm: 8px;
    --ease: .3s cubic-bezier(.4, 0, .2, 1);
    --sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  }

  * { box-sizing: border-box; }
  html, body { overflow-x: clip; max-width: 100%; }
  body {
    margin: 0;
    background: var(--ground);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }
  .wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
  /* prevent horizontal overflow: let grid/flex children shrink below content */
  .stat, .dom, .cli, .proj, .arch { min-width: 0; }
  .flow { max-width: 100%; }

  /* ---- classification bar ---- */
  .classbar {
    border-bottom: 1px solid var(--hair);
    background: rgba(245, 241, 232, .85);
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
  }
  .classbar .wrap {
    display: flex; align-items: center; justify-content: space-between;
    height: 46px; gap: 16px;
  }
  .classbar .brand {
    font-family: var(--mono); font-size: 12px; letter-spacing: .06em;
    color: var(--ink); text-decoration: none; white-space: nowrap;
  }
  .classbar .brand b { font-weight: 600; }
  .classbar .brand span { color: var(--faint); }
  .classbar .home {
    font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
    color: var(--muted); text-decoration: none; white-space: nowrap;
    transition: color var(--ease);
  }
  .classbar .home:hover { color: var(--accent); }

  /* jump nav — every section reachable without scrolling to find it */
  .navlinks { display: flex; align-items: center; gap: 4px; }
  .navlinks a {
    font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em;
    color: var(--text); text-decoration: none; padding: 6px 11px;
    border-radius: 6px; white-space: nowrap; transition: all var(--ease);
  }
  .navlinks a:hover { color: var(--accent); background: var(--seal); }
  .navlinks a.cta {
    background: var(--accent); color: #FDFBF7; font-weight: 500;
  }
  .navlinks a.cta:hover { background: var(--accent-bright); color: #FDFBF7; }
  @media (max-width: 640px) {
    .classbar .brand span { display: none; }
    .navlinks a { padding: 6px 8px; font-size: 11px; }
    .navlinks a[href="#security"] { display: none; }
  }
  @media (max-width: 420px) {
    .navlinks a[href="#expertise"] { display: none; }
  }

  /* sticky bar is 46px — keep anchored headings clear of it */
  section[id], header[id] { scroll-margin-top: 62px; }

  /* ---- section scaffolding ---- */
  section { padding: 64px 0; border-bottom: 1px solid var(--hair); }
  .eyebrow {
    font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
    color: var(--accent); display: flex; align-items: center; justify-content: center;
    gap: 12px; margin: 0 0 18px;
  }
  .eyebrow::before, .eyebrow::after {
    content: ""; width: 22px; height: 1px; background: var(--accent); opacity: .7;
  }
  h2 { font-family: var(--serif); font-weight: 500; color: var(--ink);
    font-size: clamp(1.6rem, 3.8vw, 2.3rem); line-height: 1.15; margin: 0 auto 14px;
    letter-spacing: -.01em; text-wrap: balance; text-align: center; max-width: 24ch; }
  .lede { max-width: 62ch; color: var(--muted); font-size: 1.02rem; margin: 0 auto;
    text-align: center; text-wrap: pretty; }

  /* ---- HERO ---- */
  .hero { padding: 96px 0 84px; position: relative; overflow: hidden; }
  .hero .wrap { text-align: center; }
  .hero .id {
    font-family: var(--mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 20px;
  }
  .hero h1 {
    font-family: var(--serif); font-weight: 500; color: var(--ink);
    font-size: clamp(2.5rem, 7vw, 4.2rem); line-height: 1.02; letter-spacing: -.03em;
    margin: 0 0 8px; text-wrap: balance;
  }
  .hero .role {
    font-family: var(--mono); font-size: clamp(.85rem, 1.6vw, 1rem); letter-spacing: .06em;
    color: var(--accent); margin-bottom: 30px;
  }
  .hero .thesis {
    font-family: var(--serif); font-style: italic; color: var(--text);
    font-size: clamp(1.5rem, 3.6vw, 2.3rem); line-height: 1.3; max-width: 30ch;
    margin: 0 auto 30px; text-wrap: balance; font-weight: 400;
  }
  .hero .thesis em { color: var(--accent); font-weight: 500; font-style: italic; }
  .hero p.intro { max-width: 62ch; color: var(--muted); margin: 0 auto 30px; font-size: 1.05rem; }
  .links { display: flex; flex-wrap: wrap; gap: 10px; }
  .hero .links { justify-content: center; }
  .links a {
    font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; text-decoration: none;
    color: var(--text); border: 1px solid var(--hair-strong); border-radius: var(--radius-sm);
    padding: 10px 16px; display: inline-flex; align-items: center; gap: 9px;
    background: var(--panel); transition: all var(--ease);
  }
  .links a:hover {
    color: var(--ink); border-color: var(--accent); background: var(--seal);
  }
  .links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .links a .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

  /* Primary CTA — the résumé download is the point of the page. */
  .links a.primary {
    background: var(--accent); border-color: var(--accent); color: #FDFBF7; font-weight: 500;
  }
  .links a.primary .dot { background: #FDFBF7; box-shadow: none; }
  .links a.primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); color: #FDFBF7; }

  /* ---- STAT CONTROL PANEL ---- */
  .panel-stats { background: var(--panel); }
  .grid-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px;
    background: var(--hair); border: 1px solid var(--hair); border-radius: var(--radius); overflow: hidden; }
  .stat { background: var(--panel); padding: 22px 18px; }
  .stat .num { font-family: var(--mono); font-weight: 600; color: var(--ink);
    font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
  .stat .num small { color: var(--accent); font-size: .55em; }
  .stat .lbl { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); margin-top: 10px; line-height: 1.45; }
  @media (max-width: 860px){ .grid-stats { grid-template-columns: repeat(3, 1fr); } }
  @media (max-width: 480px){ .grid-stats { grid-template-columns: repeat(2, 1fr); } }

  /* ---- standards seals ---- */
  .seals { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
  .seal-chip {
    display: inline-flex; align-items: center; gap: 10px;
    border: 1px solid var(--hair-strong); border-radius: var(--radius-sm); padding: 11px 16px 11px 13px;
    background: var(--panel);
  }
  .seal-chip .mk { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--accent);
    display: grid; place-items: center; color: var(--accent); font-family: var(--mono); font-size: 10px; font-weight: 700; }
  .seal-chip .nm { color: var(--ink); font-weight: 600; font-size: .92rem; }
  .seal-chip .sub { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display:block; }

  /* ---- capability matrix ---- */
  .grid-dom { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .grid-role { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
  @media (max-width: 760px){ .grid-dom { grid-template-columns: 1fr; } }
  .dom {
    background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 24px 24px 22px;
    box-shadow: var(--shadow); position: relative; overflow: hidden;
  }
  .dom::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .0; transition: opacity var(--ease); }
  .dom:hover::before { opacity: .8; }
  .dom::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(135deg, transparent 40%, var(--seal));
    opacity: 0; transition: opacity var(--ease);
  }
  .dom:hover { border-color: var(--hair-strong); background: var(--panel-2); transform: translateY(-2px); }
  .dom:hover::after { opacity: 1; }
  .dom { transition: border-color var(--ease), background var(--ease), transform var(--ease); }
  .dom > * { position: relative; z-index: 1; }

  .cli, .proj, .arch { transition: border-color var(--ease), background var(--ease); }
  .cli:hover, .proj:hover, .arch:hover { border-color: var(--hair-strong); background: var(--panel-2); }
  .seal-chip { transition: border-color var(--ease), background var(--ease); }
  .seal-chip:hover { border-color: var(--accent); background: var(--seal); }
  .tools span:hover { border-color: var(--hair-strong); color: var(--ink); }
  .dom .code { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; color: var(--accent);
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .dom .code .idx { color: var(--faint); }
  .dom h3 { margin: 0 0 8px; color: var(--ink); font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; }
  .dom p { margin: 0 0 15px; color: var(--muted); font-size: .93rem; line-height: 1.55; }
  .tags { display: flex; flex-wrap: wrap; gap: 6px; }
  .tags span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .03em; color: var(--text);
    background: var(--panel-2); border: 1px solid var(--hair); border-radius: 6px; padding: 4px 9px; }

  /* ---- status pills ---- */
  .pill { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
    font-weight: 600; padding: 3px 9px; border-radius: 100px; display: inline-flex; align-items: center; gap: 6px; }
  .pill::before { content:""; width:6px; height:6px; border-radius:50%; background: currentColor; }
  .pill.ok { color: var(--ok); background: var(--ok-bg); }
  .pill.info { color: var(--info); background: var(--info-bg); }
  .pill.crit { color: var(--crit); background: var(--crit-bg); }

  /* ---- client due diligence ---- */
  .grid-cli { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  @media (max-width: 820px){ .grid-cli { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 520px){ .grid-cli { grid-template-columns: 1fr; } }
  .cli { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
  .cli .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
  .cli .name { color: var(--ink); font-weight: 700; font-size: 1.02rem; }
  .cli .sector { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
  .cli p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5; }

  /* ---- projects ---- */
  .grid-proj { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  @media (max-width: 760px){ .grid-proj { grid-template-columns: 1fr; } }
  .proj { background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
  .proj .head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
  .proj h3 { margin: 0; color: var(--ink); font-size: 1.18rem; font-weight: 700; letter-spacing: -.01em; }
  .proj .kind { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
  .proj > p { margin: 0 0 16px; color: var(--muted); font-size: .93rem; }
  .ctrl { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .ctrl li { display: flex; gap: 10px; align-items: baseline; font-size: .88rem; color: var(--text); }
  .ctrl li .cid { font-family: var(--mono); font-size: 10.5px; color: var(--accent); flex: 0 0 auto; min-width: 58px; letter-spacing: .04em; }

  /* ---- toolbox ---- */
  .tools { display: flex; flex-wrap: wrap; gap: 8px; }
  .tools span { font-family: var(--mono); font-size: 12px; color: var(--text);
    border: 1px solid var(--hair); background: var(--panel); border-radius: 6px; padding: 7px 12px; transition: all var(--ease); }

  /* ---- footer ---- */
  footer { padding: 56px 0 72px; }
  footer .stampline { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
  footer .sig { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); font-style: italic; }
  footer .note { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; color: var(--muted); line-height: 1.7; }
  footer .note b { color: var(--accent); font-weight: 600; }

  /* ---- reference architectures (blueprint) ---- */
  .arch-wrap { background: var(--panel-2); }
  .grid-arch { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  @media (max-width: 800px){ .grid-arch { grid-template-columns: 1fr; } }
  .arch {
    background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); display: flex; flex-direction: column;
  }
  .arch .ahead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
  .arch h3 { margin: 0; color: var(--ink); font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
  .arch .plat { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--accent); white-space: nowrap; }
  .arch .ctx { font-family: var(--mono); font-size: 10.5px; color: var(--text); letter-spacing: .04em; margin-bottom: 16px; }
  .flow { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 12px 12px 14px;
    background: var(--panel-2); border: 1px solid var(--hair); border-radius: var(--radius-sm); margin-bottom: 16px;
    scrollbar-width: thin; }
  .flow .node { font-family: var(--mono); font-size: 11px; color: var(--text); white-space: nowrap;
    border: 1px solid var(--hair-strong); border-radius: 6px; padding: 7px 11px; background: var(--panel); flex: 0 0 auto; }
  .flow .node.key { border-color: var(--accent); color: var(--ink); background: var(--seal); }
  .flow .arr { color: var(--accent); flex: 0 0 auto; font-family: var(--mono); font-size: 12px; opacity: .8; }
  .arch ul.feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
  .arch ul.feat li { position: relative; padding-left: 16px; font-size: .88rem; color: var(--muted); line-height: 1.5; }
  .arch ul.feat li::before { content: "›"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
  .arch ul.feat li b { color: var(--text); font-weight: 600; }

  /* ---- flagship product (security audit engine) ---- */
  .kx-cmd {
    font-family: var(--mono); font-size: clamp(11px, 2.1vw, 14px); color: #E8E6E1;
    background: var(--code-bg); border: 1px solid var(--code-bg); border-radius: var(--radius-sm);
    padding: 16px 18px; margin: 26px 0 30px; overflow-x: auto; white-space: nowrap;
  }
  .kx-cmd b { color: #5BB8A6; font-weight: 500; }
  .kx-cmd .pr { color: #6B6B78; }

  .kx-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
  @media (max-width: 900px){ .kx-grid { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 520px){ .kx-grid { grid-template-columns: 1fr; } }
  .kx {
    background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius);
    padding: 20px; transition: border-color var(--ease), background var(--ease);
  }
  .kx:hover { border-color: var(--hair-strong); background: var(--panel-2); }
  .kx .nm { color: var(--ink); font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
  .kx .ro { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--accent); margin: 5px 0 10px; }
  .kx p { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.5; }

  .kx-out { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; justify-content: center; }
  .kx-out span { font-family: var(--mono); font-size: 11px; color: var(--text);
    border: 1px solid var(--hair); background: var(--panel); border-radius: 6px; padding: 7px 12px; }
  .kx-out span b { color: var(--accent); font-weight: 500; }

  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.in { opacity: 1; transform: none; }
  @media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
  }

/* ================= case-study page ================= */
.backlink {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--muted);
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: color var(--ease);
}
.backlink:hover { color: var(--accent); }

.cs-hero { padding: 64px 0 48px; }
.cs-hero .wrap { text-align: center; }
.cs-hero h1 {
  font-family: var(--serif); font-weight: 500; color: var(--ink);
  font-size: clamp(2.1rem, 5.5vw, 3.4rem); line-height: 1.05; letter-spacing: -.02em;
  margin: 18px 0 10px; text-wrap: balance;
}
.cs-hero .sub {
  font-family: var(--serif); font-style: italic; color: var(--muted);
  font-size: clamp(1.1rem, 2.4vw, 1.5rem); line-height: 1.4; max-width: 42ch; margin: 0 auto 26px;
}
.cs-meta { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cs-meta span {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--text);
  border: 1px solid var(--hair); background: var(--panel); border-radius: 6px; padding: 6px 11px;
}

.prose { max-width: 68ch; margin: 0 auto; }
.prose p { color: var(--muted); font-size: 1rem; line-height: 1.68; margin: 0 0 16px; }
.prose p b, .prose p strong { color: var(--ink); font-weight: 600; }
.prose p em { color: var(--text); font-style: italic; }

/* pull-quote: the one line that should survive a skim */
.pull {
  font-family: var(--serif); font-style: italic; color: var(--ink);
  font-size: clamp(1.25rem, 2.9vw, 1.75rem); line-height: 1.4; text-align: center;
  margin: 34px auto; max-width: 30ch; text-wrap: balance;
}

.note {
  background: var(--panel); border: 1px solid var(--hair); border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm); padding: 18px 20px; margin: 26px auto; max-width: 68ch;
}
.note .hd {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.note p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.6; }

/* numbered decision list */
.steps { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 14px; max-width: 74ch; }
.steps li {
  display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: baseline;
  color: var(--muted); font-size: .95rem; line-height: 1.6;
}
.steps li .n {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  border: 1px solid var(--hair-strong); border-radius: 5px; padding: 3px 0; text-align: center;
}
.steps li b { color: var(--ink); font-weight: 600; }

/* grouped toolbox — categories read as judgement, a flat wall reads as a dump */
.toolset {
  display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: baseline;
  padding: 14px 0; border-top: 1px solid var(--hair);
}
.toolset:last-of-type { border-bottom: 1px solid var(--hair); }
.toolset .tl {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
@media (max-width: 620px){
  .toolset { grid-template-columns: 1fr; gap: 10px; }
}

/* codename line — secondary to the descriptive H1, never a replacement for it */
.cs-hero .codename {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em;
  color: var(--text); margin-bottom: 18px;
}
.cs-hero .codename b { color: var(--accent); font-weight: 500; }


/* Centred headers, left-aligned content — card interiors opt out. */
.dom, .cli, .proj, .arch, .kx, .stat, .toolset { text-align: left; }
.dom h3, .cli p, .proj p, .arch h3, .kx p, .steps li { text-align: left; }
.grid-stats .lbl, .grid-stats .num { text-align: left; }
.prose p { text-align: left; }
/* terminal + diagram rails read left-to-right regardless of header alignment */
.kx-cmd { text-align: left; }
.flow { justify-content: flex-start; }
.toolset .tl { text-align: left; }
