/* ==========================================================================
   Gaurav Patel — Portfolio
   Vanilla CSS. Structure:
   1. Tokens   2. Reset & base   3. Utilities   4. Boot screen
   5. Header   6. Hero   8. Sections   9. About (+ markdown viewer)
   10. Projects   11. Experience   12. Resume   13. Contact
   14. Footer  15. Toast   16. Motion & responsive
   ========================================================================== */

/* 1. Tokens ------------------------------------------------------------- */
:root {
  --bg: #06080f;
  --bg-2: #0a0f1d;
  --surface: #0e1424;
  --surface-2: #131b30;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);

  --text: #e8eef8;
  --muted: #9aa6bd;
  --dim: #6b7690;

  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --lime: #a3e635;
  --pink: #f472b6;
  --grad: linear-gradient(100deg, var(--cyan) 0%, var(--violet) 100%);
  --grad-soft: linear-gradient(100deg, rgba(34, 211, 238, 0.18), rgba(139, 92, 246, 0.18));

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --nav-h: 72px;
  --container: 1160px;
  --gutter: clamp(20px, 5vw, 48px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur: 0.7s;

  --shadow-glow: 0 0 0 1px rgba(34, 211, 238, 0.25), 0 20px 60px -20px rgba(34, 211, 238, 0.35);
}

/* 2. Reset & base ------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}

body.menu-open { overflow: hidden; }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

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

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

::selection { background: rgba(34, 211, 238, 0.35); color: #fff; }

/* 3. Utilities ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.02em; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  background: var(--cyan);
  color: #04121a;
  font-weight: 600;
  border-radius: 8px;
  transform: translateY(-200%);
  transition: transform 0.25s var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

/* Buttons */
.btn {
  --btn-bg: var(--surface-2);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  border: 1px solid var(--border-strong);
  background: var(--btn-bg);
  color: var(--text);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease-out), border-color 0.35s, box-shadow 0.35s, color 0.35s;
  -webkit-tap-highlight-color: transparent;
}
.btn .icon { transition: transform 0.35s var(--ease-out); }
.btn:hover { transform: translateY(-2px); border-color: rgba(34, 211, 238, 0.6); }
.btn:hover .icon { transform: translateX(3px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  color: #04121a;
  border-color: transparent;
  background: var(--grad);
  box-shadow: 0 10px 30px -10px rgba(34, 211, 238, 0.55);
}
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--violet), var(--cyan));
  opacity: 0;
  transition: opacity 0.4s;
  z-index: -1;
}
.btn--primary:hover::before { opacity: 1; }
.btn--primary:hover { box-shadow: 0 16px 40px -12px rgba(139, 92, 246, 0.6); }

.btn--ghost { background: rgba(14, 20, 36, 0.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn--sm { padding: 10px 16px; font-size: 0.85rem; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, gap 0.3s;
}
.text-link:hover { border-color: currentColor; gap: 10px; }

/* Socials */
.socials { display: flex; gap: 10px; }
.socials a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(14, 20, 36, 0.6);
  color: var(--muted);
  transition: color 0.3s, border-color 0.3s, transform 0.35s var(--ease-out), background 0.3s;
}
.socials svg { width: 18px; height: 18px; }
.socials a:hover { color: var(--text); border-color: rgba(34, 211, 238, 0.5); background: rgba(34, 211, 238, 0.08); transform: translateY(-3px); }

/* Reveal-on-scroll */
/* Only hide reveal targets when JS is running (html.js is set inline in <head>) */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  transition-delay: calc(var(--reveal-delay, 0) * 90ms);
  will-change: opacity, transform;
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal-delay="1"] { --reveal-delay: 1; }
[data-reveal-delay="2"] { --reveal-delay: 2; }
[data-reveal-delay="3"] { --reveal-delay: 3; }
[data-reveal-delay="4"] { --reveal-delay: 4; }
[data-reveal-delay="5"] { --reveal-delay: 5; }

