/* ============================================================
   ADITYA TOMAR — COMMAND CENTER
   Design tokens
   ============================================================ */
:root {
  /* Color */
  --bg: #FBF6EF;
  --bg-panel: #FFFFFF;
  --bg-raised: #FDF9F3;
  --ink: #201A16;
  --ink-soft: #5C5049;
  --ink-faint: #948577;
  --line: #ECE0D3;
  --line-strong: #DCCBB6;
  --accent: #E2611F;        /* sunset orange — circuit trace */
  --accent-ink: #B34A16;
  --accent-soft: #FBE2CC;
  --amber: #F0A63C;         /* golden amber — highlight / status */
  --amber-soft: #FCEBCB;
  --navy: #3A2317;          /* deep umber for contrast blocks */

  /* Type */
  --f-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --f-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Layout */
  --maxw: 1080px;
  --radius: 14px;
  --radius-sm: 8px;
}

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

html {
  scroll-behavior: smooth;
}

@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;
    scroll-behavior: auto !important;
  }
}

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.75rem;
  position: relative;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  color: var(--ink);
  letter-spacing: -0.01em;
  font-weight: 600;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.15; }
h3 { font-size: 1.15rem; }

p { color: var(--ink-soft); }

.mono { font-family: var(--f-mono); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 0.9rem;
}

.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================================================
   BACKGROUND GRID + CIRCUIT TRACE
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(32,26,22,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32,26,22,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
}

.trace-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

.trace-path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.55;
  stroke-dasharray: 6 2000;
  stroke-dashoffset: 0;
  transition: stroke-dasharray 1.6s cubic-bezier(.22,.61,.36,1);
}

.trace-path.drawn {
  stroke-dasharray: 2000 2000;
}

.trace-node {
  fill: var(--accent);
  opacity: 0;
  transform-origin: center;
  transition: opacity .5s ease .9s, transform .5s ease .9s;
  transform: scale(0);
}

.trace-node.lit { opacity: 1; transform: scale(1); }

/* ============================================================
   NAV
   ============================================================ */
nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(246, 244, 239, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
}

.logo {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.logo .dot-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); }
  50% { box-shadow: 0 0 0 7px var(--accent-soft); }
}

.logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 2.1rem;
  list-style: none;
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a {
  position: relative;
  color: var(--ink-soft);
  padding: 0.3rem 0.05rem;
  transition: color .2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width .25s ease;
}

.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span {
  width: 22px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 6px 18px rgba(58,35,23,0.18);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(58,35,23,0.26); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }

/* ============================================================
   REVEAL ON SCROLL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 5.5rem 0 4.5rem;
  position: relative;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid rgba(226,97,31,0.25);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.6rem;
}

.hero h1 { margin-bottom: 1.1rem; }
.hero h1 .type-role {
  display: block;
  color: var(--accent-ink);
  font-size: 0.5em;
  font-family: var(--f-mono);
  font-weight: 500;
  letter-spacing: 0;
  margin-top: 0.6rem;
  min-height: 1.4em;
}
.type-cursor {
  display: inline-block;
  width: 2px;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 0.9s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-sub {
  max-width: 560px;
  font-size: 1.08rem;
  margin-bottom: 2.1rem;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 2.6rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 640px;
}

.hero-stat {
  background: var(--bg-panel);
  padding: 1.3rem 1.4rem;
}

.hero-stat .num {
  font-family: var(--f-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--navy);
  display: block;
}

.hero-stat .lbl {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================================
   SECTIONS
   ============================================================ */
section {
  padding: 5rem 0;
  position: relative;
  z-index: 1;
}

.section-head {
  margin-bottom: 2.6rem;
  max-width: 640px;
}

.section-head p { font-size: 1.02rem; }

/* ============================================================
   CARDS
   ============================================================ */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.4rem;
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  transition: transform .3s cubic-bezier(.22,.61,.36,1), box-shadow .3s ease, border-color .3s ease;
  position: relative;
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 40px rgba(32,26,22,0.08);
}

.card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono);
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Project cards */
.project-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  display: block;
  transition: transform .3s cubic-bezier(.22,.61,.36,1), box-shadow .3s ease;
}
.project-card:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(32,26,22,0.1); }

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.project-tag {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--amber-soft);
  color: #8A5714;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--f-mono);
  font-size: 0.85rem;
  color: var(--accent-ink);
  margin-top: 1.1rem;
}
.project-card:hover .project-link { text-decoration: underline; }

