/* =========================================================
   Clarity: a professional portfolio theme
   Light, airy, corporate-modern. Plain CSS, no build step.
   ========================================================= */

:root {
  --bg: #f7f9fc;
  --card: #fff;
  --ink: #0f1b2d;
  --ink-2: #26364d;
  --muted: #5b6b80;
  --line: #e2e8f1;
  --primary: #2f5bea;
  --primary-600: #2449c9;
  --sky: #e8efff;
  --coral: #ff7a59;
  --coral-ink: #b8452a;
  --coral-soft: #fff0eb;
  --green: #19a974;
  --green-ink: #0f7a52;
  --green-soft: #e3f6ee;

  --r: 16px;
  --sh-1: 0 1px 2px rgba(15, 27, 45, .05), 0 2px 8px rgba(15, 27, 45, .04);
  --sh-2: 0 1px 2px rgba(15, 27, 45, .04), 0 8px 20px rgba(15, 27, 45, .06), 0 24px 48px -20px rgba(15, 27, 45, .16);
  --sh-3: 0 2px 4px rgba(15, 27, 45, .04), 0 14px 30px rgba(15, 27, 45, .08), 0 36px 64px -24px rgba(47, 91, 234, .26);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;

  --play: running; /* flipped to paused when an animated block is off-screen */
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1rem, .97rem + .15vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
svg { display: block; max-width: 100%; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
h1 { font-size: clamp(2.05rem, 1.25rem + 3.6vw, 4rem); line-height: 1.06; letter-spacing: -.035em; }
h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem); text-wrap: balance; }
h3 { font-size: clamp(1.12rem, 1.04rem + .4vw, 1.35rem); font-weight: 700; }
.accent {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.1em;
  letter-spacing: -.01em;
  color: var(--primary);
}

.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 8px; }
.skip {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  padding: 12px 18px; border-radius: 10px;
  background: var(--ink); color: #fff; font-weight: 600; text-decoration: none;
  transition: top .2s var(--ease);
}
.skip:focus { top: 12px; }

.container { width: min(1200px, 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border: 1.5px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: .975rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s ease, background-color .25s ease, color .25s ease, border-color .25s ease;
}
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 1px 2px rgba(15, 27, 45, .12), 0 10px 22px -8px rgba(47, 91, 234, .6);
}
.btn-primary:hover { background: var(--primary-600); transform: translateY(-2px); box-shadow: 0 2px 4px rgba(15, 27, 45, .12), 0 16px 28px -10px rgba(47, 91, 234, .7); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: var(--sh-1); }
.btn-ghost:hover { color: var(--primary); border-color: #c4d2f6; transform: translateY(-2px); }
.btn-sm { min-height: 44px; padding: 10px 18px; font-size: .925rem; }
.btn .ic { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.btn:hover .ic-arrow { transform: translateX(3px); }
.btn-wa { background: var(--green-soft); color: var(--green-ink); border-color: #c3e9d8; }
.btn-wa:hover { background: #d4f1e4; transform: translateY(-2px); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 249, 252, .85);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .3s ease, border-color .3s ease, background-color .3s ease;
}
.site-header.scrolled {
  background: rgba(255, 255, 255, .92);
  border-color: var(--line);
  box-shadow: 0 8px 28px -14px rgba(15, 27, 45, .22);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.06rem; letter-spacing: -.01em;
}
.brand-mark {
  position: relative; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--primary); color: #fff; font-size: .82rem; font-weight: 800; letter-spacing: .02em;
  box-shadow: 0 6px 14px -6px rgba(47, 91, 234, .75);
}
.brand-mark::after {
  content: ""; position: absolute; top: -3px; right: -3px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--coral); border: 2px solid var(--bg);
}
.nav-menu { display: flex; align-items: center; gap: 18px; }
.nav-links { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: 999px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: color .2s ease, background-color .2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--primary); background: var(--sky); }
.nav-toggle { display: none; }

