:root {
  --bg-base: #000000;
  --bg-surface: #0a0a0a;
  --bg-glass: rgba(10, 10, 10, 0.4);

  --text-primary: #ffffff;
  --text-secondary: #a1a1a6;
  --text-dim: #6e6e73;

  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.2);

  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  --font-sans: "Inter Tight", sans-serif;
  --font-display: "Syne", sans-serif;

  --container-max: 1200px;
  --section-pad: clamp(8rem, 15vw, 12rem);
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg-base);
}

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

/* Overlays */
.noise-overlay {
  position: fixed;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
  z-index: 9999;
}

.spotlight {
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
}

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

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  transition: all 0.4s ease;
}

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

/* Header */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition:
    background 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
header.scrolled {
  background: rgba(0, 0, 0, 0.72);
  border-bottom-color: var(--border);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4.5rem;
  transition: height 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
header.scrolled nav {
  height: 3.6rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  color: white;
}
.logo span {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 4px;
}
.nav-links a:hover,
.nav-links a.active {
  color: white;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-links a.active::after {
  width: 100%;
}

/* Language Switch */
.lang-switch-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
}
.lang-switch {
  width: 36px;
  height: 18px;
  background: #111;
  border: 1px solid var(--border);
  border-radius: 99px;
  position: relative;
  cursor: pointer;
}
.switch-dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--text-dim);
  border-radius: 50%;
  transition: 0.3s ease;
}
.lang-switch.active .switch-dot {
  left: calc(100% - 14px);
  background: var(--accent);
}

.nav-cta {
  background: white;
  color: black;
  padding: 0.5rem 1.2rem;
  border-radius: 99px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-cta:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* Titles Architecture */
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 2rem;
}

.section-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* Hero */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 6rem;
}
.status-pill {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}
.dim {
  color: var(--text-dim);
}
.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin-bottom: 3rem;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 5rem;
}
.btn {
  padding: 0.8rem 2.2rem;
  border-radius: 99px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-block;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s ease,
    border-color 0.3s ease,
    background 0.3s ease;
  will-change: transform;
}
.btn.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 20px var(--accent-glow);
}
.btn.primary:hover {
  box-shadow: 0 16px 36px rgba(59, 130, 246, 0.35);
}
.btn.secondary {
  border: 1px solid var(--border);
  color: white;
}
.btn.secondary:hover {
  border-color: var(--accent);
}
@media (hover: none) {
  .btn:active {
    transform: scale(0.97);
  }
}

.hero-counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.counter-card {
  padding: 2.5rem 1.5rem;
  border-radius: 32px;
  text-align: center;
}
.num-wrap {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.suffix {
  color: var(--accent);
  font-size: 1.5rem;
  vertical-align: super;
}
.counter-card label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4rem;
  align-items: center;
}
.premium-frame {
  aspect-ratio: 4/5;
  border-radius: 40px;
  overflow: hidden;
  position: relative;
}
.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-weight: 800;
  font-family: var(--font-display);
}
.about-text p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Stack */
#stack {
  background: #050505;
}
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.stack-item {
  padding: 2rem 1.5rem;
  border-radius: 24px;
  text-align: center;
  transition: 0.3s ease;
}
.stack-item i,
.stack-item svg {
  font-size: 3rem;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  display: block;
}
.stack-item span {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.stack-item:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
}

/* Timeline */
.timeline-track {
  position: relative;
  padding-left: 2rem;
}
.timeline-track::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
/* Scroll-drawn progress line */
.timeline-track::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: var(--tl-progress, 0%);
  background: linear-gradient(
    to bottom,
    rgba(59, 130, 246, 0.25),
    var(--accent)
  );
  box-shadow: 0 0 12px var(--accent-glow);
}
.timeline-item {
  position: relative;
  padding-bottom: 4rem;
}
.time-dot {
  position: absolute;
  left: -2.35rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  background: var(--text-dim);
  border-radius: 50%;
  box-shadow: none;
  transition:
    background 0.6s ease,
    box-shadow 0.6s ease,
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.timeline-item.lit .time-dot {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transform: scale(1.25);
}
.time-year {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.time-content h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.time-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 800px;
}

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}
.project-card {
  border-radius: 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.project-image {
  height: 220px;
  background: #111;
}
.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.project-content {
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.project-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.project-tags span {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-dim);
}
.project-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
}
.project-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  flex: 1;
}
.project-link {
  text-decoration: none;
  color: white;
  font-weight: 800;
  font-size: 0.85rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 3px;
  align-self: flex-start;
  transition: 0.3s ease;
}
.project-link:hover {
  color: var(--accent);
}