/* 4. Boot screen -------------------------------------------------------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.6s var(--ease-in-out), visibility 0.6s;
}
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
/* Failsafe: even if scripts never run, the overlay disappears after 4s */
.boot { animation: bootFailsafe 0s 4s forwards; }
@keyframes bootFailsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.no-boot .boot { display: none; }
.boot__inner { width: min(320px, 80vw); text-align: center; }
.boot__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.4rem;
  letter-spacing: -0.04em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 22px;
}
.boot__log {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-align: left;
  min-height: 5.5em;
}
.boot__log li { opacity: 0; transform: translateY(6px); transition: opacity 0.3s, transform 0.3s; }
.boot__log li.is-on { opacity: 1; transform: none; }
.boot__log li.is-on::before { content: "✓ "; color: var(--lime); }
.boot__log li.is-on:last-child { color: var(--cyan); }
.boot__bar { height: 3px; margin-top: 14px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.boot__bar span { display: block; height: 100%; width: 0; background: var(--grad); transition: width 1.1s var(--ease-out); }
.boot.is-running .boot__bar span { width: 100%; }

/* 5. Header ------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 900;
  height: var(--nav-h);
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s, height 0.4s var(--ease-out), transform 0.5s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  height: 62px;
  background: rgba(6, 8, 15, 0.7);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-color: var(--border);
}
.site-header__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--grad);
  transform-origin: left;
  transform: scaleX(var(--scroll, 0));
  opacity: 0;
  transition: opacity 0.3s;
}
.site-header.is-scrolled .site-header__progress { opacity: 1; }

.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.nav__brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; }
.nav__brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--grad);
  color: #04121a;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.nav__menu { display: flex; align-items: center; gap: 4px; }
.nav__link {
  position: relative;
  display: inline-block;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: 999px;
  transition: color 0.3s, background 0.3s;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.nav__link:hover { color: var(--text); }
.nav__link.is-active { color: var(--text); }
.nav__link.is-active::after { transform: scaleX(1); }
.nav__cta-item { margin-left: 10px; }

.nav__toggle {
  display: none;
  position: relative;
  z-index: 950;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(14, 20, 36, 0.6);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav__toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.35s var(--ease-out), opacity 0.25s;
}
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 6. Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 40px) 0 90px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(139, 92, 246, 0.16), transparent 70%),
    radial-gradient(50% 40% at 80% 90%, rgba(34, 211, 238, 0.12), transparent 70%),
    var(--bg);
}
.hero__bg { position: absolute; inset: 0; z-index: -2; }
.hero__bg canvas { width: 100%; height: 100%; }
.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(55% 55% at 50% 50%, rgba(6, 8, 15, 0.55), rgba(6, 8, 15, 0) 100%),
    linear-gradient(to bottom, rgba(6, 8, 15, 0) 70%, var(--bg) 100%);
}

.hero__content { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; }

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(14, 20, 36, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 28px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.6);
  animation: ping 2s infinite;
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(163, 230, 53, 0); }
  100% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0); }
}

.hero__title {
  font-size: clamp(3rem, 10vw, 7.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin-bottom: 26px;
}
.hero__name { display: inline-block; }
.hero__name .char {
  display: inline-block;
  background: linear-gradient(180deg, #fff 0%, #cdd7ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: translateY(0.4em) rotate(4deg);
  opacity: 0;
  animation: charIn 0.9s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 45ms + 0.35s);
}
.hero__name .char--space { width: 0.25em; }
@keyframes charIn { to { transform: none; opacity: 1; } }

.hero__tagline {
  max-width: 640px;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--muted);
  margin-bottom: 30px;
}

.terminal {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(10, 15, 29, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.6vw, 0.95rem);
  color: var(--text);
  margin-bottom: 36px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.terminal__prompt { color: var(--lime); flex: none; }
.terminal__text { min-height: 1.4em; text-align: left; }
.terminal__caret {
  width: 9px;
  height: 1.15em;
  background: var(--cyan);
  flex: none;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 34px; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  color: var(--dim);
  opacity: 0;
  animation: fadeIn 1s 1.8s forwards;
}
.scroll-cue__mouse {
  display: block;
  width: 24px;
  height: 38px;
  border: 2px solid currentColor;
  border-radius: 14px;
  position: relative;
}
.scroll-cue__mouse span {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 4px;
  height: 7px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--cyan);
  animation: wheel 1.8s var(--ease-in-out) infinite;
}
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }
@keyframes fadeIn { to { opacity: 1; } }

/* 3D hero: object sits on the right on wide screens, copy aligns left */
body[data-hero="wireframe3d"] .hero__veil {
  background:
    radial-gradient(45% 45% at 50% 50%, rgba(6, 8, 15, 0.5), rgba(6, 8, 15, 0) 100%),
    linear-gradient(to bottom, rgba(6, 8, 15, 0) 70%, var(--bg) 100%);
}
@media (min-width: 900px) {
  body[data-hero="wireframe3d"] .hero__content { align-items: flex-start; text-align: left; }
  body[data-hero="wireframe3d"] .hero__cta { justify-content: flex-start; }
  body[data-hero="wireframe3d"] .hero__title { max-width: 12ch; }
  body[data-hero="wireframe3d"] .hero__tagline { max-width: 520px; }
  body[data-hero="wireframe3d"] .hero__veil {
    background:
      linear-gradient(90deg, rgba(6, 8, 15, 0.6) 0%, rgba(6, 8, 15, 0.2) 45%, rgba(6, 8, 15, 0) 65%),
      linear-gradient(to bottom, rgba(6, 8, 15, 0) 70%, var(--bg) 100%);
  }
}

/* 8. Sections ----------------------------------------------------------- */
.section { position: relative; padding: clamp(80px, 12vw, 140px) 0; scroll-margin-top: 64px; }
.section__head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 64px); }
.section__index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin-bottom: 14px;
}
.section__title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  position: relative;
  display: inline-block;
}
.section__title::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin-top: 18px;
  border-radius: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s var(--ease-out) 0.25s;
}
.is-visible .section__title::after { transform: scaleX(1); }
.section__lead { color: var(--muted); font-size: 1.05rem; margin-top: 22px; max-width: 620px; }

