/* ============================================================
   Arya Banerjee — CV Site
   Design tokens
   ============================================================ */
:root {
  --bg: #0b0f19;
  --bg-alt: #0e1424;
  --surface: #131a2a;
  --surface-2: #1b2438;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8ecf4;
  --text-muted: #8a93a6;
  --text-faint: #576079;
  --accent: #5eead4;
  --accent-2: #8b5cf6;
  --accent-grad: linear-gradient(135deg, #5eead4 0%, #8b5cf6 100%);

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --container: 1120px;
  --radius: 18px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

::selection { background: var(--accent-2); color: #0b0f19; }

/* Film grain texture overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94,234,212,0.06) 0%, rgba(139,92,246,0.04) 45%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 64px);
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 25, 0.5);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.nav.scrolled {
  border-bottom-color: var(--border);
  background: rgba(11, 15, 25, 0.82);
}
.nav__mark {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-size: 15px;
}
.nav__links {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}
.nav__links li a { transition: color 0.25s ease; position: relative; }
.nav__links li a:hover { color: var(--text); }
.nav__cta {
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  color: var(--text) !important;
}
.nav__cta:hover { background: var(--accent); color: var(--bg) !important; border-color: var(--accent); }

@media (max-width: 720px) {
  .nav__links { gap: 14px; font-size: 11px; }
  .nav__links li:not(:last-child) { display: none; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 70% 20%, #131c30 0%, var(--bg) 60%);
}
#networkCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* -------- 3D rotating polyhedron (hero signature) -------- */
.scene {
  position: absolute;
  top: 50%;
  right: clamp(2%, 8vw, 14%);
  transform: translateY(-50%);
  z-index: 1;
  perspective: 1200px;
  width: min(38vw, 460px);
  height: min(38vw, 460px);
  pointer-events: none;
  transition: transform 0.6s var(--ease), opacity 0.3s ease;
}
@media (max-width: 900px) {
  .scene { opacity: 0.35; width: 70vw; height: 70vw; right: 50%; transform: translate(50%, -50%); }
}

.poly {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: polySpin 26s linear infinite;
}
@keyframes polySpin {
  0%   { transform: rotateX(-18deg) rotateY(0deg) rotateZ(0deg); }
  100% { transform: rotateX(-18deg) rotateY(360deg) rotateZ(360deg); }
}

.poly__ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.poly__ring span {
  position: absolute;
  top: 50%; left: 50%;
  width: 96%;
  height: 96%;
  margin: -48% 0 0 -48%;
  border-radius: 50%;
  border: 1px solid rgba(94, 234, 212, 0.35);
  box-shadow: 0 0 24px rgba(94, 234, 212, 0.08) inset;
}
.poly__ring--1 span:nth-child(1) { transform: rotateY(0deg); }
.poly__ring--1 span:nth-child(2) { transform: rotateY(30deg); }
.poly__ring--1 span:nth-child(3) { transform: rotateY(60deg); }
.poly__ring--1 span:nth-child(4) { transform: rotateY(90deg); }
.poly__ring--1 span:nth-child(5) { transform: rotateY(120deg); }
.poly__ring--1 span:nth-child(6) { transform: rotateY(150deg); }

.poly__ring--2 { animation: ringCounter 40s linear infinite; }
.poly__ring--2 span { border-color: rgba(139, 92, 246, 0.3); }
.poly__ring--2 span:nth-child(1) { transform: rotateX(0deg) rotateY(0deg); }
.poly__ring--2 span:nth-child(2) { transform: rotateX(60deg) rotateY(0deg); }
.poly__ring--2 span:nth-child(3) { transform: rotateX(120deg) rotateY(0deg); }
.poly__ring--2 span:nth-child(4) { transform: rotateX(0deg) rotateY(60deg); }
.poly__ring--2 span:nth-child(5) { transform: rotateX(0deg) rotateY(120deg); }
.poly__ring--2 span:nth-child(6) { transform: rotateX(60deg) rotateY(60deg); }
@keyframes ringCounter {
  0%   { transform: rotateZ(0deg); }
  100% { transform: rotateZ(-360deg); }
}

.poly__core {
  position: absolute;
  top: 50%; left: 50%;
  width: 14%;
  height: 14%;
  margin: -7% 0 0 -7%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d6fff8, var(--accent) 40%, var(--accent-2) 100%);
  box-shadow: 0 0 50px 10px rgba(94, 234, 212, 0.45), 0 0 100px 30px rgba(139, 92, 246, 0.25);
  transform: translateZ(40px);
  animation: corePulse 4s ease-in-out infinite;
}
@keyframes corePulse {
  0%, 100% { transform: translateZ(40px) scale(1); }
  50% { transform: translateZ(60px) scale(1.12); }
}

/* -------- Floating background geometry -------- */
.float-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  perspective: 900px;
}
.float-shape {
  position: absolute;
  border-radius: 22%;
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, rgba(94,234,212,0.06), rgba(139,92,246,0.05));
  transform-style: preserve-3d;
}
.float-shape--1 { width: 140px; height: 140px; top: 8%; left: 6%; animation: floatA 16s ease-in-out infinite; }
.float-shape--2 { width: 90px; height: 90px; top: 60%; left: 88%; border-radius: 50%; animation: floatB 20s ease-in-out infinite; }
.float-shape--3 { width: 110px; height: 110px; top: 78%; left: 12%; animation: floatC 18s ease-in-out infinite; }