/* Contact */
.contact-box {
  padding: 5rem 2rem;
  border-radius: 50px;
  text-align: center;
}
.contact-links {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  margin-top: 3rem;
}
.contact-links a {
  text-decoration: none;
  color: white;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  transition: 0.3s ease;
}
.contact-links a:hover {
  opacity: 0.5;
}
.accent-link {
  color: var(--accent) !important;
}

footer {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
}

/* Timeline Enriched Styles */
.time-location {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.time-details {
  margin-top: 1rem;
}
.timeline-bullets {
  list-style: none;
  margin-top: 1rem;
  padding-left: 0.5rem;
}
.timeline-bullets li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}
.timeline-bullets li::before {
  content: "◈";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8rem;
  top: 0.2rem;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(10%) contrast(1.1);
  transition: transform 0.5s ease;
}
.premium-frame:hover .profile-img {
  transform: scale(1.05);
}

.pj-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.project-card:hover .pj-img {
  transform: scale(1.08);
}

.reveal {
  visibility: hidden;
}
.reveal.sr-finished {
  visibility: visible;
}

/* ================================================================
   HIGHLIGHT BOX (missing base style)
================================================================ */
.highlight-box {
  border-left: 2px solid var(--accent);
  padding: 1rem 1.4rem;
  margin: 1.5rem 0;
  background: rgba(59, 130, 246, 0.06);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ================================================================
   MOBILE MENU — Hamburger
================================================================ */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 1100;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text-primary);
  border-radius: 2px;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease;
  transform-origin: center;
}
.nav-burger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-burger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-burger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile drawer */
.nav-drawer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1050;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-drawer.open {
  display: flex;
  opacity: 1;
}
.nav-drawer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}
.nav-drawer ul li a {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.6rem 1.5rem;
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.4s ease,
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.2s ease;
}
.nav-drawer.open ul li:nth-child(1) a {
  opacity: 1;
  transform: none;
  transition-delay: 0.05s;
}
.nav-drawer.open ul li:nth-child(2) a {
  opacity: 1;
  transform: none;
  transition-delay: 0.1s;
}
.nav-drawer.open ul li:nth-child(3) a {
  opacity: 1;
  transform: none;
  transition-delay: 0.15s;
}
.nav-drawer.open ul li:nth-child(4) a {
  opacity: 1;
  transform: none;
  transition-delay: 0.2s;
}
.nav-drawer ul li a:hover {
  color: var(--accent);
}

.nav-drawer-cta {
  margin-top: 2.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.4s ease 0.25s,
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}
.nav-drawer.open .nav-drawer-cta {
  opacity: 1;
  transform: none;
}
.nav-drawer-cta a {
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 2.5rem;
  border-radius: 99px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
}

.nav-drawer-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.nav-drawer-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ================================================================
   TABLET — ≤ 1024px
================================================================ */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .about-visual {
    display: flex;
    justify-content: center;
  }
  .premium-frame {
    max-width: 320px;
    width: 100%;
    margin: 0 auto;
  }
  .stack-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

