/* =====================================================================
   Praveen Voonna — Portfolio
   Tokens · Reset · Background · Nav · Hero
   ===================================================================== */

:root {
  /* Dark (default) */
  --bg:          #0a0f1c;
  --bg-2:        #0e1424;
  --surface:     #131a2b;
  --surface-2:   #1a2238;
  --border:      #1f2a44;
  --border-2:    #2a3656;
  --fg:          #e6edf6;
  --fg-2:        #b6c0d4;
  --fg-muted:    #6b7896;
  --accent:      #5eead4;        /* mint */
  --accent-2:    #2dd4bf;
  --accent-fg:   #042320;
  --accent-glow: rgba(94, 234, 212, 0.18);
  --link:        #7dd3fc;
  --warn:        #fbbf24;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --max:        1100px;
  --max-text:   780px;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow-1:   0 1px 0 0 rgba(255,255,255,0.04) inset, 0 8px 24px -12px rgba(0,0,0,0.5);
  --shadow-2:   0 1px 0 0 rgba(255,255,255,0.06) inset, 0 16px 40px -20px rgba(0,0,0,0.6);
  --ease:       cubic-bezier(0.2, 0.7, 0.2, 1);
}

html[data-theme="light"] {
  --bg:          #fbfaf6;
  --bg-2:        #f4f1ea;
  --surface:     #ffffff;
  --surface-2:   #f8f5ef;
  --border:      #e6e1d6;
  --border-2:    #d4cfc1;
  --fg:          #1a1f2e;
  --fg-2:        #3d4458;
  --fg-muted:    #6b7280;
  --accent:      #0d9488;
  --accent-2:    #0f766e;
  --accent-fg:   #ecfdf5;
  --accent-glow: rgba(13, 148, 136, 0.12);
  --link:        #0a4ea1;
  --warn:        #b45309;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  overflow-x: hidden;
}
::selection { background: var(--accent); color: var(--accent-fg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
a { color: var(--link); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
strong { color: var(--fg); font-weight: 600; }

/* ---------- Backgrounds ---------- */
.bg-grid, .bg-glow { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.bg-grid {
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.25;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 30%, #000 30%, transparent 75%);
}
.bg-glow {
  background:
    radial-gradient(60% 50% at 75% 0%, var(--accent-glow), transparent 60%),
    radial-gradient(50% 50% at 10% 30%, var(--accent-glow), transparent 60%);
  opacity: 0.7;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in oklab, var(--bg) 75%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid color-mix(in oklab, var(--border) 70%, transparent);
}
.brand {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem;
  color: var(--accent); padding: 6px 10px;
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease);
}
.brand:hover {
  background: var(--accent-glow); color: var(--accent);
  transform: translateY(-1px); box-shadow: 0 4px 12px -4px var(--accent-glow);
}
.nav nav { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-left: auto; }
.nav nav a { color: var(--fg-2); font-size: 0.92rem; font-weight: 500; }
.nav nav a:hover { color: var(--accent); }
.nav nav a .num {
  font-family: var(--font-mono); color: var(--accent); font-size: 0.78rem; margin-right: 4px;
}
.nav-actions { display: flex; align-items: center; gap: 0.6rem; }
.btn-sm {
  font-family: var(--font-mono); font-size: 0.82rem; padding: 7px 14px;
  border: 1px solid var(--accent); color: var(--accent); border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease);
}
.btn-sm:hover {
  background: var(--accent-glow); color: var(--accent);
  transform: translateY(-1px); box-shadow: 0 4px 12px -4px var(--accent-glow);
}
.theme-btn {
  background: transparent; color: var(--fg-2); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); padding: 5px 10px; cursor: pointer; font-size: 0.95rem;
  transition: all 0.2s var(--ease); line-height: 1;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); transform: rotate(180deg); }


/* =====================================================================
   Layout · Sections · Hero
   ===================================================================== */

main { max-width: var(--max); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.section { padding: clamp(64px, 10vw, 120px) 0 32px 0; }

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5rem 0; letter-spacing: -0.01em; color: var(--fg); }

.display {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  font-weight: 800; letter-spacing: -0.035em; line-height: 1.05;
  margin: 0;
}
.display-muted { color: var(--fg-2); font-weight: 700; margin-top: 0.2rem; }
.display-sm { font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 800; letter-spacing: -0.025em; }