/* 9. About -------------------------------------------------------------- */
.about { background: var(--bg); }
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.about__figure { position: relative; margin: 0; }
.about__frame {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 3px;
  background: conic-gradient(from var(--angle, 0deg), var(--cyan), var(--violet), var(--pink), var(--cyan));
  animation: spin 8s linear infinite;
  overflow: hidden;
}
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --angle: 360deg; } }
.about__img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  border-radius: calc(var(--radius-lg) - 3px);
  background: var(--surface);
  filter: saturate(0.9) contrast(1.05);
}
.about__scan {
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  height: 22%;
  border-radius: calc(var(--radius-lg) - 3px);
  background: linear-gradient(to bottom, rgba(34, 211, 238, 0) 0%, rgba(34, 211, 238, 0.22) 50%, rgba(34, 211, 238, 0) 100%);
  border-bottom: 1px solid rgba(34, 211, 238, 0.6);
  animation: scan 4.5s var(--ease-in-out) infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}
@keyframes scan { 0% { transform: translateY(-110%); } 50% { transform: translateY(360%); } 100% { transform: translateY(-110%); } }
.about__caption { margin-top: 16px; color: var(--dim); }
.about__body { min-width: 0; }

/* Markdown file viewer */
.mdv {
  --mdv-bg: #0b1020;
  --mdv-bar: #0e1527;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--mdv-bg);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.mdv__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--mdv-bar);
  border-bottom: 1px solid var(--border);
}
.mdv__dots { display: flex; gap: 6px; flex: none; }
.mdv__dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a4560; }
.mdv__dots i:nth-child(1) { background: #ff5f57; }
.mdv__dots i:nth-child(2) { background: #febc2e; }
.mdv__dots i:nth-child(3) { background: #28c840; }
.mdv__tabs { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.mdv__tabs::-webkit-scrollbar { display: none; }
.mdv__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--dim);
  white-space: nowrap;
  transition: color 0.3s, background 0.3s;
}
.mdv__tab:hover { color: var(--text); background: rgba(148, 163, 184, 0.06); }
.mdv__tab.is-active { color: var(--text); background: var(--mdv-bg); box-shadow: inset 0 0 0 1px var(--border); }
.mdv__tab.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad);
}
.mdv__file-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--cyan); flex: none; }
/* min-height keeps both tabs (and therefore the photo beside them) the same height */
.mdv__body { position: relative; padding: 28px 30px 24px; min-height: 500px; }
.mdv__panel { outline: none; }
.mdv__panel.is-entering > * { animation: mdIn 0.5s var(--ease-out) both; }
@keyframes mdIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mdv__status {
  display: flex;
  gap: 18px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--mdv-bar);
  color: var(--dim);
  font-size: 0.72rem;
}
.mdv__status span:last-child { margin-left: auto; }

