:root {
  --bg-page: #faf9f7;
  --bg-raised: #ffffff;
  --ink: #1a1815;
  --ink-muted: #6f6a61;
  --ink-faint: #757068;
  --hairline: #e6e2da;
  --hairline-strong: #d3cec3;
  --accent: #1e40af;
  --accent-soft: rgba(30, 64, 175, 0.07);

  --font-display: 'Newsreader', 'Noto Serif Devanagari', 'Noto Serif Bengali', 'Noto Serif', Georgia, serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

  --measure: 68ch;
  --wave-static: rgba(30, 64, 175, 0.35);
  --wave-live: #1e40af;
}

html.dark {
  --bg-page: #141312;
  --bg-raised: #1b1917;
  --ink: #f3f0e9;
  --ink-muted: #a09a8e;
  --ink-faint: #96908a;
  --hairline: #2a2823;
  --hairline-strong: #3a3730;
  --accent: #93a6f7;
  --accent-soft: rgba(147, 166, 247, 0.09);

  --wave-static: rgba(147, 166, 247, 0.3);
  --wave-live: #93a6f7;
}


* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  background-color: var(--bg-page);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-page);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
}

::selection { background: var(--accent-soft); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--hairline-strong); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }


.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.display-1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.75rem, 6vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.display-2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.display-3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.lede {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: var(--measure);
}

.prose-body {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--ink-muted);
}

.prose-body strong { color: var(--ink); font-weight: 600; }

.small-caps {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}


.rule { border: 0; border-top: 1px solid var(--hairline); margin: 0; }



.work-row {
  border-top: 1px solid var(--hairline);
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li {
  border-top: 1px solid var(--hairline);
  padding: 0.65rem 0;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  line-height: 1.6;
}
.doc-list li:first-child { border-top: 0; padding-top: 0; }


.meta-status {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.meta-status[data-state="working"] { color: var(--accent); }
.meta-status[data-state="done"] { color: var(--ink-muted); }


.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-page) 94%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  transition: background-color 0.25s ease;
}

.nav-link {
  font-size: 0.8125rem;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink); }


.ledger-value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.5rem, 4vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.ledger-cell { border-top: 1px solid var(--hairline); padding: 2rem 2rem 2rem 0; }
@media (min-width: 1024px) {
  .ledger-cell { border-top: 0; border-left: 1px solid var(--hairline); padding: 2.25rem 0 2rem 2rem; }
  .ledger-cell:first-child { border-left: 0; padding-left: 0; }
}


.fact-rail { font-size: 0.875rem; }

.fact-rail > * {
  border-top: 1px solid var(--hairline);
  padding: 0.75rem 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.fact-rail > *:first-child { border-top: 0; padding-top: 0; }


.portrait {
  width: 72px;
  height: 72px;
  border-radius: 2px;
  object-fit: cover;
  filter: grayscale(18%);
  border: 1px solid var(--hairline-strong);
}


.btn-ink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ink);
  color: var(--bg-page);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--ink);
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.btn-ink:hover { opacity: 0.86; }

.btn-quiet {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--hairline-strong);
  transition: border-color 0.15s ease;
}
.btn-quiet:hover { border-color: var(--ink); }

.link-quiet {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
}
.link-quiet:hover { text-decoration: underline; text-underline-offset: 3px; }

.copy-trigger { color: var(--accent); cursor: pointer; }
.copy-trigger:hover { text-decoration: underline; text-underline-offset: 3px; }


.field-input {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--hairline-strong);
  padding: 0.7rem 0.85rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--ink);
  transition: border-color 0.15s ease;
  border-radius: 2px;
}
.field-input:focus { border-color: var(--ink); }
.field-input::placeholder { color: var(--ink-faint); }

.field-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}


.install-cmd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--hairline);
  background: var(--bg-raised);
  padding: 0.6rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink);
  border-radius: 2px;
}
.install-cmd .cmd-prompt { color: var(--ink-faint); user-select: none; }


.console-panel {
  border: 1px solid var(--hairline);
  border-radius: 2px;
  background: var(--bg-raised);
}

.console-head {
  border-bottom: 1px solid var(--hairline);
  padding: 0.75rem 1.1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.console-body { padding: 1.1rem; }

.asr-sample-tab,
.gita-prompt-btn {
  background: transparent;
  border: 1px solid var(--hairline-strong);
  color: var(--ink-muted);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
  border-radius: 2px;
}
.asr-sample-tab:hover,
.gita-prompt-btn:hover { color: var(--ink); border-color: var(--ink); }

.asr-sample-tab.is-active,
.gita-prompt-btn.is-active {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--accent-soft);
}

