/* =========================================================
   Kruti Jadav — Portfolio
   Concept: "schema-first" — the site is staged like a system
   architecture diagram. A fixed blueprint grid + drifting
   gradient glow sit behind everything; the hero's layered
   stack graphic is blown up and annotated like a real schema.
   One accent trio (violet / teal / pink) tied to the three
   layers of the stack, spent boldly in the hero and sparingly
   everywhere else.
   ========================================================= */

:root {
  --bg: #09060f;
  --bg-elevated: #140e22;
  --ink: #f5f1fb;
  --muted: #ada2c9;
  --muted-dim: #6d6389;
  --accent: #b48cff;
  --accent-2: #6ee7d0;
  --accent-3: #ff8fc7;
  --accent-ink: #100a1c;
  --rule: rgba(245, 241, 251, 0.09);
  --rule-soft: rgba(245, 241, 251, 0.05);
  --radius: 8px;
  --radius-lg: 18px;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 0.84, 0.44, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, p, ul { margin: 0; }

/* ---------- Fixed backdrop: blueprint grid + drifting glow ---------- */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(245, 241, 251, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 241, 251, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, black 35%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, black 35%, transparent 78%);
}
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
.glow-orb-a {
  width: 420px; height: 420px;
  top: -180px; left: -140px;
  background: var(--accent);
  opacity: 0.12;
  animation: orbit-a 46s ease-in-out infinite alternate;
}
.glow-orb-b {
  width: 360px; height: 360px;
  bottom: -200px; right: -140px;
  background: var(--accent-2);
  opacity: 0.08;
  animation: orbit-b 54s ease-in-out infinite alternate;
}
.glow-orb-c { display: none; }
@keyframes orbit-a { from { transform: translate(0, 0); } to { transform: translate(70px, 90px); } }
@keyframes orbit-b { from { transform: translate(0, 0); } to { transform: translate(-60px, -70px); } }
@keyframes orbit-c { from { transform: translate(0, 0); } to { transform: translate(-40px, 60px); } }

/* ---------- Shell ---------- */
.shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  max-width: 1320px;
  margin: 0 auto;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 300px;
  flex-shrink: 0;
  padding: 60px 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(180, 140, 255, 0.03), transparent 40%);
}
.sb-mark {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  box-shadow: 0 6px 14px -8px rgba(180, 140, 255, 0.4);
  margin-bottom: 24px;
}
.sb-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.55rem;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.sb-role {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 22px;
}
.sb-bio {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 30ch;
  margin-bottom: 40px;
}
.sb-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 40px; }
.sb-nav a {
  font-size: 0.92rem;
  color: var(--muted);
  padding: 9px 0 9px 15px;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, text-shadow 0.15s ease;
}
.sb-nav a:hover { color: var(--ink); }
.sb-nav a.active {
  color: var(--ink);
  border-left-color: var(--accent);
  text-shadow: 0 0 16px rgba(180, 140, 255, 0.45);
}
.sb-social { display: flex; gap: 18px; flex-wrap: wrap; }
.sb-social a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-dim);
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
.sb-social a:hover { color: var(--accent-2); text-shadow: 0 0 14px rgba(110, 231, 208, 0.5); }

/* ---------- Content ---------- */
.content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  padding: 72px 64px 96px;
  max-width: 920px;
}
.content-narrow { max-width: 640px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 12px;
  border: 1px solid rgba(180, 140, 255, 0.28);
  border-radius: 999px;
  background: rgba(180, 140, 255, 0.06);
  margin-bottom: 26px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 4px 1px rgba(110, 231, 208, 0.5);
}

h1.headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 4.6vw, 4.4rem);
  line-height: 1.08;
  max-width: 16ch;
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}
p.lede {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 54ch;
  margin-bottom: 0;
}

/* One orchestrated entrance for the hero — nothing else on the
   page animates on load, only this. */
.intro-text .eyebrow,
.intro-text .headline,
.intro-text .lede,
.intro-text .hero-actions,
.stack-stage {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.7s var(--ease) forwards;
}
.intro-text .eyebrow { animation-delay: 0.05s; }
.intro-text .headline { animation-delay: 0.16s; }
.intro-text .lede { animation-delay: 0.28s; }
.intro-text .hero-actions { animation-delay: 0.4s; }
.stack-stage { animation-delay: 0.3s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* ---------- Intro row (text + layered stack) ---------- */
.intro-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 24px;
  min-height: calc(100vh - 280px);
  margin-bottom: 72px;
}
.intro-row .intro-text { position: relative; z-index: 2; }
.intro-row .stack-stage { margin-right: -48px; }