/* rendered markdown */
.md { color: var(--muted); font-size: 0.97rem; line-height: 1.7; }
.md > * + * { margin-top: 14px; }
.md h1, .md h2, .md h3 { color: var(--text); letter-spacing: -0.02em; }
.md h1 { font-size: 1.8rem; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.md h2 { font-size: 1.15rem; margin-top: 26px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.md h2::before { content: "## "; color: var(--violet); font-family: var(--font-mono); font-weight: 500; font-size: 0.9em; }
.md h3 { font-size: 1rem; }
.md p { text-wrap: pretty; }
.md blockquote {
  margin: 0;
  padding: 6px 18px;
  border-left: 3px solid var(--cyan);
  color: var(--text);
  font-style: italic;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.08), transparent 70%);
  border-radius: 0 10px 10px 0;
}
.md blockquote p { font-style: inherit; }
.md hr { border: 0; height: 1px; background: var(--border); margin: 22px 0; }
.md ul { padding-left: 4px; display: grid; gap: 8px; }
.md li { position: relative; padding-left: 22px; }
.md li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.65em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad);
}
.md strong { color: var(--text); font-weight: 600; }
.md em { color: var(--dim); }
.md a { color: var(--cyan); border-bottom: 1px solid rgba(34, 211, 238, 0.35); transition: border-color 0.3s; }
.md a:hover { border-color: var(--cyan); }
.md code {
  display: inline-block;
  margin: 3px 4px 3px 0;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.3;
  transition: transform 0.35s var(--ease-out), border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.md code:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(34, 211, 238, 0.08);
  box-shadow: 0 8px 20px -10px rgba(34, 211, 238, 0.6);
}
.md li code, .md p code:only-child { margin: 0 4px 0 0; }
.md h1 + blockquote, .md h1 + p { margin-top: 18px; }

/* 10. Projects ---------------------------------------------------------- */
.projects {
  background:
    radial-gradient(50% 40% at 100% 0%, rgba(139, 92, 246, 0.1), transparent 70%),
    var(--bg-2);
}
.bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(19, 27, 48, 0.8), rgba(14, 20, 36, 0.9));
  overflow: hidden;
  transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
  transition: transform 0.5s var(--ease-out), border-color 0.4s, box-shadow 0.5s;
  transform-style: preserve-3d;
}
.card::before {
  /* gradient border that fades in on hover */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(240px circle at var(--mx) var(--my), rgba(34, 211, 238, 0.9), rgba(139, 92, 246, 0.4) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(34, 211, 238, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), var(--shadow-glow); }
.card:hover::before, .card:hover .card__glow { opacity: 1; }
.card--feature, .card--wide { grid-column: span 2; }
.card--feature .card__title { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.card--feature .card__text { max-width: 60ch; }

.card__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  color: var(--cyan);
  margin-bottom: 6px;
}
.card__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card__tag { color: var(--violet); }
.card__title { font-size: 1.3rem; }
.card__text { color: var(--muted); font-size: 0.97rem; flex: 1; }
.card__stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card__stack li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
}
.card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cyan);
  width: max-content;
}
.card__link .icon { transition: transform 0.3s var(--ease-out); }
.card__link:hover .icon { transform: translate(3px, -3px); }