.section-h {
  display: flex; align-items: center; gap: 0.8rem;
  font-size: clamp(1.4rem, 3vw, 1.7rem); font-weight: 700;
  margin: 0 0 2.4rem 0; letter-spacing: -0.01em;
}
.section-num {
  font-family: var(--font-mono); color: var(--accent);
  font-size: 0.95rem; font-weight: 500;
}
.section-rule {
  flex: 1; height: 1px; background: var(--border-2); margin-left: 0.6rem;
  max-width: 320px;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(80px, 14vw, 140px);
  padding-bottom: clamp(48px, 8vw, 80px);
  max-width: 920px;
}
.kicker {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.92rem; font-weight: 500;
  margin: 0 0 1.2rem 0;
}
.lede {
  font-size: clamp(1.05rem, 2vw, 1.18rem);
  color: var(--fg-2);
  max-width: 660px; margin: 1.6rem 0 1rem 0; line-height: 1.65;
}
.lede strong { color: var(--fg); }
.lede a { color: var(--accent); border-bottom: 1px dashed color-mix(in oklab, var(--accent) 50%, transparent); }
.lede a:hover { border-bottom-color: var(--accent); }

.availability {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; margin: 0 0 0.7rem 0;
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent);
}
.open-to {
  margin: 0 0 1.6rem 0; max-width: 62ch;
  font-size: 0.95rem; color: var(--fg-2); line-height: 1.55;
}
.open-to strong { color: var(--fg); font-weight: 600; }
.about-note {
  margin-top: 1rem; padding: 0.7rem 0.95rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in oklab, var(--accent) 6%, transparent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem; color: var(--fg-2); line-height: 1.55;
}
.about-note strong { color: var(--fg); }
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 25%, transparent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 25%, transparent); }
  50%      { box-shadow: 0 0 0 8px color-mix(in oklab, var(--accent) 0%, transparent); }
}

/* ---------- Buttons ---------- */
.cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.4rem 0; }
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 12px 22px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg); font-size: 0.95rem; font-weight: 500;
  font-family: var(--font-sans);
  transition: all 0.2s var(--ease); cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px -10px var(--accent-glow); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-fg); border-color: transparent; font-weight: 600;
}
.btn.primary:hover { color: var(--accent-fg); filter: brightness(1.08); box-shadow: 0 10px 28px -10px var(--accent-glow); }
.btn.ghost { background: transparent; }
.btn.big { padding: 16px 30px; font-size: 1.02rem; }

/* ---------- Stat strip ---------- */
.stat-strip {
  list-style: none; padding: 0; margin: 2.4rem 0 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-1);
}
.stat-strip li {
  background: var(--surface); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
  transition: background 0.2s var(--ease);
}
.stat-strip li:hover { background: var(--surface-2); }
.stat-num {
  font-family: var(--font-mono); font-size: 1.15rem; color: var(--accent);
  font-weight: 600; letter-spacing: -0.01em;
}
.stat-lbl { font-size: 0.82rem; color: var(--fg-muted); }


/* =====================================================================
   About · Experience timeline · Publications
   ===================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2.4rem;
  align-items: start;
}
.about-grid p { color: var(--fg-2); margin-bottom: 1rem; max-width: var(--max-text); }
.about-side {
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-1);
}
.about-side h4 {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.14em; margin: 0 0 0.8rem 0; font-weight: 600;
}
.bullets { list-style: none; padding: 0; margin: 0; }
.bullets li {
  position: relative; padding-left: 1.2rem; margin-bottom: 0.7rem;
  color: var(--fg-2); font-size: 0.95rem; line-height: 1.55;
}
.bullets li::before {
  content: "▹"; position: absolute; left: 0; top: 0; color: var(--accent);
  font-size: 0.95rem;
}

/* ---------- Experience timeline ---------- */
.role {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.2rem;
  padding: 2rem 0;
  border-top: 1px dashed var(--border);
  position: relative;
}
.role:first-of-type { border-top: 0; padding-top: 0; }
.role-time {
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 84px;
  align-self: start;
}
.role-time time {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent);
  font-weight: 500;
}
.role-loc { font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-muted); }
.role-body { min-width: 0; }
.role h3 {
  font-size: 1.18rem; font-weight: 700; margin: 0 0 0.4rem 0;
  letter-spacing: -0.005em;
}
.role-co { color: var(--accent); }
.role-sum { color: var(--fg-2); margin-bottom: 0.9rem; }
.role ul { list-style: none; padding: 0; margin: 0.4rem 0 1rem 0; }
.role ul li {
  position: relative; padding-left: 1.4rem; margin-bottom: 0.55rem;
  color: var(--fg-2); line-height: 1.6;
}
.role ul li::before {
  content: "▹"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-family: var(--font-mono);
}
.stack {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin: 0.6rem 0 0 0;
}
.stack span {
  font-family: var(--font-mono); font-size: 0.74rem;
  padding: 4px 10px; border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent);
}

