/* ==========================================================================
   Mayank Kumar — résumé site
   Palette: deep navy + AWS amber + cyan accent
   ========================================================================== */

:root {
  --amber: #ff9d2e;
  --amber-soft: #ffc477;
  --cyan: #4fd1c5;
  --violet: #8b8cf0;

  --bg: #080d18;
  --bg-2: #0c1322;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);

  --text: #e8edf7;
  --text-2: #a9b6cc;
  --text-3: #74839c;

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --shadow: 0 18px 44px -22px rgba(0, 0, 0, .8);

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

[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-2: #eef1f7;
  --surface: rgba(14, 22, 40, .028);
  --surface-2: rgba(14, 22, 40, .05);
  --line: rgba(14, 22, 40, .1);
  --line-strong: rgba(14, 22, 40, .2);

  --text: #101828;
  --text-2: #47546b;
  --text-3: #6b7893;

  --amber: #c9700a;
  --amber-soft: #a85f08;
  --cyan: #0d8f84;
  --violet: #5658c8;

  --shadow: 0 16px 36px -24px rgba(16, 24, 40, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--amber); color: #10131c; padding: .6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

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

/* ───────────────────────── background decoration ───────────────────────── */

.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.backdrop .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  opacity: .55;
}

.orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px);
  opacity: .34;
  animation: drift 22s var(--ease) infinite alternate;
}
.orb-1 { width: 46vw; height: 46vw; top: -14vw; left: -8vw;  background: var(--amber); }
.orb-2 { width: 38vw; height: 38vw; top: 6vw;  right: -10vw; background: var(--cyan);  animation-delay: -7s; }
.orb-3 { width: 34vw; height: 34vw; top: 60vh; left: 34vw;   background: var(--violet); animation-delay: -13s; opacity: .2; }

[data-theme="light"] .orb { opacity: .17; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(3vw, 4vh, 0) scale(1.12); }
}

/* ───────────────────────── scroll progress ───────────────────────── */

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120;
  background: transparent;
}
.scroll-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--amber), var(--cyan));
}

/* ───────────────────────── top bar ───────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 110;
  display: flex; align-items: center; gap: 1.25rem;
  padding: .7rem clamp(1rem, 4vw, 2.25rem);
  backdrop-filter: blur(14px);
  background: var(--bg); /* fallback where color-mix() is unsupported */
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--amber), #ff6a3d);
  color: #14161f; font-size: .78rem; font-weight: 800; letter-spacing: .02em;
}
.brand-text { font-size: .95rem; letter-spacing: -.01em; }

.nav { display: flex; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--text-2);
  font-size: .86rem; font-weight: 500;
  padding: .4rem .7rem; border-radius: 999px;
  transition: color .18s, background .18s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }

.topbar-actions { display: flex; align-items: center; gap: .5rem; }

.icon-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: color .18s, border-color .18s, background .18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .i-sun { display: none; }
[data-theme="dark"] .icon-btn .i-sun { display: block; }
[data-theme="dark"] .icon-btn .i-moon { display: none; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-size: .875rem; font-weight: 600;
  padding: .55rem .95rem; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .18s, background .18s, border-color .18s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--amber), #ff7a45);
  color: #14161f;
  box-shadow: 0 8px 22px -12px color-mix(in srgb, var(--amber) 80%, transparent);
}
[data-theme="light"] .btn-primary { color: #fff; }
.btn-primary:hover { box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--amber) 85%, transparent); }

.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }

/* ───────────────────────── layout ───────────────────────── */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) 4rem;
}

.section { padding-top: clamp(3rem, 7vw, 5.5rem); scroll-margin-top: 5rem; }

.sec-head { display: flex; align-items: baseline; gap: .8rem; margin-bottom: 1.6rem; }
.sec-num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .8rem; color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  border-radius: 6px; padding: .1rem .4rem;
}
.sec-head h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); font-weight: 700; }
.sec-head::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ───────────────────────── hero ───────────────────────── */

.hero { padding: clamp(3.5rem, 9vw, 6.5rem) 0 0; }

.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--cyan); margin: 0 0 1rem;
}