/* ================================================================
   MOBILE — ≤ 768px
================================================================ */
@media (max-width: 768px) {
  /* ── Nav ── */
  .nav-links,
  .lang-switch-wrap,
  .nav-cta {
    display: none !important;
  }
  .nav-burger {
    display: flex;
  }

  /* ── Container padding ── */
  .container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* ── Hero ── */
  #hero {
    padding-top: 5rem;
    min-height: 100svh;
  }
  #hero .container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
  }
  .hero-title {
    font-size: clamp(2.2rem, 9vw, 3rem);
    line-height: 1.1;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  .hero-actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 0.95rem 1.5rem;
    font-size: 0.95rem;
  }

  /* Counters: 3 side-by-side, compact */
  .hero-counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
  .counter-card {
    padding: 1.4rem 0.75rem;
    border-radius: 20px;
  }
  .num-wrap {
    font-size: 2.2rem;
  }
  .suffix {
    font-size: 1rem;
  }
  .counter-card label {
    font-size: 0.6rem;
    letter-spacing: 0.06em;
  }

  /* ── Section titles ── */
  .section-title {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
    line-height: 1.15;
  }
  .section-label {
    font-size: 0.65rem;
  }

  /* ── About ── */
  #about .container {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .premium-frame {
    max-width: 240px;
    border-radius: 28px;
    aspect-ratio: 4/5;
  }
  .about-text p {
    font-size: 1rem;
  }
  .highlight-box {
    font-size: 0.88rem;
  }

  /* ── Stack ── */
  #stack .container {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
  .stack-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
  .stack-item {
    padding: 1.2rem 0.5rem;
    border-radius: 16px;
  }
  .stack-item i,
  .stack-item svg {
    font-size: 2rem;
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.6rem;
  }
  .stack-item span {
    font-size: 0.7rem;
    line-height: 1.3;
    display: block;
  }

  /* ── Timeline ── */
  #timeline .container {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
  .timeline-track {
    padding-left: 1.5rem;
  }
  .time-dot {
    left: -1.85rem;
    width: 9px;
    height: 9px;
  }
  .time-content h3 {
    font-size: 1.1rem;
    line-height: 1.3;
  }
  .time-content p,
  .timeline-bullets li {
    font-size: 0.88rem;
  }
  .timeline-item {
    padding-bottom: 2.5rem;
  }

  /* ── Projects ── */
  #projects .container {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
  .project-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .project-card {
    border-radius: 20px;
  }
  .project-image {
    height: 180px;
  }
  .project-content {
    padding: 1.4rem;
  }
  .project-content h3 {
    font-size: 1.2rem;
  }
  .project-content p {
    font-size: 0.88rem;
  }

  /* ── Contact ── */
  #contact .container {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }
  .contact-box {
    padding: 3rem 1.5rem;
    border-radius: 28px;
  }
  .contact-links {
    gap: 1.5rem 2.5rem;
    margin-top: 2rem;
  }
  .contact-links a {
    font-size: 1.3rem;
  }

  /* ── Footer ── */
  footer {
    padding: 2.5rem 0;
    font-size: 0.8rem;
  }
}

/* ================================================================
   SMALL MOBILE — ≤ 430px
================================================================ */
@media (max-width: 430px) {
  .hero-title {
    font-size: 2.1rem;
  }
  /* 2-column stack grid on very small screens */
  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* Counters: full width stacked on tiny phones */
  .hero-counters {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  .num-wrap {
    font-size: 1.9rem;
  }
  .contact-links a {
    font-size: 1.1rem;
  }
}

/* ================================================================
   SCROLL PROGRESS BAR
================================================================ */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 2000;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ================================================================
   BACK TO TOP BUTTON
================================================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

/* ================================================================
   PROJECT ACTIONS
================================================================ */
.project-actions {
  display: flex;
  gap: 1rem;
}

/* ================================================================
   FOCUS VISIBLE — keyboard accessibility
================================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ================================================================
   SPOTLIGHT — disable on touch devices
================================================================ */
@media (hover: none) {
  .spotlight {
    display: none;
  }
}

/* ================================================================
   APPLE-GRADE MOTION LAYER
================================================================ */

/* ── Hero ambient orbs ── */
#hero {
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
#hero .container {
  position: relative;
  z-index: 1;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  will-change: transform;
}
.orb-1 {
  width: 480px;
  height: 480px;
  top: -10%;
  right: -8%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.45), transparent 70%);
  animation: orbDrift 22s ease-in-out infinite alternate;
}
.orb-2 {
  width: 360px;
  height: 360px;
  bottom: 5%;
  left: -10%;
  background: radial-gradient(circle, rgba(34, 100, 220, 0.35), transparent 70%);
  animation: orbDrift 28s ease-in-out infinite alternate-reverse;
}
.orb-3 {
  width: 260px;
  height: 260px;
  top: 40%;
  left: 45%;
  background: radial-gradient(circle, rgba(120, 170, 255, 0.18), transparent 70%);
  animation: orbDrift 34s ease-in-out infinite alternate;
}
@keyframes orbDrift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-60px, 50px) scale(1.12);
  }
  100% {
    transform: translate(50px, -40px) scale(0.94);
  }
}