/* 11. Experience -------------------------------------------------------- */
.experience { background: var(--bg); }
.timeline {
  --progress: 0;
  position: relative;
  max-width: 860px;
  margin-inline: auto;
  padding: 10px 0;
}
.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
}
.timeline::before { background: var(--border); }
.timeline::after {
  background: var(--grad);
  transform-origin: top;
  transform: scaleY(var(--progress));
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
}
.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 56px;
  padding: 22px 0;
}
.timeline__item:nth-child(odd) .timeline__card { grid-column: 1; text-align: right; }
.timeline__item:nth-child(even) .timeline__card { grid-column: 2; }
.timeline__node {
  position: absolute;
  left: 50%;
  top: 38px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--dim);
  z-index: 1;
  transition: border-color 0.5s, box-shadow 0.5s, transform 0.5s var(--ease-out);
}
.timeline__item.is-visible .timeline__node {
  border-color: var(--cyan);
  box-shadow: 0 0 0 5px rgba(34, 211, 238, 0.15), 0 0 20px rgba(34, 211, 238, 0.6);
  transform: scale(1.15);
}
.timeline__item.is-visible .timeline__node::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  animation: ripple 2.4s var(--ease-out) infinite;
}
@keyframes ripple { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(2.6); opacity: 0; } }
.timeline__card {
  padding: 22px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.4s, transform 0.5s var(--ease-out), box-shadow 0.5s;
}
.timeline__card:hover { border-color: rgba(139, 92, 246, 0.5); transform: translateY(-4px); box-shadow: 0 20px 50px -25px rgba(139, 92, 246, 0.6); }
.timeline__date { color: var(--cyan); margin-bottom: 8px; }
.timeline__role { font-size: 1.2rem; margin-bottom: 4px; }
.timeline__org { color: var(--violet); font-weight: 600; font-size: 0.9rem; margin-bottom: 10px; }
.timeline__text { color: var(--muted); font-size: 0.95rem; }

/* 12. Resume ------------------------------------------------------------ */
.resume { background: var(--bg-2); }
.resume__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
.resume__preview {
  position: relative;
  max-height: 560px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.resume__preview img { width: 100%; transition: transform 0.9s var(--ease-out); }
.resume__preview:hover img { transform: scale(1.02); }
.resume__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(10, 15, 29, 0.85) 70%, var(--bg-2) 100%);
  pointer-events: none;
}
.resume__cta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 32px;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}
.resume__cta p { color: var(--muted); font-size: 0.95rem; }

.resume__side { display: grid; gap: 18px; }
.panel {
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.panel__title { font-size: 1.05rem; margin-bottom: 18px; color: var(--cyan); }
.edu { display: grid; gap: 18px; }
.edu li { position: relative; padding-left: 18px; }
.edu li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--grad);
}
.edu__date { color: var(--dim); margin-bottom: 4px; }
.edu__title { font-size: 1rem; margin-bottom: 4px; }
.edu__org { color: var(--muted); font-size: 0.9rem; }
.certs { display: grid; gap: 14px; margin-bottom: 18px; }
.certs li { display: flex; align-items: center; gap: 14px; }
.certs__badge {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--grad-soft);
  border: 1px solid var(--border);
  color: var(--lime);
  flex: none;
}
.certs__badge svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.certs li div { display: flex; flex-direction: column; }
.certs li strong { font-weight: 600; }
.certs li .mono { color: var(--dim); }

/* 13. Contact ----------------------------------------------------------- */
.contact { background: var(--bg); padding-bottom: clamp(60px, 8vw, 100px); }
.contact__card {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(48px, 8vw, 96px) clamp(24px, 6vw, 80px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(19, 27, 48, 0.9), rgba(10, 15, 29, 0.95));
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact__orb {
  position: absolute;
  top: -40%;
  left: 50%;
  width: 70vw;
  max-width: 900px;
  aspect-ratio: 1;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.28), transparent 45%),
    radial-gradient(circle at 60% 40%, rgba(139, 92, 246, 0.35), transparent 50%);
  filter: blur(40px);
  animation: orb 12s var(--ease-in-out) infinite alternate;
  pointer-events: none;
}
@keyframes orb { to { transform: translateX(-50%) translateY(8%) scale(1.12); } }
.contact__title { font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: 18px; position: relative; }
.contact__lead { color: var(--muted); max-width: 540px; margin-bottom: 36px; position: relative; }
.contact__email {
  position: relative;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  max-width: 100%;
}
.contact__mail {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.6vw, 1.3rem);
  padding: 14px 22px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(6, 8, 15, 0.6);
  color: var(--text);
  transition: border-color 0.3s, box-shadow 0.3s;
  overflow-wrap: anywhere;
}
.contact__mail:hover { border-color: var(--cyan); box-shadow: var(--shadow-glow); }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.3s, border-color 0.3s, transform 0.3s var(--ease-out);
}
.copy-btn:hover { color: var(--text); border-color: rgba(34, 211, 238, 0.5); transform: translateY(-2px); }
.copy-btn.is-copied { color: var(--lime); border-color: rgba(163, 230, 53, 0.5); }
.contact .socials { position: relative; justify-content: center; }

