/* ==========================================================
   Vikram portfolio
   Palette is taken from Indian election ink: deep violet on
   cool paper. One accent, used with restraint.
   ========================================================== */

:root {
  --paper: #f6f6fb;
  --paper-alt: #ecebf5;
  --surface: #ffffff;
  --text: #1c1a30;
  --muted: #5f5b7a;
  --line: #d8d6e8;
  --ink: #4a2c9a;
  --ink-strong: #3a2179;
  --ink-soft: #e6e0f7;
  --on-ink: #ffffff;
  --ok: #1d7a4d;
  --err: #b3261e;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 1120px;
  --header-h: 68px;
}

:root[data-theme="dark"] {
  --paper: #14122a;
  --paper-alt: #1b1838;
  --surface: #211e42;
  --text: #ecebf8;
  --muted: #a8a4c6;
  --line: #34305a;
  --ink: #a58bf0;
  --ink-strong: #c0adf7;
  --ink-soft: #2e2762;
  --on-ink: #14122a;
  --ok: #5fd39a;
  --err: #ff8f87;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14122a;
    --paper-alt: #1b1838;
    --surface: #211e42;
    --text: #ecebf8;
    --muted: #a8a4c6;
    --line: #34305a;
    --ink: #a58bf0;
    --ink-strong: #c0adf7;
    --ink-soft: #2e2762;
    --on-ink: #14122a;
    --ok: #5fd39a;
    --err: #ff8f87;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }
ul, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--ink-strong); }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--on-ink);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 0.2s;
}
.skip:focus { top: 1rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.bar {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 1.05rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.97rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--text); background: var(--paper-alt); }
.nav a.active { color: var(--ink-strong); background: var(--ink-soft); }
.nav .nav-cta { color: var(--ink); border: 1px solid var(--ink); margin-left: 0.4rem; }
.nav .nav-cta.active, .nav .nav-cta:hover { background: var(--ink); color: var(--on-ink); }

.bar-tools { display: flex; align-items: center; gap: 0.35rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}
.icon-btn:hover { border-color: var(--ink); }
.menu-btn { display: none; }

.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-strong); color: var(--on-ink); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink-strong); }

.link-btn {
  font: inherit;
  font-size: 0.92rem;
  background: none;
  border: 0;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
}

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(3.5rem, 8vw, 6rem); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.35rem 0.9rem 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  margin-bottom: 1.5rem;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }

.hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 4.1rem);
  font-weight: 800;
  max-width: 17ch;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 54ch;
  margin-top: 1.4rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

.quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin-top: 2rem;
  font-size: 0.96rem;
  color: var(--muted);
}
.quick a { color: var(--muted); }
.quick a:hover { color: var(--ink-strong); }

/* ---------- ballot ---------- */
.ballot {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--text);
  border-radius: 6px;
  padding: 1.5rem 1.5rem 1.2rem;
  box-shadow: 8px 8px 0 var(--ink-soft);
  overflow: hidden;
}

.ballot-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.1rem;
  border-bottom: 2px dashed var(--line);
}
.ballot-head h2 { font-size: 1.25rem; }
.ballot-head p { font-size: 0.9rem; color: var(--muted); }

.ballot fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ballot legend {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  padding: 0;
  margin-bottom: 1.1rem;
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.choice + .choice { margin-top: 0.7rem; }
.choice:hover { border-color: var(--ink); background: var(--paper); }

.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.box {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--text);
  border-radius: 4px;
  background: var(--surface);
}
.box svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
}

.choice input:checked ~ .box { border-color: var(--ink); }
.choice input:checked ~ .box svg {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.35s ease-out;
}
.choice input:focus-visible ~ .box { outline: 3px solid var(--ink); outline-offset: 3px; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--ink-soft); }

.choice-text { display: flex; flex-direction: column; line-height: 1.3; }
.choice-text strong { font-weight: 600; }
.choice-text small { color: var(--muted); font-size: 0.88rem; margin-top: 0.15rem; }

.ballot-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.1rem;
  min-height: 1.7rem;
}
.ballot-msg { font-size: 0.93rem; color: var(--muted); }
.ballot.voted .ballot-msg { color: var(--ok); font-weight: 600; }

/* the ink stamp that lands after voting */
.ink {
  position: absolute;
  right: 1.1rem;
  top: 0.9rem;
  width: 64px;
  height: 64px;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.8) rotate(-14deg);
}
.ink span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 35%, transparent 0 9px, color-mix(in srgb, var(--ink) 55%, transparent) 10px 11px, transparent 12px 17px, color-mix(in srgb, var(--ink) 45%, transparent) 18px 19px, transparent 20px 25px, color-mix(in srgb, var(--ink) 35%, transparent) 26px 27px, transparent 28px),
    color-mix(in srgb, var(--ink) 16%, transparent);
  border: 2px solid var(--ink);
}
.ballot.voted .ink {
  opacity: 0.9;
  transform: scale(1) rotate(-14deg);
  transition: transform 0.28s cubic-bezier(0.3, 1.5, 0.5, 1), opacity 0.12s;
}

/* ---------- sections ---------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section.alt { background: var(--paper-alt); }

.section-head { margin-bottom: clamp(2rem, 5vw, 3.2rem); max-width: 60ch; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; }
.section-head p { color: var(--muted); margin-top: 0.8rem; font-size: 1.1rem; }

/* ---------- project ---------- */
.project {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.points { display: grid; gap: 0; }
.points li { padding: 1.15rem 0; border-top: 1px solid var(--line); }
.points li:last-child { border-bottom: 1px solid var(--line); }
.points h3 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.points p { color: var(--muted); max-width: 62ch; }

.stack { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.6rem 0 1.8rem; }
.stack span {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--ink-soft);
  color: var(--ink-strong);
}