.project-meta {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
  font-family: var(--f-mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
}
.project-meta span { display: flex; align-items: center; gap: 0.35rem; }

/* Tags */
.stack-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.tag {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  color: var(--ink-soft);
  transition: border-color .2s ease, color .2s ease;
}
.tag:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ============================================================
   TIMELINE (About)
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 2.1rem;
  border-left: 2px solid var(--line);
}

.timeline-item {
  position: relative;
  padding-bottom: 2.4rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.36rem;
  top: 0.3rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 2px solid var(--accent);
}

.timeline-item .t-label {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--accent-ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
  display: block;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-panel {
  background: var(--navy);
  color: #fff;
  border-radius: 20px;
  padding: 3.2rem;
  position: relative;
  overflow: hidden;
}
.contact-panel h2 { color: #fff; }
.contact-panel p { color: rgba(255,255,255,0.72); }

.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 1rem;
  margin-top: 2.2rem;
}

.contact-link {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background .2s ease, transform .2s ease;
}
.contact-link:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }
.contact-link .clabel { font-family: var(--f-mono); font-size: 0.72rem; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.06em; display:block; margin-bottom: 0.3rem; }
.contact-link .cvalue { font-weight: 600; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--line);
  padding: 2.4rem 0;
  margin-top: 2rem;
}
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}
footer p { font-size: 0.85rem; color: var(--ink-faint); }
footer .mono { font-size: 0.8rem; }

/* ============================================================
   PAGE HEADER (interior pages)
   ============================================================ */
.page-header {
  padding: 3.6rem 0 2.4rem;
}
.page-header .eyebrow { margin-bottom: 1.1rem; }
.page-header h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); }
.page-header p { max-width: 560px; font-size: 1.05rem; margin-top: 1rem; }

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  z-index: 300;
  transition: width 0.08s linear;
}

/* ============================================================
   CURSOR SPOTLIGHT (hero)
   ============================================================ */
.spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(480px circle at var(--sx, 50%) var(--sy, 20%), rgba(226,97,31,0.09), transparent 70%);
  z-index: 0;
  transition: background 0.05s linear;
}

/* ============================================================
   TILT CARDS
   ============================================================ */
.tilt {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ============================================================
   COUNTER
   ============================================================ */
.hero-stat .num[data-count] { font-variant-numeric: tabular-nums; }

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee-wrap {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 1.1rem 0;
  background: var(--bg-raised);
}
.marquee-track {
  display: flex;
  gap: 2.6rem;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee-track span {
  font-family: var(--f-mono);
  font-size: 0.85rem;
  color: var(--ink-faint);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.marquee-track span::before {
  content: '◆';
  color: var(--accent);
  font-size: 0.6rem;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================================
   FADE-IN PAGE LOAD
   ============================================================ */
body.page-ready { animation: pageFade 0.5s ease both; }
@keyframes pageFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ANIMATED UNDERLINE ON SECTION HEADS
   ============================================================ */
.section-head h2 {
  position: relative;
  display: inline-block;
}
.section-head h2::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  height: 3px;
  width: 46px;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s cubic-bezier(.22,.61,.36,1) .15s;
}
.section-head.in h2::after,
.section-head h2.underline-in::after { transform: scaleX(1); }

/* ============================================================
   IMAGE PLACEHOLDER — swap for a real <img> later
   ============================================================ */
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  background: repeating-linear-gradient(135deg, var(--bg-raised), var(--bg-raised) 10px, var(--accent-soft) 10px, var(--accent-soft) 20px);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-faint);
  font-family: var(--f-mono);
  font-size: 0.78rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1rem;
}
.img-placeholder svg { opacity: 0.5; }
.img-placeholder.avatar { border-radius: 50%; aspect-ratio: 1/1; }
.img-placeholder.hero-frame { width: 100%; aspect-ratio: 4/5; max-width: 340px; }
.img-placeholder.wide { aspect-ratio: 16/9; }
.img-placeholder.thumb { aspect-ratio: 16/10; margin-bottom: 1rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 1.2rem 1.75rem;
    gap: 1.1rem;
    transform: translateY(-130%);
    transition: transform .3s ease;
    z-index: 150;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .hero-stats { grid-template-columns: 1fr; }
  .contact-panel { padding: 2.2rem 1.6rem; }
}