.stack-stage {
  perspective: 1300px;
  height: 380px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
}
.stack {
  position: relative;
  width: 220px;
  height: 220px;
  transform-style: preserve-3d;
  transform: rotateX(56deg) rotateZ(-38deg);
  transition: transform 0.15s ease-out;
  animation: stack-breathe 8s ease-in-out infinite;
}
@keyframes stack-breathe {
  0%, 100% { transform: rotateX(56deg) rotateZ(-38deg) rotateY(0deg) translateY(0); }
  50% { transform: rotateX(56deg) rotateZ(-38deg) rotateY(10deg) translateY(-10px); }
}
.plane {
  position: absolute;
  width: 190px;
  height: 190px;
  left: 15px;
  top: 15px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  opacity: 0.97;
}
.plane span {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: rgba(16, 10, 28, 0.82);
  background: rgba(255, 255, 255, 0.68);
  padding: 3px 8px;
  border-radius: 999px;
}
.plane-frontend {
  background: linear-gradient(135deg, #8ff0dc, #55c9ac);
  transform: translateZ(98px);
  box-shadow: 0 14px 26px -14px rgba(110, 231, 208, 0.4);
}
.plane-backend {
  background: linear-gradient(135deg, #cbb0ff, #a276f3);
  transform: translateZ(49px);
  box-shadow: 0 14px 26px -14px rgba(180, 140, 255, 0.4);
}
.plane-database {
  background: linear-gradient(135deg, #ffb3dc, #e685bd);
  transform: translateZ(0px);
  box-shadow: 0 14px 26px -14px rgba(255, 143, 199, 0.35);
}
.stack-connector {
  position: absolute;
  left: 108px;
  top: 15px;
  width: 1px;
  height: 98px;
  background: repeating-linear-gradient(to bottom, rgba(245, 241, 251, 0.45) 0 4px, transparent 4px 9px);
}

/* tech badges orbiting the stack in real 3D depth — hidden on small screens */
.orbit-item {
  position: absolute;
  top: 50%;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  animation: orbit-fade-in 0.6s var(--ease) forwards, orbit-rotate 26s linear infinite;
}
.orbit-item span {
  display: inline-block;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(245, 241, 251, 0.05);
  border: 1px solid var(--rule);
  backdrop-filter: blur(6px);
}
.orbit-item-1 { animation-delay: 0.9s, 0s; color: var(--accent-2); }
.orbit-item-2 { animation-delay: 1.1s, -6.5s; color: var(--accent); }
.orbit-item-3 { animation-delay: 1.3s, -13s; color: var(--accent-3); }
.orbit-item-4 { animation-delay: 1.5s, -19.5s; color: var(--muted); }
@keyframes orbit-rotate {
  from { transform: rotate(0deg) translateX(165px) translateZ(30px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(165px) translateZ(30px) rotate(-360deg); }
}
@keyframes orbit-fade-in { to { opacity: 1; } }

/* ---------- Buttons ---------- */
.hero-actions, .cta-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.15s ease, opacity 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: var(--accent-ink);
  box-shadow: 0 6px 16px -8px rgba(180, 140, 255, 0.45);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(180, 140, 255, 0.55); }
.btn-ghost { border-color: var(--rule); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(180, 140, 255, 0.25) inset; transform: translateY(-2px); }

/* ---------- Block / section header ---------- */
.block { margin-bottom: 72px; }
.block:last-child { margin-bottom: 0; }
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 26px;
}
.block-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.005em;
}
.block-head .meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted-dim);
  transition: color 0.15s ease;
}
a.meta:hover { color: var(--accent); }

/* ---------- Stat line ---------- */
.stat-line {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 56px;
  padding: 8px 0;
}
.stat-line .stat { position: relative; padding-left: 20px; }
.stat-line .stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}
.stat-line .stat:nth-child(2)::before { background: var(--accent-2); }
.stat-line .stat:nth-child(3)::before { background: var(--accent-3); }
.stat .value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--ink), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .label { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }

/* ---------- Skills ---------- */
.skill-line {
  display: flex;
  gap: 20px;
  padding: 14px 0;
  border-top: 1px dashed var(--rule);
}
.skill-line:first-child { border-top: none; }
.skill-line .cat {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted-dim);
  width: 100px;
  flex-shrink: 0;
  padding-top: 2px;
}
.skill-line .items { color: var(--ink); font-size: 0.93rem; line-height: 1.7; }