.hero-name {
  font-size: clamp(2.6rem, 8.5vw, 4.9rem);
  font-weight: 800; letter-spacing: -.045em;
  background: linear-gradient(120deg, var(--text) 22%, var(--amber) 62%, var(--cyan) 96%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: .5rem;
}

.hero-role {
  font-size: clamp(1.02rem, 2.4vw, 1.32rem);
  font-weight: 600; color: var(--text-2);
  margin: 0 0 1.2rem; max-width: 46ch;
}
.hero-role .hl { color: var(--text); }

.hero-blurb {
  max-width: 62ch; color: var(--text-2);
  font-size: 1.02rem; margin: 0 0 1.7rem;
}

.contact { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 2rem; }
.contact a {
  display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none; font-size: .85rem; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .38rem .8rem .38rem .55rem;
  background: var(--surface);
  transition: color .18s, border-color .18s, transform .16s var(--ease);
}
.contact a:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.ci {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: color-mix(in srgb, var(--amber) 18%, transparent);
  color: var(--amber); font-size: .62rem; font-weight: 700;
}

.stats {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stats li {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: .95rem 1.05rem;
  position: relative; overflow: hidden;
}
.stats li::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 2px;
  background: linear-gradient(180deg, var(--amber), transparent);
}
.stats b {
  display: block; font-size: 1.75rem; font-weight: 800;
  letter-spacing: -.03em; line-height: 1.1;
}
.stats b span { font-size: .82rem; font-weight: 600; color: var(--amber); margin-left: .15rem; }
.sl { font-size: .78rem; color: var(--text-3); }

/* ───────────────────────── prose ───────────────────────── */

.prose p { color: var(--text-2); max-width: 78ch; margin: 0 0 1rem; }
.prose b, .tl-body b, .card b { color: var(--text); font-weight: 600; }

/* ───────────────────────── focus cards ───────────────────────── */

.cards {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
@media (min-width: 880px) { .cards { grid-template-columns: repeat(2, 1fr); } }

.card {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 1.35rem 1.35rem 1.1rem;
  transition: transform .22s var(--ease), border-color .22s, background .22s;
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--amber), var(--cyan));
  opacity: 0; transition: opacity .22s;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); background: var(--surface-2); }
.card:hover::after { opacity: 1; }

.card-tag {
  display: inline-block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: .55rem;
}
.card h3 { font-size: 1.06rem; margin-bottom: .65rem; }
.card ul { margin: 0; padding-left: 1.1rem; }
.card li { color: var(--text-2); font-size: .9rem; margin-bottom: .4rem; }
.card li::marker { color: var(--amber); }

/* ───────────────────────── timeline ───────────────────────── */

.tl { position: relative; padding-left: 1.9rem; }
.tl::before {
  content: ""; position: absolute; left: 6px; top: .5rem; bottom: 1rem; width: 1px;
  background: linear-gradient(180deg, var(--amber), var(--cyan) 45%, transparent);
  opacity: .5;
}

.tl-item { position: relative; margin-bottom: 1rem; }
.tl-dot {
  position: absolute; left: -1.9rem; top: 1.45rem;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-strong);
}
.tl-item.feature .tl-dot {
  border-color: var(--amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 16%, transparent);
}

.tl-body {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 1.25rem 1.35rem;
  transition: border-color .22s, background .22s;
}
.tl-item:hover .tl-body { border-color: var(--line-strong); background: var(--surface-2); }
.tl-item.feature .tl-body {
  border-color: color-mix(in srgb, var(--amber) 28%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--amber) 6%, transparent), transparent 55%), var(--surface);
}

.tl-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; }
.tl-top h3 { font-size: 1.08rem; }
.when {
  margin-left: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .76rem; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 999px; padding: .12rem .6rem;
  white-space: nowrap;
}
.tl-item.feature .when { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 32%, transparent); }

.tl-sub { color: var(--text-3); font-size: .85rem; margin: .3rem 0 .8rem; }

.tl-body ul { margin: 0; padding-left: 1.15rem; }
.tl-body li { color: var(--text-2); font-size: .93rem; margin-bottom: .5rem; }
.tl-body li::marker { color: var(--cyan); }
.tl-item.feature .tl-body li::marker { color: var(--amber); }

.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0 0; align-items: center; }
.chips > span:first-child {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3); margin-right: .2rem;
}
.chip {
  font-size: .74rem; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 6px; padding: .16rem .5rem;
}
.chips.muted .chip { color: var(--text-3); }
.chip.dim, .dim { opacity: .68; }

.tl-item.compact .tl-body { padding: 1.05rem 1.2rem; }

/* ───────────────────────── skills ───────────────────────── */

.skill-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.skill-block {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 1.2rem 1.3rem;
}
.skill-block h3 {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-3); margin-bottom: .85rem;
}
.skill-block.primary h3 { color: var(--amber); }
.skill-block.primary {
  border-color: color-mix(in srgb, var(--amber) 22%, var(--line));
}
.skill-block.secondary { opacity: .82; }

.pills { list-style: none; display: flex; flex-wrap: wrap; gap: .38rem; padding: 0; margin: 0; }
.pills li {
  font-size: .82rem; color: var(--text-2);
  border: 1px solid var(--line); border-radius: 8px;
  padding: .26rem .6rem; background: var(--surface-2);
  transition: color .18s, border-color .18s;
}
.skill-block.primary .pills li { color: var(--text); }
.pills li:hover { color: var(--text); border-color: var(--line-strong); }

@media (min-width: 880px) { .skill-grid { grid-template-columns: repeat(2, 1fr); } }

/* ───────────────────────── publications ───────────────────────── */