/* ── Hero title: word-by-word blur-up reveal ── */
.hero-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(46px);
  filter: blur(10px);
  animation: wordIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(0.3s + var(--i, 0) * 0.09s);
  will-change: transform, filter;
}
@keyframes wordIn {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Shimmer on the accent name */
.hero-title .accent,
.hero-title .accent .word {
  background: linear-gradient(
    110deg,
    #3b82f6 25%,
    #9ec5ff 42%,
    #3b82f6 60%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* ── Hero parallax target ── */
.hero-inner {
  will-change: transform, opacity;
}

/* ── Scroll cue (Apple-style mouse) ── */
.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 1.5px solid var(--border-hover);
  border-radius: 99px;
  z-index: 1;
  opacity: 0;
  animation: cueFade 1s ease 2.2s forwards;
  transition: opacity 0.4s ease;
}
.scroll-cue.hidden {
  opacity: 0 !important;
  pointer-events: none;
}
.scroll-cue-wheel {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 3px;
  height: 8px;
  margin-left: -1.5px;
  border-radius: 99px;
  background: var(--text-secondary);
  animation: cueScroll 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes cueFade {
  to {
    opacity: 0.7;
  }
}
@keyframes cueScroll {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  70% {
    transform: translateY(12px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 0;
  }
}

/* ── Mouse-tracking glow on glass cards ── */
.glass {
  position: relative;
}
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--mx, 50%) var(--my, 50%),
    rgba(120, 170, 255, 0.08),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
  z-index: 2;
}
.glass:hover::after {
  opacity: 1;
}
.glass:hover {
  border-color: var(--border-hover);
}
.stack-item:hover {
  border-color: var(--accent);
}

/* ── 3D tilt on project cards ── */
.project-card {
  transition:
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.5s ease,
    border-color 0.4s ease;
  will-change: transform;
}
.project-card:hover {
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55);
}

/* ── Stack items: icon lift ── */
.stack-item i,
.stack-item svg {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.stack-item:hover i,
.stack-item:hover svg {
  transform: translateY(-4px) scale(1.12);
}

/* ── Nav CTA: smooth magnetic transition ── */
.nav-cta {
  will-change: transform;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease;
}

/* ── Contact links: underline grow instead of plain fade ── */
.contact-links a {
  position: relative;
}
.contact-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.contact-links a:hover {
  opacity: 1;
  color: var(--accent);
}
.contact-links a:hover::after {
  transform: scaleX(1);
}

/* ── Mobile adjustments for motion layer ── */
@media (max-width: 768px) {
  .scroll-cue {
    display: none;
  }
  .orb {
    filter: blur(60px);
    opacity: 0.25;
  }
  .orb-1 {
    width: 300px;
    height: 300px;
  }
  .orb-2 {
    width: 240px;
    height: 240px;
  }
  .orb-3 {
    display: none;
  }
}

/* ── Reduced motion: respect the user ── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-title .word {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
  .hero-title .accent {
    animation: none;
  }
  .orb,
  .scroll-cue,
  .scroll-cue-wheel {
    animation: none;
  }
  .scroll-cue {
    opacity: 0.5;
  }
  .glass::after {
    display: none;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