/* ---------- Work / project list ---------- */
.work-row {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 22px;
  padding: 24px 14px;
  margin: 0 -14px;
  border-top: 1px solid var(--rule);
  border-radius: var(--radius);
  align-items: start;
  transition: background 0.2s ease;
}
.work-row:last-child { border-bottom: 1px solid var(--rule); }
.work-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent, rgba(180, 140, 255, 0.08), transparent);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease);
  pointer-events: none;
}
.work-row:hover::before { transform: translateX(120%); }
.work-row .num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted-dim); padding-top: 3px; }
.work-row h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  margin-bottom: 7px;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}
.work-row p { color: var(--muted); font-size: 0.91rem; max-width: 56ch; margin-bottom: 10px; }
.work-row .stack-line { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted-dim); }
.work-row .go { align-self: center; font-size: 0.85rem; color: var(--muted); white-space: nowrap; transition: color 0.15s ease, transform 0.15s ease; }
.work-row:hover h3 { color: var(--accent); text-shadow: 0 0 22px rgba(180, 140, 255, 0.45); }
.work-row:hover .go { color: var(--accent); transform: translateX(3px); }

/* ---------- Project detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; }
.detail-block { margin-bottom: 28px; }
.detail-block h4 {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent);
  margin-bottom: 10px;
}
.detail-block p { color: var(--muted); font-size: 0.95rem; }
.stack-line-lg { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted-dim); }

.meta-list { border-top: 1px solid var(--rule); }
.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
}
.meta-row .k { color: var(--muted-dim); font-family: var(--font-mono); font-size: 0.78rem; }
.meta-row a { color: var(--accent); transition: text-shadow 0.15s ease; }
.meta-row a:hover { text-shadow: 0 0 14px rgba(180, 140, 255, 0.5); }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent), rgba(180, 140, 255, 0));
}
.timeline-item { position: relative; padding-bottom: 30px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -35px;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-dim);
  box-shadow: 0 0 0 4px rgba(245, 241, 251, 0.04);
}
.timeline-item.current::before {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(110, 231, 208, 0.16);
}
.timeline-item h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.04rem; margin-bottom: 4px; }
.timeline-item .period { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted-dim); }
.timeline-item p { color: var(--muted); margin-top: 8px; font-size: 0.91rem; }

/* ---------- Links / chips (About) ---------- */
.chip-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 9px 16px;
  border-radius: var(--radius);
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 12px -6px rgba(180, 140, 255, 0.4);
  transform: translateY(-2px);
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 64px; }
.contact-side p { color: var(--muted); font-size: 0.95rem; max-width: 34ch; }
.contact-side .details {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted-dim);
  line-height: 2;
}

.field { margin-bottom: 26px; }
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted-dim);
  margin-bottom: 9px;
  transition: color 0.15s ease;
}
.field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  padding: 10px 2px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  border-radius: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea {
  width: 100%;
  background: rgba(245, 241, 251, 0.015);
  border: 1px solid var(--rule);
  color: var(--ink);
  padding: 13px 15px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  border-radius: var(--radius);
  min-height: 130px;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 4px 10px -8px rgba(180, 140, 255, 0.7);
}
.field input:focus + label,
.field:focus-within label { color: var(--accent); }
.status-banner {
  border-left: 2px solid var(--accent-2);
  color: var(--ink);
  padding: 4px 0 4px 16px;
  margin-bottom: 30px;
  font-size: 0.92rem;
}
.error-list { color: #ff9fce; font-size: 0.85rem; margin: -14px 0 22px; padding-left: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  border-top: 1px solid var(--rule);
  padding-top: 24px;
  margin-top: 96px;
  color: var(--muted-dim);
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.site-footer::before,
.site-footer::after {
  content: "";
  position: absolute;
  top: -1px;
  width: 9px;
  height: 9px;
  opacity: 0.6;
}
.site-footer::before { left: 0; border-top: 1px solid var(--accent); border-left: 1px solid var(--accent); }
.site-footer::after { right: 0; border-top: 1px solid var(--accent); border-right: 1px solid var(--accent); }
.site-footer a:hover { color: var(--accent-2); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-right: none;
    border-bottom: 1px solid var(--rule);
  }
  .sb-mark { margin-bottom: 0; width: 38px; height: 38px; font-size: 0.82rem; }
  .sb-bio { display: none; }
  .sb-nav { flex-direction: row; gap: 18px; margin-bottom: 0; }
  .sb-nav a { padding: 4px 0; border-left: none; border-bottom: 2px solid transparent; }
  .sb-nav a.active { border-left: none; border-bottom-color: var(--accent); }
  .sb-social { display: none; }
  .content { padding: 48px 24px 64px; }
  .intro-row { grid-template-columns: 1fr; gap: 24px; min-height: 0; }
  .intro-row .stack-stage { margin-right: 0; order: -1; }
  .stack-stage { height: 200px; }
  .orbit-item { display: none; }
  .stat-line { grid-template-columns: 1fr; gap: 22px; }
  .work-row { grid-template-columns: 1fr; margin: 0; padding: 20px 0; }
  .work-row .num { display: none; }
  .detail-grid, .contact-grid { grid-template-columns: 1fr; }
}