/* 14. Footer ------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--dim); font-size: 0.9rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.site-footer a { color: var(--muted); transition: color 0.3s; }
.site-footer a:hover { color: var(--cyan); }

/* 15. Toast / switcher -------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1500;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(163, 230, 53, 0.4);
  background: rgba(10, 15, 29, 0.92);
  color: var(--text);
  font-size: 0.9rem;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--ease-out), opacity 0.4s;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* 16. Motion & responsive ---------------------------------------------- */
@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--feature, .card--wide { grid-column: auto; }
}

@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__figure { max-width: 380px; }
  .about__img { aspect-ratio: 6 / 7; height: auto; min-height: 0; }
  .mdv__body { padding: 22px 20px 20px; min-height: 0; }
  .resume__grid { grid-template-columns: 1fr; }
  .resume__preview { max-height: 480px; }
}

@media (max-width: 820px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: fixed;
    inset: 0;
    z-index: 940;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 90px var(--gutter) 40px;
    background: rgba(6, 8, 15, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), visibility 0.4s;
  }
  .nav__menu.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__menu li { width: 100%; text-align: center; opacity: 0; transform: translateY(10px); transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); }
  .nav__menu.is-open li { opacity: 1; transform: none; }
  .nav__menu.is-open li:nth-child(1) { transition-delay: 0.05s; }
  .nav__menu.is-open li:nth-child(2) { transition-delay: 0.1s; }
  .nav__menu.is-open li:nth-child(3) { transition-delay: 0.15s; }
  .nav__menu.is-open li:nth-child(4) { transition-delay: 0.2s; }
  .nav__menu.is-open li:nth-child(5) { transition-delay: 0.25s; }
  .nav__menu.is-open li:nth-child(6) { transition-delay: 0.3s; }
  .nav__link { display: block; font-family: var(--font-display); font-size: 1.6rem; padding: 14px; }
  .nav__link::after { display: none; }
  .nav__cta-item { margin: 18px 0 0; }
  .nav__cta-item .btn { font-size: 1rem; padding: 14px 22px; }
  .site-header.is-scrolled { height: var(--nav-h); }
}

@media (max-width: 720px) {
  .bento { grid-template-columns: 1fr; }
  .card { padding: 22px; }

  .timeline::before, .timeline::after { left: 8px; margin-left: 0; }
  .timeline__item { grid-template-columns: 1fr; padding: 16px 0 16px 36px; }
  .timeline__item:nth-child(odd) .timeline__card,
  .timeline__item:nth-child(even) .timeline__card { grid-column: 1; text-align: left; }
  .timeline__node { left: 8px; top: 30px; }

  .hero { padding-bottom: 80px; }
  .hero__cta .btn { width: 100%; justify-content: center; }
  .hero__cta { width: 100%; max-width: 360px; }
  .terminal { font-size: 0.78rem; padding: 10px 14px; }
  .scroll-cue { display: none; }
  .site-footer__inner { flex-direction: column; text-align: center; }
  .mdv__bar { gap: 10px; }
  .mdv__body { padding: 18px 16px; }
  .md h1 { font-size: 1.45rem; }
  .mdv__status span:nth-child(2), .mdv__status span:nth-child(3) { display: none; }
}

@media (max-width: 360px) {
  .nav__brand-text { display: none; }
  .hero__eyebrow { font-size: 0.7rem; }
}

@media (hover: none) {
  .card { transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero__name .char { opacity: 1; transform: none; }
  .scroll-cue { opacity: 1; }
  [data-reveal] { opacity: 1; transform: none; }
}
