/* Shawnak Shivakumar - shawnak.ai
   Cool, professional light theme. Off-white canvas, blue action, teal-green second voice.
   Gradient and motion used sparingly. Every effect is reduced-motion safe. */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --ink: #0f172a;
  --ink-muted: #475569;
  --ink-subtle: #64748b;

  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --accent: #0f766e;
  --sky: #0ea5e9;

  --grad: linear-gradient(120deg, #4f46e5 0%, #0ea5e9 52%, #14b8a6 100%);
  --grad-90: linear-gradient(90deg, #2563eb 0%, #0ea5e9 50%, #14b8a6 100%);

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.10);
  --shadow-md: 0 2px 4px rgba(15, 23, 42, 0.05), 0 8px 18px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 4px 8px rgba(15, 23, 42, 0.05), 0 16px 32px rgba(15, 23, 42, 0.10);
  --glow-brand: 0 8px 24px rgba(37, 99, 235, 0.22);

  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-tile: 14px;

  --nav-h: 64px;
  --maxw: 1080px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);

  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #dbeafe;
  color: #1e40af;
}

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}
:focus:not(:focus-visible) {
  outline: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-decoration: none;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Gradient text (single fallback color, upgraded to clip where supported) */
.grad-text,
.section-num,
.stat-num {
  color: var(--brand);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .grad-text,
  .section-num,
  .stat-num {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* --------------------------------------------------- Scroll progress bar */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
  background: var(--grad-90);
  z-index: 1000;
  will-change: transform;
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .scroll-progress {
      transform: scaleX(0);
      animation: growProgress linear both;
      animation-timeline: scroll(root block);
    }
    @keyframes growProgress {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
  }
}

/* --------------------------------------------------- Mouse-follow glow */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(600px circle at var(--mx, -200px) var(--my, -200px), rgba(37, 99, 235, 0.07), transparent 42%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
body.has-glow::before {
  opacity: 1;
}

/* ------------------------------------------------------------------ Nav */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 250, 252, 0.82);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-nav { background: rgba(248, 250, 252, 0.97); }
}

.nav-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  min-width: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  transition: transform 0.2s var(--ease);
}
.brand:hover .brand-logo {
  transform: translateY(-1px);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(0.85rem, 2.4vw, 1.9rem);
}
.nav-links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s var(--ease);
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
}
.nav-links a.active {
  color: var(--brand);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
}
.cta:hover,
.cta:focus-visible {
  background: var(--brand-hover);
  box-shadow: var(--glow-brand);
  transform: translateY(-1px);
}
.cta-arrow {
  width: 15px;
  height: 15px;
  transition: transform 0.2s var(--ease);
}
.cta:hover .cta-arrow,
.cta:focus-visible .cta-arrow {
  transform: translateX(3px);
}

/* ----------------------------------------------------------------- Hero */

.hero {
  position: relative;
  overflow: hidden;
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem var(--pad) 5.5rem;
}
.aurora {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(76px);
  opacity: 0.62;
  mix-blend-mode: multiply;
  will-change: transform;
}
.b1 {
  width: 52vmax; height: 52vmax; top: -16vmax; left: -10vmax;
  background: radial-gradient(circle at center, #bcd4ff 0%, rgba(188, 212, 255, 0) 70%);
  animation: drift1 26s ease-in-out infinite alternate;
}
.b2 {
  width: 46vmax; height: 46vmax; top: 0; right: -12vmax;
  background: radial-gradient(circle at center, #b8ecff 0%, rgba(184, 236, 255, 0) 70%);
  animation: drift2 32s ease-in-out infinite alternate;
}
.b3 {
  width: 48vmax; height: 48vmax; bottom: -20vmax; left: 18vmax;
  background: radial-gradient(circle at center, #b8f0e0 0%, rgba(184, 240, 224, 0) 70%);
  animation: drift3 38s ease-in-out infinite alternate;
}
@keyframes drift1 { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(6vw, 4vh, 0) scale(1.12); } }
@keyframes drift2 { from { transform: translate3d(0, 0, 0) scale(1.05); } to { transform: translate3d(-5vw, 6vh, 0) scale(0.95); } }
@keyframes drift3 { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(4vw, -5vh, 0) scale(1.1); } }

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(rgba(248, 250, 252, 0.66), rgba(248, 250, 252, 0.66));
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: min(72rem, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin-bottom: 1.7rem;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(37, 99, 235, 0); }
}

.hero-name {
  font-weight: 600;
  font-size: clamp(2rem, 8vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
}

.hero-tagline {
  margin-top: 1.5rem;
  max-width: 40ch;
  font-weight: 300;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink-muted);
  text-wrap: balance;
}
.rotator {
  display: inline-block;
  min-width: 9.5ch;
  text-align: left;
  font-weight: 400;
}
.rotator__caret {
  display: inline-block;
  width: 0.09em;
  height: 1em;
  margin-left: 0.06em;
  background: var(--brand);
  vertical-align: -0.1em;
  animation: caret 1.06s steps(1, end) infinite;
}
@keyframes caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero-rule {
  margin-top: 2.2rem;
  width: 90px;
  height: 3px;
  border-radius: 2px;
  background: var(--grad-90);
}

.socials {
  margin-top: 2.4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}
.social {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-tile);
  background: var(--surface);
  color: var(--ink-subtle);
  box-shadow: var(--shadow-xs);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.social svg {
  width: 21px;
  height: 21px;
}
.social:hover,
.social:focus-visible {
  color: var(--brand);
  border-color: #93c5fd;
  background: #eff4ff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.scroll-cue {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--ink-subtle);
  display: inline-flex;
  opacity: 0.7;
  animation: bob 2s ease-in-out infinite;
}
.scroll-cue svg { width: 24px; height: 24px; }
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 6px); }
}