@keyframes floatA {
  0%, 100% { transform: translate3d(0,0,0) rotateX(0deg) rotateY(0deg); }
  50% { transform: translate3d(20px, -30px, 40px) rotateX(60deg) rotateY(120deg); }
}
@keyframes floatB {
  0%, 100% { transform: translate3d(0,0,0) rotateX(0deg) rotateY(0deg); }
  50% { transform: translate3d(-25px, 20px, 30px) rotateX(-50deg) rotateY(-90deg); }
}
@keyframes floatC {
  0%, 100% { transform: translate3d(0,0,0) rotateZ(0deg); }
  50% { transform: translate3d(15px, -18px, 20px) rotateZ(180deg); }
}
@media (max-width: 720px) { .float-shape { display: none; } }

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  width: 100%;
  padding: 0 clamp(20px, 5vw, 64px);
  text-align: left;
  transition: transform 0.5s var(--ease);
  will-change: transform;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 18px;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease) 0.1s forwards;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(52px, 10vw, 128px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.hero__title-line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: fadeUp 0.9s var(--ease) forwards;
}
.hero__title-line:nth-child(1) { animation-delay: 0.2s; }
.hero__title-line--accent {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation-delay: 0.35s;
}
.hero__subtitle {
  max-width: 560px;
  margin-top: 28px;
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--text-muted);
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 0.55s forwards;
}
.hero__actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 0.7s forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  padding: 14px 28px;
  border-radius: 100px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s ease, border-color 0.35s ease;
  display: inline-block;
}
.btn--primary {
  background: var(--accent-grad);
  color: #061019;
  font-weight: 600;
}
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 12px 30px -8px rgba(94, 234, 212, 0.4); }
.btn--ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  z-index: 2;
}
.scroll-cue span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  animation: scrollDown 1.8s ease-in-out infinite;
}
@keyframes scrollDown {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}

/* ============================================================
   SECTIONS (shared)
   ============================================================ */
.section {
  position: relative;
  z-index: 2;
  padding: clamp(80px, 12vw, 140px) clamp(20px, 5vw, 64px);
  max-width: var(--container);
  margin: 0 auto;
}
.section--alt { max-width: none; background: var(--bg-alt); }
.section--alt > * { max-width: var(--container); margin-left: auto; margin-right: auto; }

.section__head { margin-bottom: 56px; }
.section__head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.01em;
  max-width: 640px;
}
.section__head .eyebrow { margin-bottom: 14px; }

/* ============================================================
   SUMMARY
   ============================================================ */
.summary {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 64px;
  align-items: start;
}
.summary__photo {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 3/3.6;
  transform-style: preserve-3d;
}
.summary__photo img { width: 100%; height: 100%; object-fit: cover; }
.summary__photo-frame {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.4);
  pointer-events: none;
}
.summary__photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(94,234,212,0.15), transparent 40%);
}
.summary__text p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 40px;
}
.summary__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}
.fact { display: flex; flex-direction: column; gap: 6px; }
.fact__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.fact__value { font-size: 15px; font-weight: 500; }

