/* ============================================================
   Sukumar Gurugubelli — Resume Overhaul
   Dark, physics-nerd, professional-clean. Self-contained.
   ============================================================ */

:root {
  --bg:        #0a0e14;   /* near-black, blue tint */
  --bg-elev:   #111722;   /* raised surfaces      */
  --bg-elev-2: #161e2b;
  --line:      #1f2937;   /* hairlines/borders    */
  --text:      #e6edf3;
  --muted:     #8b98a5;
  --muted-2:   #5b6877;
  --accent:    #4cc9f0;   /* electric cyan        */
  --accent-2:  #b388ff;   /* violet               */
  --accent-3:  #2dd4bf;   /* teal (clusters)      */
  --glow:      rgba(76, 201, 240, 0.35);
  --maxw:      1080px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-disp: 'Space Grotesk', var(--font-sans);
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* faint grid backdrop, the "graph paper" of a nerd */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent); text-decoration: none; transition: color .2s ease; }
a:hover { color: #fff; }

h1, h2, h3, h4 { font-family: var(--font-disp); font-weight: 600; line-height: 1.15; margin: 0; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ---------- Mono labels / eyebrows ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .75rem;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* ---------- Navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  backdrop-filter: blur(10px);
  background: rgba(10, 14, 20, 0);
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease;
}
.nav.scrolled {
  background: rgba(10, 14, 20, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav__brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: .85rem; color: var(--text); }
.nav__brand img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.nav__brand b { color: var(--accent); }
.nav__links { display: flex; gap: 4px; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav__links a.active { color: var(--accent); }
.nav__social a { color: var(--muted); font-size: .95rem; padding: 8px 8px; }
.nav__toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.3rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; }
#agent-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
.hero::after { /* vignette + bottom fade */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 600px at 70% 40%, transparent 0%, rgba(10,14,20,.55) 70%, var(--bg) 100%),
    linear-gradient(180deg, transparent 60%, var(--bg) 100%);
  z-index: 1; pointer-events: none;
}
.hero .container { z-index: 2; }
.hero__grid { display: grid; grid-template-columns: 1fr auto; gap: 56px; align-items: center; }
.hero__text { min-width: 0; }

/* portrait with accent ring + slow orbital ring */
.hero__portrait { position: relative; width: clamp(220px, 24vw, 320px); aspect-ratio: 1; flex-shrink: 0; justify-self: end; }
.hero__portrait img {
  position: relative; z-index: 2;
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(76, 201, 240, .55);
  box-shadow: 0 0 0 8px rgba(76,201,240,.06), 0 20px 60px rgba(0,0,0,.55), 0 0 60px rgba(76,201,240,.18);
}
.hero__portrait::after { /* soft glow halo behind */
  content: ""; position: absolute; inset: -6%; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, rgba(76,201,240,.22), transparent 68%);
  filter: blur(4px);
}
.hero__orbit { /* dashed ring orbiting the portrait */
  content: ""; position: absolute; inset: -14px; z-index: 1; border-radius: 50%;
  border: 1px dashed rgba(179,136,255,.45);
  animation: orbit 24s linear infinite;
}
.hero__orbit::before { /* a single travelling node on the orbit */
  content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2);
  transform: translateX(-50%);
}
@keyframes orbit { to { transform: rotate(360deg); } }
.hero__status {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .15em;
  color: var(--accent-3); margin-bottom: 1.4rem; display: inline-flex; align-items: center; gap: .55rem;
}
.hero__status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 10px var(--accent-3); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.ticker-badge {
  display: inline-flex; align-items: center; gap: .35rem; vertical-align: middle;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .06em; line-height: 1;
  color: var(--accent); border: 1px solid rgba(76,201,240,.35);
  border-radius: 999px; padding: .25rem .55rem; white-space: nowrap;
  transition: border-color .2s ease, background .2s ease;
}
.ticker-badge:hover { border-color: var(--accent); background: rgba(76,201,240,.08); }
.ticker-badge i { font-size: .6rem; opacity: .85; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); letter-spacing: -.02em; margin-bottom: .4rem; }
.hero h1 .accent { color: var(--accent); }
.hero__role { font-family: var(--font-mono); font-size: clamp(.9rem, 2vw, 1.15rem); color: var(--muted); margin-bottom: 1.6rem; }
.hero__role .sep { color: var(--accent-2); margin: 0 .5rem; }
.hero__lead { max-width: 620px; color: #c2ccd6; font-size: 1.05rem; margin-bottom: 2.2rem; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em;
  padding: 12px 22px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: .55rem;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
  border: 1px solid var(--line); background: transparent; color: var(--text);
}
.btn--primary { background: var(--accent); color: #06222b; border-color: var(--accent); font-weight: 600; }
.btn--primary:hover { box-shadow: 0 8px 30px var(--glow); color: #06222b; }
.btn:hover { transform: translateY(-2px); border-color: var(--accent); color: #fff; }

.hero__scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 2; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .2em;
  color: var(--muted-2); display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero__scroll span { width: 1px; height: 38px; background: linear-gradient(var(--accent), transparent); animation: scrollline 2s ease-in-out infinite; }
@keyframes scrollline { 0%{transform:scaleY(0);transform-origin:top} 50%{transform:scaleY(1);transform-origin:top} 51%{transform-origin:bottom} 100%{transform:scaleY(0);transform-origin:bottom} }

/* ---------- Stat band ---------- */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-elev); }
.stats__grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 38px 24px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat__num { font-family: var(--font-disp); font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; color: var(--text); }
.stat__num .suffix { color: var(--accent); }
.stat__label { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ---------- Section scaffolding ---------- */
.section { padding: 110px 0; position: relative; }
.section__head { margin-bottom: 56px; max-width: 720px; }
.section__head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.01em; }
.section__head p { color: var(--muted); margin: .8rem 0 0; }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px;
  background: var(--line);
}
.timeline__progress {
  content: ""; position: absolute; left: 7px; top: 6px; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--glow);
  height: 0; transition: height .1s linear;
}
.tl-item { position: relative; padding-bottom: 52px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -34px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--muted-2);
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.tl-item.in-view::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px rgba(76,201,240,.15), 0 0 16px var(--glow); }
.tl-item__date { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em; color: var(--accent); margin-bottom: 6px; }
.tl-item__role { font-size: 1.25rem; }
.tl-item__org { color: var(--muted); margin: 2px 0 4px; font-size: .95rem; }
.tl-item__org a { color: var(--text); }
.tl-item__meta { font-family: var(--font-mono); font-size: .72rem; color: var(--muted-2); }
.tl-item__body { margin-top: 14px; color: #c2ccd6; }
.tl-item__body ul { margin: 0; padding-left: 18px; }
.tl-item__body li { margin-bottom: 8px; }
.tag-badge {
  display: inline-block; font-family: var(--font-mono); font-size: .68rem;
  color: var(--accent-3); border: 1px solid rgba(45,212,191,.3);
  border-radius: 6px; padding: 2px 8px; margin-left: 8px; vertical-align: middle;
}

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--accent), var(--accent-2));
  transform: scaleY(0); transform-origin: top; transition: transform .3s ease;
}
.card:hover { transform: translateY(-4px); border-color: #2b3a4d; box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.card:hover::before { transform: scaleY(1); }
.card h4 { font-size: 1.08rem; margin-bottom: 8px; }
.card h4 a { color: inherit; }
.card h4 a:hover { color: var(--accent); }
.card .src { font-family: var(--font-mono); font-size: .74rem; color: var(--accent); margin-bottom: 10px; }
.card p { color: var(--muted); margin: 0; font-size: .92rem; }
.card .doi { font-family: var(--font-mono); font-size: .72rem; color: var(--muted-2); margin-top: 12px; word-break: break-all; }

/* ---------- Skills graph ---------- */
.skills-wrap { position: relative; }
#skill-canvas { width: 100%; height: 560px; display: block; cursor: grab; touch-action: none; }
#skill-canvas:active { cursor: grabbing; }
.skills-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }
.skills-legend span { display: inline-flex; align-items: center; gap: 7px; }
.skills-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.skills-hint { font-family: var(--font-mono); font-size: .68rem; color: var(--muted-2); margin-top: 6px; }

/* ---------- Pub / awards / generic lists ---------- */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .label { color: var(--text); }
.mini-list .when { font-family: var(--font-mono); font-size: .74rem; color: var(--accent); white-space: nowrap; }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 40px; }
.contact__item {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px;
  padding: 34px 18px; transition: transform .25s, border-color .25s, box-shadow .25s; display: block; color: var(--text);
}
.contact__item:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: 0 12px 34px var(--glow); color: var(--text); }
.contact__item i { font-size: 1.5rem; color: var(--accent); margin-bottom: 14px; }
.contact__item .k { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact__item .v { margin-top: 6px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 60px 0 36px; text-align: center; }
.footer h3 { font-size: 1.3rem; }
.footer__role { font-family: var(--font-mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 6px 0 18px; }
.footer__verse { color: var(--muted-2); font-style: italic; font-size: .92rem; line-height: 1.9; }
.footer__social { list-style: none; display: flex; gap: 14px; justify-content: center; padding: 0; margin: 22px 0 0; }
.footer__social a { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); transition: all .2s; }
.footer__social a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.footer__copy { font-family: var(--font-mono); font-size: .68rem; color: var(--muted-2); margin-top: 30px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav__links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; background: rgba(10,14,20,.96); border-bottom: 1px solid var(--line); padding: 8px; gap: 2px; }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 12px; }
  .nav__toggle { display: block; }
  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .grid--2, .grid--3, .contact__grid { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  /* iOS Safari: 100vh hides content behind the toolbar. Use svh + top-align
     so the hero grows with its content and the CTAs are never clipped. */
  .hero { min-height: 100svh; align-items: flex-start; padding: 96px 0 56px; }
  .hero__grid { grid-template-columns: 1fr; gap: 36px; text-align: center; }
  .hero__portrait { order: -1; justify-self: center; width: clamp(160px, 48vw, 230px); }
  .hero__status, .eyebrow { justify-content: center; }
  .hero__status { flex-wrap: wrap; }
  .hero__cta { justify-content: center; }
  .hero__lead { margin-left: auto; margin-right: auto; }
  #skill-canvas { height: 760px; }
}

/* print-only skills text fallback: hidden on screen */
.print-skills { display: none; }

/* ============================================================
   PRINT / PDF — clean light document, no canvas or animation.
   Recruiters hit Ctrl-P; give them ink-friendly black-on-white.
   ============================================================ */
@media print {
  :root { --text: #111; --muted: #333; --muted-2: #555; --accent: #0b5; }
  body { background: #fff !important; color: #000; font-size: 11pt; line-height: 1.45; }
  body::before { display: none !important; }                 /* grid backdrop */
  .nav, .hero__scroll, .hero__orbit, .hero__status .dot,
  #agent-canvas, #skill-canvas, .skills-legend, .skills-hint,
  .hero__cta, .footer__social { display: none !important; }

  a { color: #000 !important; text-decoration: none; }

  /* hero collapses to a compact header */
  .hero { min-height: auto !important; padding: 0 0 12pt; display: block; }
  .hero::after { display: none !important; }
  .hero__grid { grid-template-columns: 1fr auto !important; gap: 16pt; }
  .hero h1 { font-size: 24pt !important; color: #000; }
  .hero h1 .accent { color: #000; }
  .hero__role, .hero__lead { color: #222 !important; }
  .hero__lead { font-size: 10.5pt; }
  .hero__portrait { width: 120px !important; }
  .hero__portrait img { border: 1px solid #999; box-shadow: none !important; }
  .hero__portrait::after { display: none !important; }

  .stats { border-color: #ccc; background: #fff; }
  .stat { border-color: #ccc; padding: 10pt; }
  .stat__num, .stat__num .suffix { color: #000; }

  .section { padding: 14pt 0 !important; background: #fff !important; border-color: #ccc !important; }
  .section__head { margin-bottom: 12pt; }
  .eyebrow, .tl-item__date, .card .src, .mini-list .when { color: #0a6 !important; }
  .eyebrow::before { background: #0a6; }

  /* timeline: plain markers, no animated trace */
  .timeline::before { background: #ccc; }
  .timeline__progress { display: none !important; }
  .tl-item { padding-bottom: 12pt; break-inside: avoid; }
  .tl-item::before { background: #0a6 !important; border-color: #0a6 !important; box-shadow: none !important; }
  .tl-item__body, .hero__lead, .card p { color: #222 !important; }
  .tag-badge { color: #0a6; border-color: #0a6; }

  /* cards / lists flatten */
  .card { background: #fff; border: 1px solid #ccc; box-shadow: none !important; break-inside: avoid; }
  .card::before { display: none !important; }
  .contact__item { background: #fff; border: 1px solid #ccc; }
  .mini-list li { border-color: #ddd; break-inside: avoid; }

  /* reveal animations off; show everything */
  .reveal { opacity: 1 !important; transform: none !important; }

  /* show the text skills, hide the interactive graph */
  .print-skills { display: block; }
  .print-skills p { margin: 4pt 0; }

  .footer { border-color: #ccc; }
  .footer__verse { color: #444 !important; }

  section, .card, .tl-item, .footer { page-break-inside: avoid; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__scroll span { animation: none; }
  .hero__orbit { animation: none; }
}