/* ---------- Publications ---------- */
.pub-card {
  position: relative;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  transition: all 0.25s var(--ease);
  overflow: hidden;
}
.pub-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(800px 200px at 100% 0%, var(--accent-glow), transparent 60%);
  opacity: 0; transition: opacity 0.3s var(--ease); pointer-events: none;
}
.pub-card:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: var(--shadow-2); }
.pub-card:hover::before { opacity: 1; }
.pub-tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--accent); margin-bottom: 0.8rem;
  padding: 4px 10px; border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 25%, transparent);
}
.pub-card h3 { font-size: 1.25rem; margin-bottom: 0.4rem; line-height: 1.3; }
.pub-card h3 a { color: var(--fg); display: inline-flex; align-items: baseline; gap: 0.4rem; }
.pub-card h3 a:hover { color: var(--accent); }
.pub-card h3 .ext {
  font-size: 0.8em; color: var(--accent); transition: transform 0.2s var(--ease);
}
.pub-card h3 a:hover .ext { transform: translate(2px, -2px); }
.pub-meta { font-family: var(--font-mono); font-size: 0.82rem; color: var(--fg-muted); margin-bottom: 0.8rem; }
.pub-card p:not(.pub-meta):not(.stack) { color: var(--fg-2); margin-bottom: 0.8rem; }
.pub-card code {
  font-family: var(--font-mono); font-size: 0.88em;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  padding: 1px 6px; border-radius: 4px;
}


/* =====================================================================
   Skills · Contact · Footer · Reveal · Responsive
   ===================================================================== */

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.skill-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: all 0.25s var(--ease);
  overflow: hidden;
}
.skill-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transform: scaleY(0); transform-origin: top;
  transition: transform 0.3s var(--ease);
}
.skill-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-2);
  box-shadow: var(--shadow-2);
  background: var(--surface-2);
}
.skill-card:hover::before { transform: scaleY(1); }
.skill-card h4 {
  margin: 0 0 0.5rem 0; color: var(--accent);
  font-family: var(--font-mono); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600;
}
.skill-card p { margin: 0; font-size: 0.93rem; color: var(--fg-2); line-height: 1.55; }

/* ---------- Contact ---------- */
.contact-section { text-align: center; padding-bottom: 80px; }
.contact-section .kicker { display: block; }
.contact-section .display-sm { margin: 0.4rem auto 1.2rem auto; }
.contact-lede {
  max-width: 560px; margin: 0 auto 2rem auto;
  color: var(--fg-2); font-size: 1.05rem;
}
.socials {
  display: flex; gap: 2rem; justify-content: center;
  margin-top: 2.4rem;
}
.socials a {
  font-family: var(--font-mono); font-size: 0.88rem;
  color: var(--fg-2); padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: all 0.2s var(--ease);
}
.socials a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Footer ---------- */
footer {
  max-width: var(--max); margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 32px;
  color: var(--fg-muted);
  font-family: var(--font-mono); font-size: 0.78rem;
  text-align: center;
  border-top: 1px solid var(--border);
}
footer a { color: var(--fg-muted); }
footer a:hover { color: var(--accent); }

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Active nav link ---------- */
.nav nav a.active { color: var(--accent); }
.nav nav a.active .num { color: var(--accent); }

/* ---------- Responsive ---------- */
/* Mid-tier: 7 nav items + résumé/theme get tight here — drop the
   decorative section numbers and tighten spacing so the nav never wraps. */
@media (max-width: 1100px) {
  .nav nav { gap: 1.1rem; }
  .nav nav a { font-size: 0.88rem; }
  .nav nav a .num { display: none; }
}

@media (max-width: 820px) {
  .nav { padding: 12px 16px; gap: 0.6rem; }
  .nav nav { gap: 0.9rem; }
  .nav nav a { font-size: 0.85rem; }
  .nav nav a .num { display: none; }
  .nav-actions .btn-sm { display: none; }

  .about-grid { grid-template-columns: 1fr; gap: 1.6rem; }

  .role { grid-template-columns: 1fr; gap: 0.6rem; padding: 1.6rem 0; }
  .role-time { position: static; flex-direction: row; align-items: center; gap: 0.8rem; }
  .role-time time, .role-loc { font-size: 0.78rem; }

  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .skill-grid { grid-template-columns: 1fr; }

  .display-muted { font-size: clamp(1.6rem, 5vw, 2.4rem); }

  .bg-grid { background-size: 40px 40px; }
}

@media (max-width: 520px) {
  .nav nav { display: none; }
  .nav .brand { font-size: 0.85rem; padding: 5px 8px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 1rem; }
  .socials { gap: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .dot { box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 25%, transparent); }
}

/* ---------- Print (in case someone prints the page) ---------- */
@media print {
  .nav, .bg-grid, .bg-glow, footer, .cta, .theme-btn { display: none !important; }
  body { background: #fff; color: #000; }
  .display, .display-sm, h2, h3, h4 { color: #000 !important; }
  a { color: #000 !important; text-decoration: underline; }
}