@media (max-width: 720px) {
  .summary { grid-template-columns: 1fr; }
  .summary__photo { max-width: 220px; }
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.tilt {
  position: relative;
  isolation: isolate;
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: box-shadow 0.4s ease, border-color 0.3s ease, background 0.3s ease;
}
.tilt::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(94, 234, 212, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.tilt:hover { box-shadow: 0 24px 50px -20px rgba(0,0,0,0.55); }
.tilt:hover::before { opacity: 1; }
.tilt > * { position: relative; z-index: 2; }

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 26px;
  transform-style: preserve-3d;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.skill-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.skill-card__icon {
  display: inline-block;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 18px;
  transform: translateZ(30px);
}
.skill-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.4;
  transform: translateZ(20px);
}

/* ============================================================
   TIMELINE (Experience)
   ============================================================ */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1px;
  background: linear-gradient(var(--accent), var(--accent-2));
  opacity: 0.4;
}
.timeline__item {
  position: relative;
  margin-bottom: 48px;
  perspective: 1000px;
}
.timeline__item.reveal {
  transform: none;
}
.timeline__item.reveal .timeline__card {
  transform-origin: top center;
  transform: perspective(1000px) rotateX(-35deg) translateY(24px);
  opacity: 0;
  transition: transform 0.9s var(--ease), opacity 0.9s var(--ease);
}
.timeline__item.reveal.is-visible .timeline__card {
  transform: perspective(1000px) rotateX(0deg) translateY(0);
  opacity: 1;
}
.timeline__item:last-child { margin-bottom: 0; }
.timeline__dot {
  position: absolute;
  left: -32px;
  top: 8px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--accent-grad);
  box-shadow: 0 0 0 5px var(--bg), 0 0 20px rgba(94,234,212,0.5);
}
.timeline__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transform-style: preserve-3d;
  transition: border-color 0.3s ease;
}
.timeline__card:hover { border-color: var(--border-strong); }
.timeline__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.timeline__card h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin-top: 10px;
}
.timeline__org { color: var(--text-muted); margin-top: 4px; margin-bottom: 18px; font-size: 15px; }
.timeline__card ul { display: flex; flex-direction: column; gap: 8px; }
.timeline__card li {
  position: relative;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 15px;
}
.timeline__card li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 1px;
  background: var(--accent);
}

/* ============================================================
   EDUCATION
   ============================================================ */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  transform-style: preserve-3d;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.edu-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.edu-card__year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  transform: translateZ(25px);
  display: inline-block;
}
.edu-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-top: 10px;
  transform: translateZ(20px);
}
.edu-card p { color: var(--text-muted); margin-top: 6px; font-size: 14.5px; }

/* ============================================================
   LANGUAGES
   ============================================================ */
.lang-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.lang-chip {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.3s var(--ease), border-color 0.3s ease;
}
.lang-chip:hover { transform: translateY(-4px); border-color: var(--accent); }
.lang-chip small {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lang-chip--native { border-color: var(--accent); background: rgba(94,234,212,0.06); }

/* ============================================================
   CONTACT / FOOTER
   ============================================================ */
.contact {
  position: relative;
  padding: clamp(90px, 14vw, 160px) clamp(20px, 5vw, 64px) 60px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  overflow: hidden;
}
#networkCanvasFooter {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}
.contact__inner {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
}
.contact h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 54px);
  margin-bottom: 48px;
}
.contact__links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.contact__link {
  background: var(--bg-alt);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.3s ease;
}
a.contact__link:hover { background: var(--surface-2); }
.contact__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.contact__value { font-size: 16px; font-weight: 500; }
.contact__footer {
  margin-top: 64px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.summary, .skills-grid, .edu-grid, .lang-grid { opacity: 0; transform: translateY(36px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.summary.is-visible, .skills-grid.is-visible, .edu-grid.is-visible, .lang-grid.is-visible { opacity: 1; transform: translateY(0); }