/* ---------------------------------------------------------------- Stats */

.stats {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3rem) var(--pad);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.stat-num {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  width: max-content;
}
.stat-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-subtle);
}

/* ------------------------------------------------------------- Sections */

.section {
  padding-block: clamp(4.5rem, 10vh, 7rem);
  border-top: 1px solid var(--border);
}
.section:first-of-type {
  border-top: none;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}
.section-num {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
}
.section-title {
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section-title::after {
  content: ".";
  color: var(--brand);
}
.title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.16s var(--ease);
}
.title-link:hover,
.title-link:focus-visible {
  color: var(--brand);
}

.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-subtle);
  margin-bottom: 0.45rem;
}

/* ---------------------------------------------------------------- About */

.about-text {
  margin-top: 2rem;
  max-width: 720px;
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--ink);
  text-wrap: pretty;
}

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.chips li {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: #334155;
  font-size: 0.85rem;
  line-height: 1.3;
  padding: 0.45rem 0.9rem;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease), transform 0.16s var(--ease);
}
.chips.focus {
  margin-top: 1.8rem;
}
.chips.focus li {
  border-radius: 999px;
}
.chips li:hover {
  color: #1e40af;
  border-color: #93c5fd;
  background: #eff4ff;
  transform: translateY(-2px);
}

/* ----------------------------------------------------------- Card base */

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(260px circle at var(--cx, -200px) var(--cy, -200px), var(--brand), transparent 65%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}
.spot:hover::before {
  opacity: 1;
}

/* ----------------------------------------------------------- Experience */

.xp {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.xp-row {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 1.6rem;
}
.xp-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-subtle);
  white-space: nowrap;
  padding-top: 0.2rem;
}
.xp-org {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.xp-role {
  margin-top: 0.15rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
}
.xp-points {
  margin-top: 0.75rem;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.xp-points li {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-muted);
}
.xp-points li::marker {
  color: var(--brand);
}

.education {
  margin-top: 1.6rem;
  padding: 1.4rem 1.6rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  font-size: 1rem;
  color: var(--ink);
}

/* --------------------------------------------------------- Publications */

.scholar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color 0.16s var(--ease);
}
.scholar-link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s var(--ease);
}
.scholar-link:hover,
.scholar-link:focus-visible {
  color: var(--brand);
}
.scholar-link:hover svg,
.scholar-link:focus-visible svg {
  transform: translate(2px, -2px);
}

.pub-list {
  list-style: none;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.pub {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 1.35rem 1.5rem;
}
.pub-num {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brand);
}
.pub-title {
  font-weight: 500;
  font-size: 1.06rem;
  line-height: 1.45;
  color: var(--ink);
}

/* ---------------------------------------------------------- Recognition */

.chips.recognition {
  margin-top: 2.2rem;
  gap: 0.7rem;
}
.chips.recognition li {
  border-radius: var(--radius);
  padding: 0.7rem 1.1rem;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
}
.chips.recognition li:hover {
  color: #1e40af;
}

/* -------------------------------------------------------------- Connect */

.connect {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.connect-line {
  margin-top: 1.6rem;
  font-size: 1.2rem;
  color: var(--ink-muted);
  font-weight: 300;
}
.email-btn {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-size: clamp(0.82rem, 2.6vw, 1.2rem);
  font-weight: 600;
  padding: 0.95rem 1.6rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
  max-width: 100%;
}
.email-btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.email-btn:hover,
.email-btn:focus-visible {
  background: var(--brand-hover);
  box-shadow: var(--glow-brand);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------- Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2.5rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-inner p {
  font-size: 0.9rem;
  color: var(--ink-subtle);
}
.footer-loc {
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* --------------------------------------------------------------- Reveal */

html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
html.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* Hero entrance, load only, motion-safe */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * {
    animation: rise 0.75s var(--ease) both;
  }
  .hero-inner > *:nth-child(1) { animation-delay: 0.05s; }
  .hero-inner > *:nth-child(2) { animation-delay: 0.13s; }
  .hero-inner > *:nth-child(3) { animation-delay: 0.21s; }
  .hero-inner > *:nth-child(4) { animation-delay: 0.29s; }
  .hero-inner > *:nth-child(5) { animation-delay: 0.37s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .blob { animation: none; }
  .rotator__caret { animation: none; opacity: 1; }
  .live-dot { animation: none; }
  .scroll-cue { animation: none; }
  html.js .reveal { opacity: 1; transform: none; }
}

/* ----------------------------------------------------------- Responsive */

@media (max-width: 820px) {
  .stats-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem 1.5rem;
  }
}

@media (max-width: 720px) {
  .xp-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .xp-date {
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .nav-links {
    gap: 0.9rem;
  }
  .nav-links a {
    font-size: 0.84rem;
  }
  .cta-arrow {
    display: none;
  }
  .cta {
    padding: 0.45rem 0.9rem;
  }
  .about-text {
    font-size: 1.08rem;
  }
}

@media (max-width: 520px) {
  .nav-links {
    display: none;
  }
  .email-btn {
    padding: 0.85rem 1.15rem;
    gap: 0.5rem;
  }
  .email-btn svg {
    width: 19px;
    height: 19px;
  }
}

@media (max-width: 380px) {
  .stats-inner {
    grid-template-columns: 1fr;
  }
}
