/* =========================================================
   Arya Monani — Portfolio
   Modern/technical system. Tokens first; components after.
   ========================================================= */

/* -------- TOKENS -------- */
:root {
  /* type pairs — swapped via [data-fontpair] */
  --ff-display: "Inter Tight", system-ui, sans-serif;
  --ff-body:    "Inter Tight", system-ui, sans-serif;
  --ff-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* accent — swapped via [data-accent] */
  --accent:       #7a1f2a;
  --accent-deep:  #4f121a;
  --accent-soft:  #c97a66;
  --accent-ink:   #ffffff;

  /* neutrals — swapped via [data-theme] */
  --bg:        #f4f1ea;
  --bg-2:      #ece8df;
  --surface:   #fbf9f3;
  --surface-2: #f1ede2;
  --ink:       #17161a;
  --ink-2:     #2c2a2f;
  --muted:     #6a6864;
  --rule:      rgba(23,22,26,.12);
  --rule-2:    rgba(23,22,26,.22);

  /* layout */
  --maxw: 1280px;
  --gutter: 40px;

  /* density — swapped via [data-density] */
  --sp-sec: 120px;
  --sp-block: 44px;
  --sp-chip: 14px;
  --sp-card: 28px;

  --fs-display: clamp(56px, 9vw, 136px);
  --fs-h2: clamp(36px, 5vw, 68px);
  --fs-h3: clamp(26px, 2.6vw, 40px);
  --fs-body: 17px;
  --fs-small: 13.5px;
  --fs-mono: 11.5px;

  /* motion */
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* theme: dark */
[data-theme="dark"] {
  --bg: #111012;
  --bg-2: #17161a;
  --surface: #1b1a1e;
  --surface-2: #242226;
  --ink: #efece4;
  --ink-2: #d6d2c8;
  --muted: #8f8c87;
  --rule: rgba(239,236,228,.12);
  --rule-2: rgba(239,236,228,.22);
}

/* accents */
[data-accent="oxblood"] { --accent:#7a1f2a; --accent-deep:#4f121a; --accent-soft:#c97a66; --accent-ink:#fff; }
[data-accent="ink"]     { --accent:#17161a; --accent-deep:#000;    --accent-soft:#555;    --accent-ink:#fff; }
[data-theme="dark"][data-accent="ink"] { --accent:#efece4; --accent-deep:#fff; --accent-soft:#aaa; --accent-ink:#111012; }
[data-accent="electric"] { --accent:#2e44ff; --accent-deep:#1d2bb8; --accent-soft:#7a86ff; --accent-ink:#fff; }
[data-accent="forest"]   { --accent:#1f5a3a; --accent-deep:#123824; --accent-soft:#5e9274; --accent-ink:#fff; }
[data-accent="clay"]     { --accent:#c2410c; --accent-deep:#7c2d0a; --accent-soft:#f59e6b; --accent-ink:#fff; }

/* font pairs */
[data-fontpair="neo"]    { --ff-display:"Inter Tight",system-ui,sans-serif; --ff-body:"Inter Tight",system-ui,sans-serif; --ff-mono:"JetBrains Mono",ui-monospace,monospace; }
[data-fontpair="editorial"] { --ff-display:"Newsreader",Georgia,serif; --ff-body:"Inter Tight",system-ui,sans-serif; --ff-mono:"JetBrains Mono",ui-monospace,monospace; }
[data-fontpair="swiss"]  { --ff-display:"IBM Plex Sans",system-ui,sans-serif; --ff-body:"IBM Plex Sans",system-ui,sans-serif; --ff-mono:"IBM Plex Mono",ui-monospace,monospace; }
[data-fontpair="serif-display"] { --ff-display:"Instrument Serif",Georgia,serif; --ff-body:"Inter Tight",system-ui,sans-serif; --ff-mono:"JetBrains Mono",ui-monospace,monospace; }

/* density */
[data-density="tight"] {
  --sp-sec: 80px;
  --sp-block: 28px;
  --sp-card: 20px;
  --fs-display: clamp(44px, 7vw, 96px);
  --fs-h2: clamp(28px, 4vw, 52px);
  --fs-body: 15.5px;
}

/* -------- RESET & BASE -------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: var(--fs-body);
  font-feature-settings: "ss01","cv11","tnum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s var(--ease), color .25s var(--ease);
}
a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
.wrap { width: min(var(--maxw), calc(100vw - var(--gutter))); margin: 0 auto; }

/* Monospace meta atoms */
.mono, .k, .stp-k, .belief-k, .sec-tag, .badge, .ctct-k {
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* -------- TOP NAV -------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
}
.nav-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--ff-mono);
  font-size: var(--fs-mono);
  letter-spacing: .06em; text-transform: uppercase;
}
.brand-mark {
  display: inline-grid; grid-template-columns: repeat(3, 6px); gap: 3px;
  padding: 6px; border: 1px solid var(--rule-2); border-radius: 4px;
}
.brand-mark .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.brand-mark .dot-b { background: var(--accent); }
.brand-mark .dot-c { background: var(--muted); }
.brand-name { color: var(--ink); font-weight: 600; }
.brand-sep  { color: var(--muted); }
.brand-role { color: var(--muted); }

.nav-links { list-style: none; display: flex; gap: 26px; align-items: center; }
.nav-links a {
  font-family: var(--ff-mono); font-size: var(--fs-mono);
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  transition: color .15s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  color: var(--ink) !important;
  padding: 8px 12px; border: 1px solid var(--rule-2); border-radius: 999px;
}
.nav-cta:hover { background: var(--ink); color: var(--bg) !important; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px;
  background: transparent; border: 1px solid var(--rule-2);
  color: var(--muted); cursor: pointer; position: relative; overflow: hidden;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
  padding: 0;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle .tt-ico {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 14px; line-height: 1;
  transition: transform .25s var(--ease), opacity .2s var(--ease);
}
[data-theme="light"] .theme-toggle .tt-sun  { transform: translateY(0) rotate(0); opacity: 1; }
[data-theme="light"] .theme-toggle .tt-moon { transform: translateY(-100%) rotate(-40deg); opacity: 0; }
[data-theme="dark"]  .theme-toggle .tt-sun  { transform: translateY(100%) rotate(40deg); opacity: 0; }
[data-theme="dark"]  .theme-toggle .tt-moon { transform: translateY(0) rotate(0); opacity: 1; }
.nav-rule { height: 1px; background: var(--rule); }

/* -------- HERO -------- */
.hero { padding: 64px 0 48px; position: relative; }
.hero-meta {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 14px 0 32px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 44px;
}
.meta-col { display: flex; flex-direction: column; gap: 4px; }
.meta-col .k { color: var(--muted); }
.meta-col .v { font-family: var(--ff-mono); font-size: 13px; color: var(--ink); letter-spacing: .02em; }
.pulse {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(34,197,94,.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
  70%  { box-shadow: 0 0 0 10px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.hero-grid {
  display: grid; grid-template-columns: 1.35fr .9fr; gap: 48px;
  align-items: end;
}
.display {
  font-family: var(--ff-display);
  font-size: var(--fs-display);
  line-height: .92;
  letter-spacing: -.045em;
  font-weight: 500;
}
.display .line { display: block; }
.display em {
  font-style: normal; font-weight: 400; color: var(--accent);
  font-feature-settings: "ss01";
}
.display .muted { color: var(--muted); font-weight: 300; }

[data-fontpair="editorial"] .display,
[data-fontpair="serif-display"] .display { letter-spacing: -.025em; font-weight: 400; }

.lede {
  margin-top: 28px; max-width: 56ch; font-size: 18px; color: var(--ink-2);
  border-left: 2px solid var(--accent); padding-left: 16px;
}
.hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  font-family: var(--ff-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--rule-2);
  display: inline-flex; align-items: center; gap: 8px;
  transition: all .18s var(--ease);
}
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost:hover  { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.hero-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
}
.stat-card.wide { grid-column: 1 / -1; }
.stat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
  opacity: .9;
}
.stat-card[data-col="b"]::before { background: var(--ink); }
.stat-card[data-col="c"]::before { background: var(--accent-soft); }
.stat-num {
  font-family: var(--ff-display);
  font-size: clamp(56px, 6vw, 88px);
  line-height: 1;
  letter-spacing: -.045em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat-num .unit { font-size: .55em; color: var(--muted); margin-left: 2px; }
.stat-lbl {
  font-size: 15px; color: var(--ink-2); max-width: 22ch; line-height: 1.3;
}
.stat-foot {
  margin-top: auto; padding-top: 10px;
  font-family: var(--ff-mono); font-size: 11px; color: var(--muted);
  letter-spacing: .06em; text-transform: uppercase;
  border-top: 1px dashed var(--rule);
}
.stat-spark { margin-top: 6px; color: var(--accent); height: 40px; }
.stat-spark svg { width: 100%; height: 100%; }

/* marquee */
.marquee {
  margin-top: 64px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
  padding: 16px 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex; gap: 40px; white-space: nowrap;
  animation: marquee 48s linear infinite;
  font-family: var(--ff-mono); font-size: 13px;
  color: var(--muted); letter-spacing: .04em; text-transform: uppercase;
}
.marquee-track span:nth-child(even) { color: var(--accent); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* -------- SECTION HEADERS -------- */
.sec-head { padding: 0 0 32px; border-bottom: 1px solid var(--rule); margin-bottom: 40px; display: grid; gap: 16px; }
.sec-tag {
  display: inline-flex; gap: 14px; align-items: center;
  color: var(--accent);
}
.sec-tag.onink { color: var(--accent-soft); }
.sec-tag span:first-child { color: var(--accent); }
.sec-tag span:last-child  { color: var(--muted); }
.sec-title {
  font-family: var(--ff-display);
  font-size: var(--fs-h2);
  line-height: .98;
  letter-spacing: -.035em;
  font-weight: 500;
  max-width: 22ch;
}
[data-fontpair="editorial"] .sec-title,
[data-fontpair="serif-display"] .sec-title { letter-spacing: -.02em; font-weight: 400; }
.sec-title em { font-style: normal; color: var(--accent); font-weight: 400; }
.sec-sub { color: var(--muted); max-width: 64ch; font-size: 17px; }

/* -------- PRINCIPLES -------- */
.principles { padding: var(--sp-sec) 0 calc(var(--sp-sec) * .4); }
.belief-grid {
  list-style: none;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.belief-grid li {
  padding: 28px 24px 32px;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 10px;
  min-height: 220px;
  transition: background .2s var(--ease);
}
.belief-grid li:last-child { border-right: none; }
.belief-grid li:hover { background: var(--surface); }
.belief-k { color: var(--accent); }
.belief-h {
  font-family: var(--ff-display); font-size: 22px; line-height: 1.15;
  letter-spacing: -.02em; font-weight: 500; color: var(--ink);
}
.belief-b { font-size: 15px; color: var(--muted); margin-top: auto; }

/* -------- APPROACH / DDPDO -------- */
.approach { padding: calc(var(--sp-sec) * .4) 0 var(--sp-sec); }
.ddpdo {
  list-style: none;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
  border: 1px solid var(--rule);
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface);
}
.ddpdo li {
  padding: 26px 22px 28px;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  transition: background .2s var(--ease);
}
.ddpdo li:last-child { border-right: none; }
.ddpdo li:hover { background: var(--surface-2); }
.ddpdo li::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.ddpdo li:hover::before { transform: scaleX(1); }
.stp-k { color: var(--accent); }
.stp-q {
  font-family: var(--ff-display); font-size: 19px; line-height: 1.2;
  letter-spacing: -.015em; color: var(--ink); font-weight: 500;
  min-height: 68px;
}
.stp-a { font-size: 13.5px; color: var(--ink-2); }
.stp-d { margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--rule); font-family: var(--ff-mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; }

/* -------- CASE STUDY LAYOUT (shared) -------- */
.case {
  padding: var(--sp-sec) 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.case-top {
  display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: end;
  padding-bottom: 28px; border-bottom: 1px solid var(--rule); margin-bottom: 48px;
}
.case-idx {
  font-family: var(--ff-mono); font-size: 12px; color: var(--accent);
  letter-spacing: .08em; text-transform: uppercase;
}
.case-title {
  font-family: var(--ff-display);
  font-size: clamp(40px, 6vw, 92px);
  line-height: .94; letter-spacing: -.04em; font-weight: 500;
}
[data-fontpair="editorial"] .case-title,
[data-fontpair="serif-display"] .case-title { font-weight: 400; letter-spacing: -.02em; }
.case-title em { font-style: normal; color: var(--accent); font-weight: 400; }
.case-status {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 12px; border: 1px solid var(--rule-2); border-radius: 999px;
  white-space: nowrap;
}

.case-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 64px;
  align-items: start;
}

/* scroll-driven sidebar (chapter index) */
.case-side {
  position: sticky; top: 96px;
  align-self: start;
  display: flex; flex-direction: column; gap: 24px;
}
.side-label { font-family: var(--ff-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.chapters {
  list-style: none; display: flex; flex-direction: column; gap: 2px;
  border-left: 1px solid var(--rule);
}
.chapters li a {
  display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center;
  padding: 10px 0 10px 14px;
  font-family: var(--ff-mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
  border-left: 2px solid transparent; margin-left: -1px;
  transition: color .15s, border-color .15s;
}
.chapters li a .n { color: var(--accent); font-weight: 500; }
.chapters li a:hover { color: var(--ink); }
.chapters li a.active {
  color: var(--ink);
  border-left-color: var(--accent);
}

.side-meta { display: grid; gap: 14px; padding-top: 14px; border-top: 1px solid var(--rule); }
.side-meta div { font-family: var(--ff-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.side-meta .mk { color: var(--muted); }
.side-meta .mv { color: var(--ink); margin-top: 2px; font-size: 13px; letter-spacing: 0; text-transform: none; }

/* case main */
.case-main { display: flex; flex-direction: column; gap: 56px; }
.case-main section { scroll-margin-top: 100px; }
.case-section-k {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.case-section-h {
  font-family: var(--ff-display); font-size: var(--fs-h3); line-height: 1.05;
  letter-spacing: -.025em; font-weight: 500; margin-bottom: 18px; color: var(--ink);
}
.case-main p { font-size: 17px; color: var(--ink-2); max-width: 68ch; margin-bottom: 14px; }
.case-main p + p { margin-top: 4px; }

.oneliner {
  font-family: var(--ff-display);
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.25; letter-spacing: -.02em;
  color: var(--ink); font-weight: 500;
  max-width: 40ch;
}
[data-fontpair="editorial"] .oneliner,
[data-fontpair="serif-display"] .oneliner { font-weight: 400; }

.tldr {
  display: grid; grid-template-columns: auto 1fr; gap: 24px;
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: 18px; padding: 24px;
}
.tldr-k { font-family: var(--ff-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.tldr-body { font-size: 16px; color: var(--ink-2); line-height: 1.55; }
.tldr-body strong { color: var(--ink); font-weight: 600; }

.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 14px; padding: 20px 18px 18px;
  position: relative; overflow: hidden;
}
.kpi .v {
  font-family: var(--ff-display);
  font-size: clamp(36px, 3.4vw, 52px);
  line-height: 1; letter-spacing: -.035em;
  font-weight: 500; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi .v .unit { font-size: .5em; color: var(--muted); }
.kpi .l { margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.35; }
.kpi .d { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--rule); font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }

/* callout quote */
.pull {
  margin: 20px 0;
  padding: 20px 0 20px 22px;
  border-left: 3px solid var(--accent);
  font-family: var(--ff-display); font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.22; letter-spacing: -.015em; color: var(--ink);
  max-width: 36ch; font-weight: 500;
}
[data-fontpair="editorial"] .pull,
[data-fontpair="serif-display"] .pull { font-weight: 400; }

/* decision log / intervention grid */
.logs { display: grid; gap: 8px; }
.logrow {
  display: grid; grid-template-columns: 60px 1.6fr 2fr 1fr; gap: 20px; align-items: start;
  padding: 18px 0; border-top: 1px solid var(--rule);
  transition: background .18s var(--ease);
}
.logrow:first-child { border-top: 1px solid var(--rule-2); }
.logrow:hover { background: var(--surface); }
.log-k { font-family: var(--ff-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); padding-top: 3px; }
.log-h { font-family: var(--ff-display); font-size: 20px; line-height: 1.15; letter-spacing: -.015em; color: var(--ink); font-weight: 500; }
.log-b { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.log-m { font-family: var(--ff-mono); font-size: 12px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.log-m .big { display:block; font-family: var(--ff-display); font-size: 28px; letter-spacing: -.025em; color: var(--accent); font-weight: 500; line-height: 1; }

/* failed list */
.failed {
  margin-top: 24px;
  background: color-mix(in oklab, var(--accent) 8%, var(--bg));
  border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--rule));
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  padding: 22px 24px;
}
[data-theme="dark"] .failed {
  background: color-mix(in oklab, var(--accent) 14%, var(--bg-2));
}
.failed-k { font-family: var(--ff-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.failed ul { list-style: none; }
.failed li { padding: 12px 0; border-top: 1px dashed var(--rule); }
.failed li:first-child { border-top: none; padding-top: 0; }
.failed li strong { display: block; font-family: var(--ff-display); font-size: 17px; letter-spacing: -.01em; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.failed li span { font-size: 14.5px; color: var(--ink-2); }

/* ----- Interactive Dashboard ----- */
.dash {
  border: 1px solid var(--rule);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
}
.dash-bar {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-2);
}
.dash-title { font-family: var(--ff-display); font-size: 17px; letter-spacing: -.01em; font-weight: 600; color: var(--ink); }
.dash-title small { font-family: var(--ff-mono); font-size: 11px; color: var(--muted); margin-left: 10px; letter-spacing: .06em; text-transform: uppercase; font-weight: 400; }
.dash-filters { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chip {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  padding: 6px 10px; border: 1px solid var(--rule-2); border-radius: 999px;
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: all .15s var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.dash-live { display: flex; align-items: center; gap: 6px; font-family: var(--ff-mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.dash-live .dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }

.dash-body {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0;
}
.dash-panel {
  padding: 22px;
  border-right: 1px solid var(--rule);
}
.dash-panel:last-child { border-right: none; }
.dash-panel-k { font-family: var(--ff-mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; display: flex; justify-content: space-between; }
.dash-panel-k span:last-child { color: var(--accent); }

.trendline-wrap { height: 180px; position: relative; }
.trendline-wrap svg { width: 100%; height: 100%; }
.trendline-wrap .axis { stroke: var(--rule); stroke-width: 1; }
.trendline-wrap .grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 3; }
.trendline-wrap .path { stroke: var(--accent); stroke-width: 2; fill: none; }
.trendline-wrap .area { fill: var(--accent); opacity: .10; }
.trendline-wrap .dot  { fill: var(--accent); }
.trendline-wrap .lbl  { font-family: var(--ff-mono); font-size: 10px; fill: var(--muted); }

.dash-legend { display: flex; gap: 18px; margin-top: 12px; font-family: var(--ff-mono); font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.dash-legend span::before { content: ""; display: inline-block; width: 10px; height: 2px; background: currentColor; margin-right: 6px; vertical-align: middle; }
.dash-legend .target { color: var(--muted); }
.dash-legend .actual { color: var(--accent); }

/* team health bars */
.health { display: grid; gap: 12px; }
.health-row { display: grid; grid-template-columns: 150px 1fr 50px; gap: 12px; align-items: center; font-size: 14px; }
.health-row .lbl { color: var(--ink-2); font-size: 13.5px; }
.health-row .bar { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; position: relative; }
.health-row .fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s var(--ease); }
.health-row .val { font-family: var(--ff-mono); font-size: 12px; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }

/* workstream cards */
.ws-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 22px; border-top: 1px solid var(--rule);
}
.ws {
  background: var(--bg); border: 1px solid var(--rule); border-radius: 12px;
  padding: 14px; display: grid; gap: 6px;
  transition: transform .18s var(--ease), border-color .18s var(--ease);
  cursor: default;
}
.ws:hover { transform: translateY(-2px); border-color: var(--rule-2); }
.ws .name { font-family: var(--ff-display); font-size: 15px; font-weight: 600; color: var(--ink); }
.ws .n { font-family: var(--ff-mono); font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }
.ws .n .good { color: #1f8a5e; }
.ws .n .warn { color: #b45309; }
.ws .n .risk { color: #b91c1c; }
[data-theme="dark"] .ws .n .good { color: #4ade80; }
[data-theme="dark"] .ws .n .warn { color: #fbbf24; }
[data-theme="dark"] .ws .n .risk { color: #f87171; }

.ws .track {
  height: 6px; background: var(--bg-2); border-radius: 999px; margin-top: 2px; position: relative; overflow: hidden;
}
.ws .track .f { position: absolute; top: 0; bottom: 0; left: 0; background: var(--accent); border-radius: 999px; }

/* System diagram for PMO */
.system-diagram {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 28px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(80px, auto);
  gap: 10px;
}
.sd-cell {
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 100px;
  position: relative;
}
.sd-cell.ink { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sd-cell.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sd-k { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.sd-cell.ink .sd-k { color: var(--accent-soft); }
.sd-cell.accent .sd-k { color: color-mix(in oklab, var(--accent-ink) 80%, transparent); }
.sd-h { font-family: var(--ff-display); font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.sd-b { font-size: 12.5px; opacity: .75; margin-top: 6px; }

/* Density: tight — collapse large paddings */
[data-density="tight"] .hero { padding: 44px 0 32px; }
[data-density="tight"] .case { padding: 72px 0; }
[data-density="tight"] .kpis { gap: 8px; }
[data-density="tight"] .kpi { padding: 14px; }
[data-density="tight"] .case-main { gap: 32px; }
[data-density="tight"] .case-top { margin-bottom: 28px; padding-bottom: 18px; }
[data-density="tight"] .logrow { padding: 12px 0; }
[data-density="tight"] .sec-head { margin-bottom: 24px; padding-bottom: 20px; }
[data-density="tight"] .hero-meta { margin-bottom: 24px; padding-bottom: 18px; }

/* ----- Sentinel dashboard preview ----- */
.sentinel-preview {
  border: 1px solid var(--rule);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #0d0c0f, #16141a);
  color: #ece8df;
  position: relative;
}
.sentinel-preview .bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255,255,255,.6);
}
.sentinel-preview .bar .tl { display: flex; gap: 6px; align-items: center; }
.sentinel-preview .bar .tl i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.2); }
.sentinel-preview .bar .tl i:nth-child(1) { background: #ff5f57; }
.sentinel-preview .bar .tl i:nth-child(2) { background: #febc2e; }
.sentinel-preview .bar .tl i:nth-child(3) { background: #28c840; }
.sentinel-preview .canvas {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 460px;
}
.sentinel-sidebar {
  border-right: 1px solid rgba(255,255,255,.08);
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  font-size: 13px;
}
.sentinel-sidebar .s-title { font-family: var(--ff-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.4); margin-bottom: 4px; }
.alert-card {
  padding: 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1);
  display: grid; gap: 4px;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.alert-card:hover, .alert-card.active { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.2); }
.alert-card.active { border-left: 3px solid var(--accent); }
.alert-card .sev { font-family: var(--ff-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.alert-card.high .sev { color: #fb7185; }
.alert-card.med  .sev { color: #fbbf24; }
.alert-card.low  .sev { color: #7dd3fc; }
.alert-card .ttl { font-family: var(--ff-display); font-size: 14.5px; letter-spacing: -.01em; color: #ece8df; font-weight: 600; }
.alert-card .sub { font-family: var(--ff-mono); font-size: 10.5px; color: rgba(255,255,255,.5); letter-spacing: .02em; }

.sentinel-detail {
  padding: 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.sentinel-detail .det-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sentinel-detail h3 {
  font-family: var(--ff-display); font-size: 24px; letter-spacing: -.015em;
  line-height: 1.15; color: #fff; font-weight: 500;
}
.sentinel-detail .conf {
  font-family: var(--ff-mono); font-size: 11px;
  color: rgba(255,255,255,.5); letter-spacing: .06em; text-transform: uppercase;
}
.sentinel-detail .conf b { color: #7dd3fc; }
.sentinel-detail p { color: rgba(255,255,255,.75); font-size: 14px; line-height: 1.55; }

.reasoning { display: grid; gap: 8px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
.reasoning .r { display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 13px; color: rgba(255,255,255,.8); }
.reasoning .r .i {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: grid; place-items: center;
  font-family: var(--ff-mono); font-size: 10px; color: var(--accent-soft);
}
.sentinel-actions { display: flex; gap: 8px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
.sentinel-actions button {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 10px 14px; border-radius: 8px;
  background: transparent; color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.15);
  cursor: pointer; transition: all .15s var(--ease);
}
.sentinel-actions button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sentinel-actions button:hover { border-color: rgba(255,255,255,.4); color: #fff; }
.sentinel-actions button.primary:hover { filter: brightness(1.05); }

/* ----- Contact ----- */
.contact {
  padding: var(--sp-sec) 0;
  background: var(--ink);
  color: var(--bg);
  margin-top: 60px;
}
[data-theme="dark"] .contact { background: #0a090b; color: #f6f3ee; }
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: end; }
.contact-title { font-family: var(--ff-display); font-size: clamp(44px, 6.5vw, 98px); line-height: .95; letter-spacing: -.04em; font-weight: 500; margin-top: 22px; }
[data-fontpair="editorial"] .contact-title,
[data-fontpair="serif-display"] .contact-title { font-weight: 400; letter-spacing: -.02em; }
.contact-title em { font-style: normal; color: var(--accent-soft); font-weight: 400; }
.contact-lede { margin-top: 22px; font-size: 18px; max-width: 56ch; color: rgba(255,255,255,.75); }
[data-theme="dark"] .contact-lede { color: var(--ink-2); }
.contact-availability {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 26px;
  font-family: var(--ff-mono); font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255,255,255,.72);
}
.contact-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
[data-theme="dark"] .contact-card { background: rgba(255,255,255,.02); }
.ctct-row {
  display: grid; grid-template-columns: 80px 1fr auto; gap: 18px; align-items: center;
  padding: 18px 20px; border-radius: 14px;
  transition: background .18s var(--ease);
}
.ctct-row:hover { background: rgba(255,255,255,.05); }
.ctct-k { color: rgba(255,255,255,.5); }
.ctct-v { font-family: var(--ff-display); font-size: 20px; font-weight: 500; letter-spacing: -.01em; color: var(--bg); }
[data-fontpair="editorial"] .ctct-v,
[data-fontpair="serif-display"] .ctct-v { font-weight: 400; }
.ctct-arrow { font-family: var(--ff-mono); color: rgba(255,255,255,.4); transition: transform .18s var(--ease), color .18s var(--ease); }
.ctct-row:hover .ctct-arrow { transform: translate(2px, -2px); color: var(--accent-soft); }

.footer { padding: 28px 0; background: var(--ink); color: rgba(255,255,255,.45); font-family: var(--ff-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
[data-theme="dark"] .footer { background: #0a090b; }
.foot-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ----- About ----- */
.about { padding: var(--sp-sec) 0; border-top: 1px solid var(--rule); }
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 60px; align-items: start; }
.about-body p { font-size: 18px; color: var(--ink-2); margin-top: 16px; max-width: 56ch; }
.about-body p:first-of-type { margin-top: 24px; font-size: 22px; color: var(--ink); line-height: 1.4; font-family: var(--ff-display); letter-spacing: -.01em; font-weight: 500; max-width: 40ch; }
[data-fontpair="editorial"] .about-body p:first-of-type,
[data-fontpair="serif-display"] .about-body p:first-of-type { font-weight: 400; }

.stack-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}
.stack-card + .stack-card { margin-top: 14px; }
.stack-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.stack-head b { color: var(--accent); font-weight: 500; }
.stack-list { list-style: none; }
.stack-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--rule); font-size: 14.5px;
}
.stack-list li:first-child { border-top: none; }
.stack-list li .tag {
  font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 4px 8px; border: 1px solid var(--rule); border-radius: 999px;
}

/* ----- Tweaks Panel ----- */
.tweaks-fab {
  position: fixed; bottom: 20px; right: 20px; z-index: 60;
  padding: 12px 16px;
  background: var(--ink); color: var(--bg);
  border: 1px solid var(--ink); border-radius: 999px;
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; transition: transform .18s var(--ease);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.tweaks-fab:hover { transform: translateY(-1px); }
.tweaks-fab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.tweaks-panel {
  position: fixed; bottom: 20px; right: 20px; z-index: 61;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--rule-2);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  overflow: hidden;
  animation: twkIn .22s var(--ease);
}
@keyframes twkIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.tweaks-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.tweaks-head b { color: var(--ink); font-weight: 600; }
.tweaks-head button {
  background: transparent; border: none; font-family: var(--ff-mono); font-size: 14px;
  color: var(--muted); cursor: pointer;
}
.tweaks-row { padding: 12px 16px; border-top: 1px solid var(--rule); }
.tweaks-row:first-of-type { border-top: none; }
.tweaks-row label {
  display: block; font-family: var(--ff-mono); font-size: 10.5px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px;
}
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--bg-2); border-radius: 10px; padding: 3px; gap: 2px;
}
.seg button {
  font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 10px; border: none; background: transparent; color: var(--ink-2); cursor: pointer;
  border-radius: 8px; transition: all .15s var(--ease);
}
.seg button.on {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw {
  width: 30px; height: 30px; border-radius: 999px; border: 2px solid transparent; cursor: pointer;
  position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
  transition: transform .15s var(--ease);
}
.sw:hover { transform: scale(1.06); }
.sw.on { border-color: var(--ink); }

.fontpair-list { display: flex; flex-direction: column; gap: 6px; }
.fontpair-btn {
  text-align: left; padding: 10px 12px; background: var(--bg); border: 1px solid var(--rule);
  border-radius: 10px; cursor: pointer; transition: all .15s var(--ease);
}
.fontpair-btn:hover { border-color: var(--rule-2); }
.fontpair-btn.on { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 8%, var(--bg)); }
.fontpair-btn .fp-name { font-family: var(--ff-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.fontpair-btn .fp-sample { font-size: 18px; letter-spacing: -.01em; color: var(--ink); font-weight: 500; }
.fontpair-btn[data-fp="neo"] .fp-sample { font-family: "Inter Tight", sans-serif; }
.fontpair-btn[data-fp="editorial"] .fp-sample { font-family: "Newsreader", serif; font-weight: 400; }
.fontpair-btn[data-fp="swiss"] .fp-sample { font-family: "IBM Plex Sans", sans-serif; }
.fontpair-btn[data-fp="serif-display"] .fp-sample { font-family: "Instrument Serif", serif; font-weight: 400; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-right { grid-template-columns: 1fr 1fr; }
  .ddpdo { grid-template-columns: repeat(2, 1fr); }
  .ddpdo li { border-right: 1px solid var(--rule); }
  .ddpdo li:nth-child(2n) { border-right: none; }
  .belief-grid { grid-template-columns: repeat(2, 1fr); }
  .belief-grid li:nth-child(2n) { border-right: none; }
  .case-grid { grid-template-columns: 1fr; gap: 32px; }
  .case-side { position: static; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-body { grid-template-columns: 1fr; }
  .dash-panel { border-right: none; border-bottom: 1px solid var(--rule); }
  .ws-grid { grid-template-columns: repeat(2, 1fr); }
  .sentinel-preview .canvas { grid-template-columns: 1fr; }
  .sentinel-sidebar { border-right: none; border-bottom: 1px solid rgba(255,255,255,.08); }
  .logrow { grid-template-columns: 1fr; gap: 6px; }
  .log-m { text-align: left; }
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --gutter: 24px; }
  .nav-links li:not(:last-child) { display: none; }
  .hero-right { grid-template-columns: 1fr; }
  .ddpdo { grid-template-columns: 1fr; }
  .ddpdo li { border-right: none; border-bottom: 1px solid var(--rule); }
  .ddpdo li:last-child { border-bottom: none; }
  .belief-grid { grid-template-columns: 1fr; }
  .belief-grid li { border-right: none; border-bottom: 1px solid var(--rule); min-height: 0; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .ws-grid { grid-template-columns: 1fr; }
  .case-top { grid-template-columns: 1fr; gap: 14px; }
  .hero-meta { grid-template-columns: 1fr 1fr; }
  .tweaks-panel { left: 20px; right: 20px; width: auto; }
}