.pub-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
@media (min-width: 880px) {
  .pub-grid { grid-template-columns: repeat(2, 1fr); }
  /* An odd number of cards would leave a half-width orphan on the last row. */
  .pub-grid .pub:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.pub {
  display: flex; flex-direction: column; gap: .45rem;
  text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 1.2rem 1.3rem;
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.pub:hover { transform: translateY(-3px); border-color: var(--line-strong); background: var(--surface-2); }
.pub-src {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan);
}
.pub h3 { font-size: 1rem; }
.pub p { color: var(--text-2); font-size: .88rem; margin: 0; }
.pub-go { margin-top: auto; padding-top: .5rem; color: var(--amber); font-size: .84rem; font-weight: 600; }

.talks { margin: 1.4rem 0 0; padding-left: 1.15rem; }
.talks li { color: var(--text-2); font-size: .93rem; margin-bottom: .4rem; }
.talks li::marker { color: var(--amber); }

/* ───────────────────────── credentials ───────────────────────── */

.cred-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cred-col {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 1.2rem 1.3rem;
}
.cred-col h3 {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-3); margin-bottom: .8rem;
}
.plain { list-style: none; padding: 0; margin: 0; }
.plain li {
  color: var(--text-2); font-size: .9rem;
  padding: .35rem 0 .35rem 1.1rem; position: relative;
}
.plain li::before {
  content: ""; position: absolute; left: 0; top: .95em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--cyan);
}
.badges li::before { background: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 18%, transparent); }

.more {
  margin-top: 1rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); padding: .85rem 1.2rem;
}
.more summary {
  cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--text-2);
  list-style: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: "＋ "; color: var(--amber); }
.more[open] summary::before { content: "－ "; }
.more[open] summary { margin-bottom: .6rem; }
.two-col { columns: 2; column-gap: 2rem; }
@media (max-width: 640px) { .two-col { columns: 1; } }

/* ───────────────────────── CTA + footer ───────────────────────── */

.cta {
  margin-top: clamp(3rem, 7vw, 5rem);
  display: flex; flex-wrap: wrap; gap: 1.25rem;
  align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 20px;
  padding: 1.75rem;
  background:
    radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--amber) 12%, transparent), transparent 60%),
    radial-gradient(120% 160% at 100% 100%, color-mix(in srgb, var(--cyan) 12%, transparent), transparent 60%),
    var(--surface);
}
.cta h2 { font-size: 1.3rem; margin-bottom: .3rem; }
.cta p { color: var(--text-2); font-size: .92rem; margin: 0; }
.cta-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.foot {
  border-top: 1px solid var(--line);
  padding: 1.6rem clamp(1rem, 4vw, 2rem);
  text-align: center; color: var(--text-3); font-size: .82rem;
}
.foot p { margin: .2rem 0; }
.foot-links { display: flex; gap: 1rem; justify-content: center; }
.foot-links a { color: var(--text-2); text-decoration: none; }
.foot-links a:hover { color: var(--amber); }

/* ───────────────────────── toast ───────────────────────── */

.toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translate(-50%, 140%);
  background: var(--text); color: var(--bg);
  font-size: .86rem; font-weight: 600;
  padding: .65rem 1.1rem; border-radius: 999px;
  box-shadow: var(--shadow); z-index: 150;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .3s var(--ease), opacity .2s, visibility .2s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ───────────────────────── reveal animation ───────────────────────── */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb { animation: none; }
  .reveal, .card, .pub, .tl-body, .btn { transition: none; }
  .reveal { opacity: 1; transform: none; }
}

/* ───────────────────────── responsive ───────────────────────── */

@media (max-width: 860px) {
  .nav { display: none; }
  .brand-text { display: none; }
}
@media (max-width: 520px) {
  .when { margin-left: 0; }
  .topbar { gap: .6rem; }
  .btn { padding: .5rem .75rem; }
}

/* ───────────────────────── print ───────────────────────── */

@media print {
  :root {
    --bg: #fff; --bg-2: #fff;
    --surface: #fff; --surface-2: #fff;
    --line: #d7dce5; --line-strong: #c2c9d6;
    --text: #111; --text-2: #333; --text-3: #666;
    --amber: #b26a08; --cyan: #0b6f66;
  }
  body { background: #fff; font-size: 10.5pt; }
  .backdrop, .topbar, .scroll-progress, .cta, .toast, .foot-links { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .section { padding-top: 1.1rem; }
  .hero { padding-top: 0; }
  .hero-name { -webkit-text-fill-color: #111; color: #111; font-size: 26pt; }
  .card, .tl-body, .skill-block, .cred-col, .pub, .stats li { box-shadow: none; break-inside: avoid; }
  .tl-item, .card, .skill-block, .cred-col { break-inside: avoid; }
  .more[open] summary { display: none; }
  .more { border: none; padding: 0; }
  a { text-decoration: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