.asr-sample-tab:disabled,
.gita-prompt-btn:disabled { opacity: 0.55; cursor: default; }

.wave-strip {
  border: 1px solid var(--hairline);
  background: var(--bg-page);
  padding: 0.75rem;
  border-radius: 2px;
}

.shloka-quote {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.8;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-align: center;
}

.demo-run {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.demo-run:hover:not(:disabled) { background: var(--ink); color: var(--bg-page); }
.demo-run:disabled { opacity: 0.55; cursor: default; }

.limiter-row {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  border-top: 1px solid var(--hairline);
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-muted);
}
.limiter-row .ok { color: var(--ink); }
.limiter-row .exceeded { color: var(--accent); }


.timeline { border-left: 1px solid var(--hairline); }
.timeline-dot {
  width: 9px;
  height: 9px;
  border: 1px solid var(--ink);
  background: var(--bg-page);
  transform: rotate(45deg);
}


.dev-terminal {
  background: #171512;
  color: #b8b2a5;
  border: 1px solid #2c2925;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  border-radius: 3px;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.5);
}

.dev-terminal .term-head {
  border-bottom: 1px solid #2c2925;
  color: #8a8478;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.dev-terminal .term-title { color: #b8b2a5; }
.dev-terminal .term-close {
  background: none;
  border: 0;
  color: #8a8478;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
}
.dev-terminal .term-close:hover { color: #edeae2; }

.dev-terminal .term-body a { color: #93a6f7; }
.dev-terminal .term-body .cmd-name { color: #93a6f7; }
.dev-terminal .term-body .cmd-prompt { color: #8a8478; }
.dev-terminal .term-body strong { color: #edeae2; font-weight: 600; }
.dev-terminal .term-body code { color: #b8b2a5; }

.dev-terminal .term-input-row {
  border-top: 1px solid #2c2925;
  background: #131110;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.dev-terminal .term-input-row input {
  background: transparent;
  border: 0;
  color: #edeae2;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  flex: 1;
}
.dev-terminal .term-input-row input:focus { outline: none; }


#portfolio-toast {
  background: var(--ink);
  color: var(--bg-page);
  font-size: 0.8125rem;
  padding: 0.7rem 1rem;
  border-radius: 2px;
}


@keyframes spin { to { transform: rotate(360deg); } }

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.revealed { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}

#cv-print-sheet {
  display: none !important;
}


@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 15mm 12mm 15mm;
  }

  :root, html, html.dark, body {
    --bg-page: #ffffff !important;
    --bg-raised: #ffffff !important;
    --ink: #0f172a !important;
    --ink-muted: #334155 !important;
    --ink-faint: #64748b !important;
    --hairline: #cbd5e1 !important;
    --hairline-strong: #94a3b8 !important;
    --accent: #1e40af !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 10pt !important;
    line-height: 1.4 !important;
    orphans: 3;
    widows: 3;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  header#main-nav,
  #hero,
  #stats-section,
  #ai-research,
  #govtech,
  #saas,
  #open-source,
  #experience,
  #credentials,
  #contact,
  footer,
  #terminal-modal,
  #portfolio-toast,
  .no-print,
  body > section,
  body > header,
  body > footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  #cv-print-sheet {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
  }

  .cv-page {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .cv-header {
    border-bottom: 2px solid #0f172a;
    padding-bottom: 12px;
    margin-bottom: 14px;
  }
  .cv-name {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 26pt;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.1;
    margin: 0 0 3px 0;
    color: #0f172a;
  }
  .cv-title {
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1e40af;
    margin: 0 0 8px 0;
  }
  .cv-contact-row {
    font-size: 9.5pt;
    color: #334155;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    line-height: 1.35;
    margin-bottom: 3px;
  }
  .cv-contact-row.cv-links a {
    color: #1e40af !important;
    text-decoration: none !important;
    font-weight: 500;
  }
  .cv-sep {
    color: #94a3b8;
    font-size: 8.5pt;
  }

  .cv-section {
    margin-bottom: 5px;
    break-inside: auto;
    page-break-inside: auto;
  }
  .cv-section:last-child {
    margin-bottom: 0;
  }
  .cv-section-title {
    font-size: 10.5pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #0f172a;
    border-bottom: 1.5px solid #cbd5e1;
    padding-bottom: 3px;
    margin: 0 0 4px 0;
    break-after: avoid;
    page-break-after: avoid;
  }

  .cv-summary {
    font-size: 10pt;
    line-height: 1.5;
    color: #1e293b;
    margin: 0;
    text-align: justify;
  }
  .cv-summary strong {
    color: #0f172a;
    font-weight: 600;
  }

  .cv-skills-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .cv-skill-row {
    font-size: 9.5pt;
    line-height: 1.45;
    display: flex;
    gap: 8px;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cv-skill-label {
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    min-width: 150px;
  }
  .cv-skill-text {
    color: #334155;
  }

  .cv-entry {
    margin-bottom: 8px;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cv-entry:last-child {
    margin-bottom: 0;
  }
  .cv-entry-head {
    margin-bottom: 4px;
  }
  .cv-head-primary {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1px;
  }
  .cv-role {
    font-size: 10.5pt;
    font-weight: 700;
    color: #0f172a;
  }
  .cv-dates {
    font-size: 9.5pt;
    font-weight: 600;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
  }
  .cv-head-secondary {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }
  .cv-company {
    font-size: 9.5pt;
    font-weight: 600;
    color: #1e40af;
  }
  .cv-location {
    font-size: 9pt;
    color: #64748b;
  }
  .cv-bullets {
    margin: 3px 0 0 0;
    padding-left: 17px;
    list-style-type: disc;
  }
  .cv-bullets li {
    font-size: 9.5pt;
    line-height: 1.4;
    color: #1e293b;
    margin-bottom: 3px;
  }
  .cv-bullets li:last-child {
    margin-bottom: 0;
  }
  .cv-bullets li strong {
    color: #0f172a;
    font-weight: 600;
  }

  .cv-earlier-roles {
    margin-top: 7px;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cv-subheading {
    font-size: 10pt;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
  }
  .cv-compact-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px 16px;
  }
  .cv-compact-item {
    font-size: 9pt;
    line-height: 1.32;
    border-left: 2px solid #cbd5e1;
    padding-left: 8px;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cv-compact-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }
  .cv-compact-title {
    font-weight: 600;
    color: #0f172a;
  }
  .cv-compact-sub {
    color: #1e40af;
    font-weight: 500;
    font-size: 8.6pt;
    margin-bottom: 1px;
  }
  .cv-compact-period {
    color: #64748b;
    font-size: 8.4pt;
  }
  .cv-compact-desc {
    margin: 0;
    color: #334155;
    font-size: 8.6pt;
  }

  /* Natural pagination — entries/sections carry break-inside: avoid, so the
     browser fills each page fully instead of leaving a forced blank band. */
  .cv-page-divider {
    display: none;
  }
  /* Only meaningful when the split was hard-coded; with natural flow the
     experience section simply continues without a "(Continued)" label. */
  #cv-page-2 > .cv-section:first-child > .cv-section-title {
    display: none;
  }

  .cv-projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3px 8px;
  }
  .cv-project-card {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 7px;
    break-inside: avoid;
    page-break-inside: avoid;
    background: #fafafa;
  }
  .cv-project-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3px;
  }
  .cv-project-name {
    font-size: 9.5pt;
    font-weight: 700;
    color: #0f172a;
  }
  .cv-project-tag {
    font-size: 8pt;
    font-weight: 600;
    text-transform: uppercase;
    color: #1e40af;
  }
  .cv-project-desc {
    font-size: 9pt;
    line-height: 1.28;
    color: #334155;
    margin: 0;
  }
  .cv-project-url {
    font-style: normal;
    color: #1e40af;
    font-size: 8pt;
    display: block;
    margin-top: 1px;
    font-weight: 500;
  }
  .cv-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.4pt;
    background: #e2e8f0;
    padding: 1px 3px;
    border-radius: 2px;
    color: #0f172a;
  }

  .cv-edu-cert-split {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 18px;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cv-edu-item {
    margin-bottom: 4px;
  }
  .cv-edu-item:last-child {
    margin-bottom: 0;
  }
  .cv-edu-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }
  .cv-edu-degree {
    font-size: 9.5pt;
    font-weight: 700;
    color: #0f172a;
  }
  .cv-edu-year {
    font-size: 9pt;
    color: #475569;
    font-weight: 500;
  }
  .cv-edu-sub {
    font-size: 9pt;
    color: #1e40af;
    font-weight: 500;
    margin-top: 1px;
  }
  .cv-edu-desc {
    font-size: 8.6pt;
    color: #475569;
    margin: 1px 0 0 0;
    line-height: 1.32;
  }
  .cv-cert-item {
    margin-bottom: 5px;
  }
  .cv-cert-item:last-child {
    margin-bottom: 0;
  }
  .cv-cert-title {
    font-size: 9.5pt;
    font-weight: 700;
    color: #0f172a;
  }
  .cv-cert-issuer {
    font-size: 9pt;
    color: #1e40af;
    font-weight: 500;
    margin-top: 1px;
  }
  .cv-cert-desc {
    font-size: 8.6pt;
    color: #475569;
    margin: 1px 0 0 0;
    line-height: 1.32;
  }
}