.tally {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.tally figcaption { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin-bottom: 1.2rem; }

.tally-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name num" "bar bar";
  gap: 0.35rem 1rem;
  margin-bottom: 1.1rem;
  font-size: 0.97rem;
}
.tally-name { grid-area: name; font-weight: 500; }
.tally-num { grid-area: num; color: var(--muted); font-variant-numeric: tabular-nums; }
.tally-bar { grid-area: bar; height: 12px; background: var(--paper-alt); border-radius: 999px; overflow: hidden; }
.tally-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tally-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }

/* ---------- skills ---------- */
.skills > div {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem 2rem;
  padding: 1.2rem 0;
  border-top: 1px solid var(--line);
}
.skills > div:last-child { border-bottom: 1px solid var(--line); }
.skills dt { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.skills dd { color: var(--muted); max-width: 64ch; }

/* ---------- experience ---------- */
.job {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1rem 3rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
}
.job-date { font-weight: 600; }
.job-where { color: var(--muted); font-size: 0.95rem; margin-top: 0.2rem; }
.job-body h3 { font-size: 1.4rem; margin-bottom: 1rem; }
.job-body ul { display: grid; gap: 0.8rem; max-width: 66ch; }
.job-body li { position: relative; padding-left: 1.4rem; color: var(--muted); }
.job-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

/* ---------- education ---------- */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3rem); }
.col h3 { font-size: 1.15rem; margin-bottom: 0.9rem; padding-bottom: 0.7rem; border-bottom: 2px solid var(--ink); }
.col > p { color: var(--muted); }
.col > p.strong { color: var(--text); }
.strong { font-weight: 600; color: var(--text); }
.muted { color: var(--muted); }
.plain { display: grid; gap: 0.9rem; }
.plain li { display: flex; flex-direction: column; }
.plain .muted { font-size: 0.93rem; }

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.contact h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; max-width: 14ch; }
.contact-list { margin-top: 2rem; }
.contact-list li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
}
.contact-list li:last-child { border-bottom: 1px solid var(--line); }
.contact-list span { color: var(--muted); }
.contact-list b { font-weight: 500; }
.contact-list a { overflow-wrap: anywhere; }

.form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.4rem; }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  transition: border-color 0.15s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:hover, .field textarea:hover { border-color: var(--muted); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--ink-soft); }
.field.invalid input, .field.invalid textarea { border-color: var(--err); }
.err { color: var(--err); font-size: 0.88rem; min-height: 0; margin-top: 0.3rem; }
.form-note { font-size: 0.9rem; color: var(--muted); margin-top: 1rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 1.6rem 0; font-size: 0.93rem; color: var(--muted); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1.5rem; }

/* ---------- page-load entrance (hero only) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero-copy > :nth-child(2) { animation-delay: 0.08s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.16s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.24s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.32s; }
  .ballot { animation: rise 0.8s 0.25s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .hero-grid, .project, .contact-grid { grid-template-columns: 1fr; }
  .tally { position: static; }
  .cols { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: 0.6rem; }
  .skills > div { grid-template-columns: 1fr; gap: 0.3rem; }
  .hero h1 { max-width: 20ch; }
}

@media (max-width: 760px) {
  .menu-btn { display: grid; }
  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.6rem 1.25rem 1rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.85rem 0.5rem; border-radius: var(--radius-sm); }
  .nav .nav-cta { margin: 0.5rem 0 0; text-align: center; }
  .nav { margin-left: 0; }
  .bar-tools { margin-left: auto; }
  .bar { position: relative; }
}

@media (max-width: 420px) {
  body { font-size: 1rem; }
  .ballot { padding: 1.2rem 1rem 1rem; box-shadow: 5px 5px 0 var(--ink-soft); }
  .ink { width: 52px; height: 52px; }
  .contact-list li { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-text { display: grid; gap: 1.1rem; max-width: 60ch; font-size: 1.12rem; }
.about-text p:first-child { font-size: 1.3rem; line-height: 1.5; color: var(--text); font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.about-text p:not(:first-child) { color: var(--muted); }

.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.4rem 1.4rem; }
.facts > div { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; }
.facts dt { color: var(--muted); font-size: 0.95rem; }
.facts dd { font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 3vw, 2rem); margin: clamp(2.5rem, 6vw, 4rem) 0; padding: 1.8rem 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.stats li { display: flex; flex-direction: column; gap: 0.3rem; }
.stats b { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.stats span { color: var(--muted); font-size: 0.95rem; max-width: 22ch; }

.how h3 { font-size: 1.4rem; margin-bottom: 1.2rem; }
.how > ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 3vw, 2rem); }
.how li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; }
.how h4 { font-family: var(--font-display); font-size: 1.1rem; margin: 0 0 0.45rem; letter-spacing: -0.01em; }
.how li p { color: var(--muted); font-size: 0.98rem; }

@media (max-width: 920px) {
  .about-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .how > ul { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .facts > div { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.about-text { display: grid; gap: 1.1rem; max-width: 60ch; font-size: 1.12rem; }
.about-text p:first-child { font-size: 1.3rem; line-height: 1.5; color: var(--text); font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
.about-text p:not(:first-child) { color: var(--muted); }

.facts { background: var(--surface); border: