/* ==========================================================================
   Adithya TG — portfolio
   Dark, space-themed, typography-led. 8px spacing system.
   ========================================================================== */

:root {
  --bg: #060913;
  --bg-raised: #0b111f;
  --bg-card: #0a0f1c;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.26);
  --text: #e7ebf4;
  --text-muted: #9aa5ba;
  --text-faint: #6b7690;
  --accent: #8ab6ff;
  --accent-strong: #aecbff;
  --accent-dim: rgba(138, 182, 255, 0.14);
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --container: 1080px;
  --radius: 10px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Background layers ---- */

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.nebula {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(99, 102, 241, 0.10), transparent 60%),
    radial-gradient(50rem 36rem at -10% 30%, rgba(56, 189, 248, 0.05), transparent 60%);
}

/* ---- Base elements ---- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
ul, ol { margin: 0; padding: 0; }
strong { color: var(--text); font-weight: 600; }

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 100;
  background: var(--bg-raised);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  transition: top 0.15s ease;
}
.skip-link:focus { top: 16px; }

/* ---- Header / nav ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 9, 19, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.nav-logo svg { color: var(--accent); }
.nav-logo:hover { color: var(--accent-strong); }

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover {
  color: var(--text);
  background: rgba(148, 163, 184, 0.08);
}
.nav-links a.active {
  color: var(--accent-strong);
}

.nav-cta {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid rgba(138, 182, 255, 0.35);
  padding: 7px 16px;
  border-radius: 7px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-cta:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #0a1020;
}
.btn-primary:hover {
  background: var(--accent-strong);
  color: #0a1020;
}

.btn-ghost {
  color: var(--text);
  border-color: var(--line-strong);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-dim);
}

.text-link {
  font-size: 14px;
  font-weight: 500;
}

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

.hero { padding: 112px 0 96px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  align-items: center;
}

.hero-eyebrow {
  font-size: 14px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent-strong);
  background: var(--accent-dim);
  border: 1px solid rgba(138, 182, 255, 0.28);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 24px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.hero-badge:hover {
  border-color: var(--accent);
  background: rgba(138, 182, 255, 0.2);
}
.hero-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(138, 182, 255, 0.9);
}

.hero h1 {
  font-size: clamp(40px, 6.5vw, 68px);
  font-weight: 700;
  background: linear-gradient(115deg, #f2f5fb 55%, #9db9ea);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--accent);
}

.hero-lede {
  margin-top: 16px;
  max-width: 52ch;
  font-size: 17px;
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
}

.hero-links {
  display: flex;
  gap: 8px;
  list-style: none;
  margin-top: 40px;
}
.hero-links a {
  display: inline-flex;
  padding: 10px;
  color: var(--text-faint);
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.hero-links a:hover {
  color: var(--accent-strong);
  background: rgba(148, 163, 184, 0.08);
}

.hero-constellation svg {
  width: 100%;
  height: auto;
  opacity: 0.85;
}
.hero-constellation path {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: draw-line 2.4s ease-out 0.4s forwards;
}
.hero-constellation circle {
  animation: star-pulse 4s ease-in-out infinite;
}
.hero-constellation circle:nth-child(odd) { animation-delay: 1.3s; }
.hero-constellation circle:nth-child(3n) { animation-delay: 2.6s; }

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}
@keyframes star-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

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

.section { padding: 96px 0; }

.section-eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(28px, 4vw, 38px);
  margin-bottom: 48px;
}

.section-sub {
  color: var(--text-muted);
  max-width: 60ch;
  margin: -32px 0 48px;
}

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

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 64px;
  align-items: start;
}

.about-copy h2 {
  font-size: clamp(26px, 3.5vw, 34px);
  margin-bottom: 24px;
  max-width: 22ch;
}

.about-copy p {
  color: var(--text-muted);
  font-size: 17px;
  max-width: 62ch;
}

.about-photo {
  margin: 8px 0 0;
  position: relative;
}
.about-photo img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  display: block;
  filter: saturate(0.9);
}
.about-photo::after {
  content: "";
  position: absolute;
  inset: 12px -12px -12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  z-index: -1;
}

/* ---- Timeline ---- */

.timeline {
  list-style: none;
  position: relative;
  max-width: 860px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line-strong);
}

.timeline-item {
  position: relative;
  padding: 0 0 48px 40px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(138, 182, 255, 0.15);
}

.timeline-date {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.timeline-body h3 {
  font-size: 19px;
  margin: 8px 0 12px;
}
.timeline-body .company { color: var(--accent); font-weight: 600; }

.timeline-body ul {
  list-style: none;
  display: grid;
  gap: 8px;
}
.timeline-body li {
  color: var(--text-muted);
  padding-left: 20px;
  position: relative;
  max-width: 68ch;
}
.timeline-body li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
}

/* ---- Case studies ---- */

.case-study {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-card));
  padding: 40px;
  margin-bottom: 32px;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.case-study:hover {
  border-color: rgba(138, 182, 255, 0.3);
  box-shadow: 0 8px 48px rgba(138, 182, 255, 0.07), 0 2px 12px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}
.case-study:last-child { margin-bottom: 0; }

.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}
.case-head h3 { font-size: 24px; }

.case-tag {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(138, 182, 255, 0.25);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 48px;
}
.case-grid h4 {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 8px;
  font-weight: 600;
}
.case-grid p {
  color: var(--text-muted);
  font-size: 15.5px;
}

.case-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.tech-list li {
  font-size: 13px;
  color: var(--text-muted);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
}

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

.pub-list {
  list-style: none;
  border-top: 1px solid var(--line);
  max-width: 920px;
}

.pub {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 24px 8px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.pub:hover { background: rgba(148, 163, 184, 0.04); }

.pub-year {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-faint);
}

.pub-body h3 {
  font-size: 16px;
  font-weight: 500;
  font-family: var(--font-body);
  letter-spacing: 0;
  line-height: 1.45;
}
.pub-body h3 a { color: var(--text); }
.pub-body h3 a:hover { color: var(--accent-strong); }
.pub-body p {
  font-size: 13.5px;
  color: var(--text-faint);
  margin-top: 4px;
}

.pub-type {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.pub-actions {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 32px;
}
.pub-actions .btn { padding: 10px 20px; font-size: 14px; cursor: pointer; font-family: var(--font-body); }

/* ---- Education ---- */

.edu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  max-width: 920px;
}

.edu-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--bg-raised), var(--bg-card));
  padding: 32px;
}
.edu-card h3 { font-size: 20px; }
.edu-degree { margin-top: 8px; color: var(--text-muted); }
.edu-meta {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.honors {
  list-style: none;
  display: grid;
  gap: 16px;
  padding-top: 8px;
}
.honors li {
  color: var(--text-muted);
  padding-left: 28px;
  position: relative;
}
.honors li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(138, 182, 255, 0.6);
}

/* ---- Skills ---- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.skill-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  background: var(--bg-card);
}
.skill-group h3 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 16px;
}
.skill-group ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-group li {
  font-size: 13.5px;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.skill-group li:hover {
  border-color: rgba(138, 182, 255, 0.4);
  color: var(--text);
}

/* ---- Contact ---- */

.section-contact {
  padding: 128px 0 144px;
  text-align: left;
}

.contact-title {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
}

.contact-sub {
  color: var(--text-muted);
  font-size: 17px;
  margin-top: 16px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 40px;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-faint);
}

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

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-constellation path {
    animation: none;
    stroke-dashoffset: 0;
  }
  .hero-constellation circle { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

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

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-constellation { display: none; }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about-photo { max-width: 280px; }
  .case-grid { grid-template-columns: 1fr; gap: 24px; }
  .edu-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav { justify-content: space-between; }
  .hero { padding: 72px 0 64px; }
  .section { padding: 64px 0; }
  .case-study { padding: 24px; }
  .pub {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .pub-year { order: 2; }
  .pub-type { display: none; }
}