@media (max-width: 979.98px) {
  .nav-toggle {
    display: inline-grid; place-items: center; width: 46px; height: 46px;
    border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); cursor: pointer;
  }
  .burger, .burger::before, .burger::after {
    display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform .3s var(--ease), background-color .2s ease;
  }
  .burger { position: relative; }
  .burger::before, .burger::after { content: ""; position: absolute; left: 0; }
  .burger::before { top: -6px; }
  .burger::after { top: 6px; }
  .menu-open .burger { background: transparent; }
  .menu-open .burger::before { transform: translateY(6px) rotate(45deg); }
  .menu-open .burger::after { transform: translateY(-6px) rotate(-45deg); }

  .js .nav-menu {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 12px;
    max-height: calc(100vh - var(--header-h)); max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
    padding: 10px var(--gutter) 22px;
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 30px -18px rgba(15, 27, 45, .28);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s ease, transform .25s var(--ease), visibility 0s linear .25s;
  }
  .js .menu-open .nav-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .25s var(--ease); }
  .js .nav-links { flex-direction: column; gap: 2px; }
  .js .nav-links a { width: 100%; min-height: 50px; padding: 0 14px; border-radius: 12px; font-size: 1.05rem; }
  .js .nav-menu .btn { width: 100%; min-height: 50px; }

  /* No-JS fallback: links become a scrollable row */
  html:not(.js) .nav-toggle { display: none; }
  html:not(.js) .nav-wrap { flex-wrap: wrap; height: auto; padding: 8px 0; }
  html:not(.js) .nav { width: 100%; overflow-x: auto; }
  html:not(.js) .nav-menu .btn { display: none; }
  html:not(.js) .nav-links a { padding: 0 10px; white-space: nowrap; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(24px, 5vw, 72px) 0 clamp(48px, 7vw, 96px);
  background:
    radial-gradient(55% 60% at 88% 18%, rgba(47, 91, 234, .10), transparent 70%),
    radial-gradient(32% 38% at 2% 62%, rgba(255, 122, 89, .09), transparent 70%);
}
.hero-grid { display: grid; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-copy { max-width: 640px; }
.status {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  margin-bottom: 22px; padding: 8px 16px 8px 13px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; box-shadow: var(--sh-1);
  font-size: .85rem; font-weight: 600; color: var(--ink-2);
}
.hero-kicker { margin-bottom: 12px; font-weight: 600; color: var(--primary); text-wrap: balance; }
.hero h1 { margin-bottom: 20px; }
.hero-lede { max-width: 34em; margin-bottom: 30px; font-size: clamp(1.04rem, .98rem + .35vw, 1.2rem); color: var(--muted); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .92rem; font-weight: 500; }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts .ic { width: 18px; height: 18px; color: var(--primary); }

.hero-art { position: relative; width: 100%; max-width: 460px; margin-inline: auto; }
.portrait { width: 100%; height: auto; }
.chips { margin: 0; padding: 0; list-style: none; }
.chip {
  position: absolute; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px 9px 9px; border-radius: 14px;
  background: rgba(255, 255, 255, .96); border: 1px solid rgba(226, 232, 241, .9); box-shadow: var(--sh-2);
  animation: bob 6s ease-in-out infinite; animation-play-state: var(--play);
}
.chip strong { display: block; font-size: 1rem; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.chip small { display: block; font-size: .74rem; font-weight: 500; line-height: 1.3; color: var(--muted); }
.chip-ic, .stat-ic, .sg-ic, .edu-ic {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px;
}
.ic-green { background: var(--green-soft); color: var(--green-ink); }
.ic-blue { background: var(--sky); color: var(--primary); }
.ic-coral { background: var(--coral-soft); color: var(--coral-ink); }
.ic-ink { background: #e9edf3; color: var(--ink); }
.chip-1 { top: 7%; left: 0; }
.chip-2 { top: 62%; right: 0; animation-duration: 7s; animation-delay: -2.4s; }
.chip-3 { bottom: 6%; left: 3%; animation-duration: 6.5s; animation-delay: -4.2s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* page-load entrance (pure CSS, ends visible, so it works without JS) */
.rise { animation: rise .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes rise { from { opacity: 0; translate: 0 16px; } }

.pulse { position: relative; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green);
  animation: ping 2.2s var(--ease) infinite; animation-play-state: var(--play);
}
@keyframes ping { 0% { transform: scale(1); opacity: .65; } 80%, 100% { transform: scale(2.9); opacity: 0; } }

@media (max-width: 479.98px) {
  .hide-sm { display: none; }
  .hero-ctas .btn { flex: 1 1 100%; }
}
@media (max-width: 380px) {
  .chip { padding: 7px 10px 7px 7px; gap: 8px; }
  .chip-ic { width: 30px; height: 30px; }
  .chip strong { font-size: .9rem; }
  .chip small { font-size: .68rem; }
}
@media (min-width: 880px) {
  .hero-grid { grid-template-columns: 1.08fr .92fr; }
  .hero-art { max-width: 520px; }
  .chip-1 { left: -4%; }
  .chip-2 { top: 54%; right: -4%; }
}

/* ---------- Logo strip ---------- */
.logos { padding: 0 0 clamp(44px, 6vw, 72px); }
.logos-label {
  margin-bottom: 18px; text-align: center;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.logo-row {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  margin: 0; padding: 0; list-style: none;
}
.logo {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 60px; padding: 0 8px;
  border-radius: 12px; color: #66768c; white-space: nowrap;
  transition: color .25s ease, background-color .25s ease;
}
.logo:hover { color: var(--ink); background: #fff; }
.logo svg { width: 22px; height: 22px; flex: none; }
.logo span { font-size: 1.08rem; line-height: 1; }
.lg-kuberly span { font-weight: 800; letter-spacing: -.03em; }
.lg-dewleaf span { font-weight: 600; font-style: italic; letter-spacing: -.01em; }
.lg-vidya span { font-weight: 700; letter-spacing: -.02em; }
.lg-tarang span { font-size: .8rem; font-weight: 700; letter-spacing: .2em; }
.lg-saffron span { font-weight: 400; letter-spacing: -.01em; }
.lg-saffron b { font-weight: 800; }
.lg-kaveri span { font-size: .98rem; font-weight: 600; letter-spacing: .01em; }
@media (max-width: 400px) {
  .logo { gap: 6px; padding: 0 4px; }
  .logo svg { width: 18px; height: 18px; }
  .logo span { font-size: .92rem; }
  .lg-tarang span { font-size: .68rem; letter-spacing: .12em; }
  .lg-kaveri span { font-size: .84rem; }
}
@media (min-width: 560px) { .logo-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .logo-row { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-white { background: #fff; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: var(--coral); }
.section-head { max-width: 660px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-bottom: 14px; }
.section-head h2:last-child { margin-bottom: 0; }
.section-lede { margin: 0; font-size: 1.075rem; color: var(--muted); }

/* ---------- About ---------- */
.about-grid { display: grid; gap: clamp(36px, 5vw, 72px); align-items: center; }
.about-copy { max-width: 620px; }
.about-copy h2 { margin-bottom: 20px; }
.about-copy p { color: var(--muted); }
.ticks { display: grid; gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; }
.ticks li { display: flex; align-items: flex-start; gap: 12px; font-weight: 500; color: var(--ink-2); }
.tick { display: grid; place-items: center; flex: none; width: 26px; height: 26px; margin-top: 0; border-radius: 50%; background: var(--green-soft); color: var(--green-ink); }
.tick .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.impact-title { margin-bottom: 16px; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 16px); margin: 0; padding: 0; list-style: none; }
.stat { padding: clamp(14px, 2.4vw, 26px); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.stat-num {
  display: block; margin: 14px 0 6px;
  font-size: clamp(1.55rem, 1.2rem + 1.7vw, 2.6rem); font-weight: 800; line-height: 1.1; letter-spacing: -.035em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stat p { margin: 0; font-size: .9rem; line-height: 1.45; color: var(--muted); }
@media (min-width: 960px) { .about-grid { grid-template-columns: 1.1fr .9fr; } }

/* hover lift (pointer devices only) */
.lift { transition: transform .3s var(--ease), box-shadow .3s ease, border-color .3s ease; }
@media (hover: hover) {
  .lift:hover { transform: translateY(-5px); box-shadow: var(--sh-3); border-color: #d0dbf4; }
}

/* ---------- Case studies ---------- */
.cases { display: grid; gap: clamp(20px, 3vw, 32px); }
.case {
  display: grid; gap: clamp(20px, 3vw, 44px); align-items: center;
  padding: clamp(16px, 3vw, 36px);
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--sh-1);
}
.case-body { min-width: 0; }
.case-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag { padding: 5px 11px; border-radius: 999px; background: var(--sky); color: var(--primary-600); font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.tag-soft { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.case h3 { font-size: clamp(1.25rem, 1.05rem + .9vw, 1.7rem); margin-bottom: 8px; }
.case-meta { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .9rem; font-weight: 500; color: var(--muted); }
.case-meta .ic { width: 17px; height: 17px; color: var(--primary); }
.par { display: grid; gap: 14px; margin: 22px 0 0; }
.par-row { display: grid; grid-template-columns: 104px 1fr; gap: 12px; }
.par dt {
  display: flex; align-items: center; gap: 8px; height: 1.6em;
  font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
}
.par dt::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.par-row:nth-child(2) dt::before { background: var(--primary); }
.par-row:nth-child(3) dt::before { background: var(--green); }
.par dd { margin: 0; font-size: .975rem; color: var(--muted); }
.results { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.results li {
  display: flex; flex-direction: column; flex: 1 1 108px;
  padding: 10px 14px; border-radius: 12px; background: var(--green-soft);
  font-size: .8rem; font-weight: 500; line-height: 1.35; color: var(--ink-2);
}
.results strong { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; color: var(--green-ink); white-space: nowrap; }

.case-visual {
  order: -1; min-width: 0; margin: 0;
  padding: clamp(14px, 2.4vw, 26px);
  border: 1px solid #e0e8fb; border-radius: 14px;
  background: linear-gradient(160deg, #eef3ff 0%, #f8faff 100%);
}
.kpi { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 14px; }
.kpi strong { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem); font-weight: 800; line-height: 1; letter-spacing: -.035em; color: var(--primary); font-variant-numeric: tabular-nums; }
.kpi span { font-size: .9rem; font-weight: 500; color: var(--muted); }
.ch { width: 100%; height: auto; overflow: visible; }
.ch text { font-family: var(--font); font-size: 12.5px; font-weight: 500; fill: var(--muted); }
.ch .strong, .ch-label.strong text { font-weight: 700; fill: var(--ink); }
.ch .blue { fill: var(--primary); }
.ch-grid { fill: none; stroke: #d8e1f4; stroke-width: 1; stroke-dasharray: 3 4; }
.ch-axis { fill: none; stroke: #b9c6e0; stroke-width: 1.5; }
.ch-prior { fill: none; stroke: #9aa8bd; stroke-width: 2; stroke-dasharray: 5 5; }
.ch-line { fill: none; stroke: var(--primary); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease) .15s, opacity .2s ease; }
.ch-area { transition: opacity 1s ease 1s; }
.ch-dot { fill: var(--primary); stroke: #fff; stroke-width: 3; transform-box: fill-box; transform-origin: center; transition: opacity .3s ease 1.55s, transform .5s var(--ease) 1.55s; }
.ch-label { transition: opacity .5s ease 1s; }
.ch-bar { transform-box: fill-box; transform-origin: 50% 100%; transition: transform 1s var(--ease); }
.ch-hbar { transform-box: fill-box; transform-origin: 0 50%; transition: transform 1.1s var(--ease); }
.fn-track { fill: #fff; stroke: #dde6f8; }
.ch .fn-l { font-weight: 600; fill: var(--ink-2); }
.ch .fn-v { font-weight: 700; fill: var(--ink); }
/* chart start states (only once JS is running, so no-JS shows finished charts) */
.js .chart:not(.in) .ch-line { stroke-dashoffset: 1; opacity: 0; }
.js .chart:not(.in) .ch-area, .js .chart:not(.in) .ch-label { opacity: 0; }
.js .chart:not(.in) .ch-dot { opacity: 0; transform: scale(0); }
.js .chart:not(.in) .ch-bar { transform: scaleY(0); }
.js .chart:not(.in) .ch-hbar { transform: scaleX(0); }
.case-visual figcaption { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: .78rem; font-weight: 500; color: var(--muted); }
.key { display: inline-flex; align-items: center; gap: 7px; }
.key::before { content: ""; width: 16px; height: 3px; border-radius: 3px; background: var(--primary); }
.key-prior::before { height: 0; border-top: 2px dashed #9aa8bd; background: none; }
.key-bar::before { width: 10px; height: 10px; border-radius: 3px; }

@media (max-width: 520px) {
  .par-row { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 599.98px) {
  .ch text { font-size: 14.5px; }
}
@media (max-width: 419.98px) {
  .ch text { font-size: 16px; }
}
/* tablets: KPI beside the chart so the chart doesn't balloon */
@media (min-width: 600px) and (max-width: 959.98px) {
  .case-visual {
    display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
    grid-template-areas: "kpi ch" "cap ch"; column-gap: 28px; align-items: center;
  }
  .kpi { grid-area: kpi; flex-direction: column; align-items: flex-start; align-self: end; margin: 0; }
  .ch { grid-area: ch; }
  .case-visual figcaption { grid-area: cap; align-self: start; flex-direction: column; }
}
@media (min-width: 960px) {
  .case { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); }
  .case-visual { order: 0; }
  .case:nth-child(even) { grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); }
  .case:nth-child(even) .case-visual { order: -1; }
}

/* ---------- Experience timeline ---------- */
.exp-grid { display: grid; gap: clamp(32px, 5vw, 72px); }
.exp-intro { max-width: 560px; }
.exp-intro h2 { margin-bottom: 16px; }
.exp-intro p { color: var(--muted); margin-bottom: 26px; }
.tl { position: relative; padding-left: 44px; }
.tl-track { position: absolute; left: 15px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: #e3e9f3; overflow: hidden; }
.tl-fill { position: absolute; inset: 0; border-radius: 3px; background: linear-gradient(var(--primary), #7895f2); transform-origin: top; }
.js .tl-fill { transform: scaleY(0); }
.tl-list { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.tl-item { position: relative; padding: clamp(18px, 2.6vw, 26px); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.tl-item::before {
  content: ""; position: absolute; left: -36px; top: 30px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--primary); border: 3px solid var(--primary); box-shadow: 0 0 0 5px #fff;
  transition: background-color .3s ease, border-color .3s ease, transform .3s var(--ease);
}
.js .tl-item:not(.passed)::before { background: #fff; border-color: #c8d2e2; transform: scale(.85); }
.tl-date {
  display: inline-block; margin-bottom: 10px; padding: 4px 11px; border-radius: 999px;
  background: var(--sky); color: var(--primary-600); font-size: .78rem; font-weight: 700;
}
.tl-item h3 { margin-bottom: 4px; }
.tl-org { margin-bottom: 12px; font-size: .95rem; color: var(--muted); }
.tl-org strong { color: var(--ink-2); }
.tl-points { display: grid; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.tl-points li { position: relative; padding-left: 18px; font-size: .95rem; color: var(--muted); }
.tl-points li::before { content: ""; position: absolute; left: 2px; top: .65em; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }
.tl-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tl-tags li { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .75rem; font-weight: 600; color: var(--ink-2); }
@media (max-width: 400px) {
  .tl { padding-left: 34px; }
  .tl-track { left: 10px; }
  .tl-item::before { left: -31px; top: 31px; width: 15px; height: 15px; }
}
@media (min-width: 960px) {
  .exp-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; }
}
@media (min-width: 960px) and (min-height: 640px) {
  .exp-intro { position: sticky; top: calc(var(--header-h) + 40px); }
}

/* ---------- Skills ---------- */
.skills-grid { display: grid; gap: clamp(16px, 2.4vw, 24px); }
.skill-groups { display: grid; gap: clamp(16px, 2.4vw, 24px); }
.skill-group, .rings-card { padding: clamp(18px, 2.6vw, 28px); border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--sh-1); }
.skill-group h3 { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 1.08rem; }
.sg-ic { width: 34px; height: 34px; }
.sg-ic .ic { width: 18px; height: 18px; }
.chips-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips-list li {
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
  font-size: .875rem; font-weight: 500; color: var(--ink-2);
  transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.chips-list li:hover { border-color: #bfcdf5; background: var(--sky); color: var(--primary-600); }
@media (max-width: 479.98px) {
  .chips-list { gap: 6px; }
  .chips-list li { padding: 6px 11px; font-size: .82rem; }
}
.rings-card h3 { margin-bottom: 4px; font-size: 1.08rem; }
.rings-note { margin-bottom: 22px; font-size: .85rem; color: var(--muted); }
.rings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; margin: 0; padding: 0; list-style: none; }
.ring { position: relative; width: min(124px, 100%); aspect-ratio: 1; margin: 0 auto 10px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #edf1f8; stroke-width: 10; }
.ring-fg {
  fill: none; stroke: var(--c, var(--primary)); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p));
  transition: stroke-dashoffset 1.6s var(--ease), opacity .2s ease;
}
.js .rings:not(.in) .ring-fg { stroke-dashoffset: 100; opacity: 0; }
.ring strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rings p { margin: 0; text-align: center; font-size: .875rem; font-weight: 600; line-height: 1.35; color: var(--ink-2); }
@media (min-width: 640px) and (max-width: 959.98px) {
  .rings { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .skills-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); align-items: start; }
}
@media (min-width: 960px) and (min-height: 720px) {
  .rings-card { position: sticky; top: calc(var(--header-h) + 24px); }
}

/* ---------- Education ---------- */
.edu-grid { display: grid; gap: clamp(16px, 2.4vw, 24px); }
.edu-card { display: flex; flex-direction: column; padding: clamp(20px, 2.8vw, 30px); border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
.coursework { margin-top: auto; padding-top: 20px; }
.coursework p { margin-bottom: 8px; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.edu-ic { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 18px; }
.edu-ic .ic { width: 22px; height: 22px; }
.edu-years { margin-bottom: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); }
.edu-card h3 { margin-bottom: 4px; }
.edu-school { margin-bottom: 14px; font-weight: 500; color: var(--muted); }
.edu-points, .cert-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.edu-points li { position: relative; padding-left: 18px; font-size: .925rem; color: var(--ink-2); }
.edu-points li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.cert-list { margin-top: 12px; gap: 10px; }
.cert-list li { display: flex; flex-direction: column; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.cert-list strong { font-size: .925rem; font-weight: 700; }
.cert-list span { font-size: .8rem; color: var(--muted); }
@media (min-width: 720px) {
  .edu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edu-card.certs { grid-column: 1 / -1; }
  .edu-card.certs .cert-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1080px) {
  .edu-grid { grid-template-columns: 1fr 1fr 1.15fr; }
  .edu-card.certs { grid-column: auto; }
  .edu-card.certs .cert-list { grid-template-columns: 1fr; margin-top: 12px; }
}

/* ---------- Testimonials carousel ---------- */
.carousel { max-width: 880px; margin-inline: auto; }
.car-viewport { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: var(--sh-2); }
.car-track { display: flex; transition: transform .6s var(--ease); }
.car-slide { flex: 0 0 100%; min-width: 0; }
.quote { margin: 0; padding: clamp(40px, 6vw, 60px) clamp(20px, 6vw, 64px) clamp(32px, 5vw, 52px); text-align: center; }
.quote-mark { width: 44px; height: 33px; margin: 0 auto 20px; fill: var(--coral); opacity: .9; }
.quote blockquote { margin: 0 0 28px; }
.quote p { margin: 0; font-size: clamp(1.06rem, .98rem + .6vw, 1.38rem); font-weight: 500; line-height: 1.6; letter-spacing: -.01em; color: var(--ink); }
.quote figcaption { display: inline-flex; align-items: center; gap: 12px; text-align: left; }
.quote figcaption strong { display: block; font-size: .975rem; }
.quote figcaption span span { display: block; font-size: .85rem; color: var(--muted); }
.avatar { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--c); color: #fff; font-size: .9rem; font-weight: 700; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--line); }
.car-play {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.car-play:hover { background: var(--bg); color: var(--ink); }
.car-play .ic { width: 18px; height: 18px; }
.car-play .i-play, .carousel.is-stopped .car-play .i-pause { display: none; }
.carousel.is-stopped .car-play .i-play { display: block; }
/* no-JS: slides become a swipeable strip */
html:not(.js) .car-play, html:not(.js) .car-progress, html:not(.js) .car-controls { display: none; }
html:not(.js) .car-track { overflow-x: auto; scroll-snap-type: x mandatory; }
html:not(.js) .car-slide { scroll-snap-align: start; }
.car-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #eef2f8; }
.car-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #7c97f2); transform: scaleX(0); transform-origin: left; }
.car-progress span.run { animation: carprog var(--car-delay, 6.5s) linear forwards; animation-play-state: var(--play); }
@keyframes carprog { to { transform: scaleX(1); } }
.car-controls { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.car-btn {
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; box-shadow: var(--sh-1);
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s var(--ease);
}
.car-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.car-btn:active { transform: scale(.95); }
.car-dots { display: flex; }
.car-dot { position: relative; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; }
.car-dot::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 999px; background: #c9d3e3; transition: width .3s var(--ease), margin .3s var(--ease), background-color .3s ease;
}
.car-dot:hover::before { background: #93a6c6; }
.car-dot[aria-current="true"]::before { width: 26px; margin-left: -13px; background: var(--primary); }

/* ---------- Contact ---------- */
.contact-card { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: var(--sh-2); }
.contact-info {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(20px, 4.4vw, 52px);
  background: linear-gradient(150deg, #3563f0 0%, #2449c9 58%, #1c3aa8 100%); color: #fff;
}
.contact-info::before, .contact-info::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.contact-info::before { width: 320px; height: 320px; right: -120px; top: -140px; background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 70%); }
.contact-info::after { width: 220px; height: 220px; right: -100px; bottom: -120px; border: 30px solid rgba(255, 255, 255, .07); }
.eyebrow-light { color: #fff; }
.contact-info h2 { margin-bottom: 16px; color: #fff; }
.contact-info .accent { color: #ffd9cd; }
.contact-info p { color: #e6ecff; }
.contact-info :focus-visible { outline-color: #fff; }
.reply { display: inline-flex; align-items: center; gap: 10px; padding: 8px 15px 8px 13px; border-radius: 999px; background: rgba(255, 255, 255, .13); font-size: .9rem; font-weight: 600; }
.contact-info .reply { color: #fff; }
.reply .pulse { background: #4ee0a6; }
.reply .pulse::after { background: #4ee0a6; }
.contact-list { display: grid; gap: 10px; margin: 26px 0 0; padding: 0; list-style: none; }
.c-item {
  display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; background: rgba(255, 255, 255, .1);
  color: #fff; text-decoration: none;
  transition: background-color .2s ease, transform .25s var(--ease);
}
.c-item:hover { background: rgba(255, 255, 255, .18); transform: translateX(4px); }
.c-ic { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 11px; background: #fff; color: var(--primary); }
.c-item > span:last-child { min-width: 0; }
.c-item small { display: block; font-size: .75rem; font-weight: 500; color: #e6ecff; }
.c-item small + span { display: block; font-weight: 600; overflow-wrap: anywhere; }

.contact-form-wrap { padding: clamp(22px, 4.4vw, 52px); }
.form { display: grid; gap: 16px; }
.form h3 { margin-bottom: 2px; font-size: 1.25rem; }
.field-row { display: grid; gap: 16px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea {
  display: block; width: 100%; min-height: 48px; padding: 12px 14px;
  border: 1.5px solid #d4dce9; border-radius: 12px; background: var(--bg);
  font-size: 1rem; color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.field select {
  -webkit-appearance: none; appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b80' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.field textarea { min-height: 128px; resize: vertical; }
.field ::placeholder { color: #6b7a8f; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b9c6dc; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(47, 91, 234, .16); }
.has-error input, .has-error textarea { border-color: #d0442e; background: #fff8f6; }
.field-error { margin: 6px 0 0; font-size: .82rem; font-weight: 600; color: #b42318; }
.field-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.form-note { margin: 0; font-size: .8rem; color: var(--muted); }
.form-success { display: grid; justify-items: center; gap: 14px; padding: clamp(16px, 4vw, 40px) 4px; text-align: center; animation: pop .5s var(--ease); }
.form-success h3 { font-size: 1.3rem; }
.form-success h3:focus { outline: none; }
.form-success p { max-width: 30em; margin: 0; color: var(--muted); }
.success-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green-ink); box-shadow: 0 0 0 10px rgba(25, 169, 116, .08); }
.success-ic .ic { width: 30px; height: 30px; stroke-width: 2.6; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@media (max-width: 479.98px) { .form-actions .btn { flex: 1 1 100%; } }
@media (max-width: 374.98px) {
  .c-item { gap: 12px; padding: 10px 12px; }
  .c-ic { width: 36px; height: 36px; }
  .c-item small + span { font-size: .92rem; }
}
@media (min-width: 600px) { .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .contact-card { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); } }

/* ---------- Footer ---------- */
.site-footer { padding: 40px 0 28px; border-top: 1px solid var(--line); background: #fff; }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.f-brand p { margin: 6px 0 0; font-size: .9rem; color: var(--muted); }
.f-brand .brand-mark::after { border-color: #fff; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.socials a {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2);
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .25s var(--ease);
}
.socials a:hover { color: #fff; background: var(--primary); border-color: var(--primary); transform: translateY(-2px); }
.socials .to-top { background: var(--sky); border-color: var(--sky); color: var(--primary); }
.footer-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px;
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--muted);
}
.footer-base p { margin: 0; }
.credit strong { color: var(--ink-2); font-weight: 700; }

/* ---------- Short landscape screens (phones on their side) ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --header-h: 60px; }
  .hero { padding-top: 16px; }
  .status { margin-bottom: 14px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 20px; z-index: 90;
  width: fit-content; max-width: 460px; margin-inline: auto;
  padding: 12px 18px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: .9rem; font-weight: 500; line-height: 1.45; text-align: center;
  box-shadow: var(--sh-3);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: opacity .25s ease, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: none; }

/* ---------- Scroll reveal (only hides content once JS is running) ---------- */
.js .reveal {
  opacity: 0; translate: 0 22px;
  transition:
    opacity .8s var(--ease) calc(var(--rd, 0) * 90ms),
    translate .8s var(--ease) calc(var(--rd, 0) * 90ms),
    transform .3s var(--ease), box-shadow .3s ease, border-color .3s ease;
}
.js .reveal.in { opacity: 1; translate: none; }

/* pause continuous animations when off-screen or when the tab is hidden */
.is-off, html.is-hidden { --play: paused; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; translate: none; }
  .pulse::after { display: none; }
  .car-progress { display: none; }
}


/* ===== Demo chrome: "All themes" link back to the Spectrix gallery =====
   Not part of the portfolio design itself. Sits under the header/menu and toasts;
   hidden (via the inline script next to it) when the page runs inside the gallery's device preview. */
.demo-back {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  text-decoration: none;
  white-space: nowrap;
  animation: demo-back-in .6s .8s backwards cubic-bezier(.2, .8, .2, 1);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font: 600 14px/1 var(--font);
  box-shadow: var(--sh-2);
  transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.demo-back[hidden] { display: none; }
.demo-back svg { width: 18px; height: 18px; flex: none; transition: transform .25s ease; }
.demo-back:hover svg,
.demo-back:focus-visible svg { transform: translateX(-3px); }
.demo-back svg { color: var(--primary); }
.demo-back:hover,
.demo-back:focus-visible { color: var(--primary); border-color: #c9d6f5; transform: translateY(-2px); }

@keyframes demo-back-in { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) {
  .demo-back { animation: none; transition: none; }
  .demo-back svg { transition: none; }
}
