:root {
  --bg: #050816;
  --bg-soft: #0b1024;
  --text: #f8fbff;
  --muted: #9fb3c8;
  --line: rgba(255, 255, 255, 0.13);
  --glass: rgba(255, 255, 255, 0.075);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --cyan: #5eead4;
  --blue: #38bdf8;
  --purple: #a78bfa;
  --pink: #f472b6;
  --orange: #fb923c;
  --radius: 28px;
  --shadow: 0 30px 120px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(94, 234, 212, 0.18), transparent 36rem),
    radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.16), transparent 32rem),
    radial-gradient(circle at 50% 100%, rgba(244, 114, 182, 0.12), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
  z-index: 0;
}

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

main {
  position: relative;
  z-index: 1;
}

.section-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.particle-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  place-items: center;
  background: #02040d;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader--hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader__orb {
  position: absolute;
  width: min(64vw, 520px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(94, 234, 212, 0.9), transparent 16%),
    radial-gradient(circle at 60% 50%, rgba(167, 139, 250, 0.8), transparent 26%),
    radial-gradient(circle at 40% 75%, rgba(244, 114, 182, 0.7), transparent 24%);
  filter: blur(20px);
  opacity: 0.65;
  animation: preloaderPulse 2.4s ease-in-out infinite alternate;
}

.preloader__content {
  position: relative;
  width: min(520px, calc(100% - 48px));
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(5, 8, 22, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
  text-align: center;
}

.preloader__content h1 {
  margin: 12px 0 22px;
  font-size: clamp(2rem, 7vw, 4.2rem);
  letter-spacing: -0.08em;
}

.loader-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.loader-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--purple), var(--pink));
  transition: width 0.25s ease;
}

.preloader__content p {
  color: var(--muted);
  margin: 18px 0 0;
}

.command-dock {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 20;
  display: flex;
  gap: 8px;
  padding: 8px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 8, 22, 0.62);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.26);
}

.command-dock a {
  padding: 10px 15px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.command-dock a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.hero {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 120px 0 70px;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 42px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 800;
}

.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 24px var(--cyan);
}

.hero h1 {
  margin: 18px 0 20px;
  font-size: clamp(3.3rem, 9vw, 8.4rem);
  line-height: 0.86;
  letter-spacing: -0.095em;
}

.hero h1 span {
  display: block;
  margin-top: 24px;
  max-width: 780px;
  font-size: clamp(1.1rem, 2.6vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.055em;
  color: rgba(248, 251, 255, 0.72);
}

.hero p,
.section-heading p,
.contact-card p,
.timeline-item p,
.project-card span,
.principle-card p {
  color: var(--muted);
  line-height: 1.7;
}

.hero__copy > p {
  max-width: 700px;
  font-size: 1.05rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.button:hover {
  transform: translateY(-3px);
}

.button--primary {
  color: #041018;
  background: linear-gradient(135deg, var(--cyan), var(--blue), var(--purple));
  box-shadow: 0 16px 42px rgba(56, 189, 248, 0.25);
}

.button--ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
}

.hero-orbit {
  display: grid;
  place-items: center;
}

.orbital-card {
  position: relative;
  width: min(420px, 90vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 44px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transform-style: preserve-3d;
  animation: float 5.5s ease-in-out infinite;
}

.orbital-card::before,
.orbital-card::after {
  content: "";
  position: absolute;
  inset: 32px;
  border-radius: 50%;
  border: 1px dashed rgba(94, 234, 212, 0.28);
  animation: rotate 16s linear infinite;
}

.orbital-card::after {
  inset: 74px;
  border-color: rgba(167, 139, 250, 0.35);
  animation-duration: 10s;
  animation-direction: reverse;
}

.orbital-card__ring {
  position: absolute;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--cyan), transparent, var(--purple), transparent, var(--pink), var(--cyan));
  filter: blur(0.5px);
  animation: rotate 9s linear infinite;
}

.orbital-card__core {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  place-items: center;
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), rgba(5, 8, 22, 0.82));
  border: 1px solid var(--line);
  text-align: center;
  box-shadow: inset 0 0 60px rgba(94, 234, 212, 0.1), 0 30px 80px rgba(0, 0, 0, 0.32);
}

.orbital-card__core span {
  color: var(--cyan);
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 900;
}

.orbital-card__core strong {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  letter-spacing: -0.06em;
}

.orbital-card__core small {
  color: var(--muted);
}

.node {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  color: var(--text);
  font-style: normal;
  font-weight: 900;
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.node--one { top: 54px; right: 56px; animation: drift 4s ease-in-out infinite; }
.node--two { left: 38px; bottom: 74px; animation: drift 4.7s ease-in-out infinite reverse; }
.node--three { right: 70px; bottom: 40px; animation: drift 5.2s ease-in-out infinite; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 52px;
}

.stat-card,
.principle-card,
.project-card,
.contact-card,
.timeline-item {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.045));
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.stat-card {
  padding: 24px;
  border-radius: 24px;
}

.stat-card strong {
  display: block;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  letter-spacing: -0.07em;
}

.stat-card span {
  color: var(--muted);
}

.marquee-section {
  padding: 26px 0 92px;
}

.marquee {
  display: flex;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.marquee div {
  display: flex;
  min-width: 100%;
  gap: 12px;
  padding-right: 12px;
  animation: marquee 18s linear infinite;
}

.marquee span {
  flex: 0 0 auto;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 251, 255, 0.78);
  font-weight: 800;
}

.projects-section,
.stack-section,
.timeline-section,
.contact-section {
  padding: 92px 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 34px;
}

.section-heading--center {
  margin-inline: auto;
  text-align: center;
}

.section-heading--center .eyebrow {
  margin-inline: auto;
}

.section-heading h2,
.contact-card h2 {
  margin: 16px 0;
  font-size: clamp(2rem, 6vw, 4.7rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.project-card {
  position: relative;
  isolation: isolate;
  min-height: 320px;
  padding: 26px;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.project-card:hover {
  transform: translateY(-10px) rotateX(2deg) rotateY(-2deg);
  border-color: rgba(94, 234, 212, 0.42);
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.12), rgba(255, 255, 255, 0.045));
}

.project-card__shine {
  position: absolute;
  inset: -45% auto auto -30%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.22), transparent 68%);
  z-index: -1;
  transition: transform 0.35s ease;
}

.project-card:hover .project-card__shine {
  transform: translate(40%, 32%);
}

.project-card__index {
  position: absolute;
  top: 22px;
  right: 24px;
  color: rgba(255, 255, 255, 0.18);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.09em;
}

.project-card p {
  width: fit-content;
  margin: 0 0 48px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
}

.project-card h3 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  letter-spacing: -0.07em;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tag-row small,
.stack-cloud span,
.contact-strip span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 251, 255, 0.76);
}

.tag-row small {
  padding: 8px 10px;
}

.stack-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 34px;
}

.stack-cloud span {
  padding: 14px 20px;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  transition: transform 0.25s ease, background 0.25s ease;
}

.stack-cloud span:hover {
  transform: translateY(-5px) scale(1.03);
  background: rgba(94, 234, 212, 0.12);
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.principle-card {
  padding: 24px;
  border-radius: 24px;
}

.principle-card strong {
  color: var(--cyan);
}

.timeline {
  position: relative;
  display: grid;
  gap: 18px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 31px;
  width: 1px;
  background: linear-gradient(var(--cyan), var(--purple), transparent);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  padding: 20px;
  border-radius: 28px;
}

.timeline-item > span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 20px;
  background: #07111f;
  border: 1px solid rgba(94, 234, 212, 0.38);
  color: var(--cyan);
  font-weight: 900;
}

.timeline-item h3 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.timeline-item p {
  margin: 0;
}

.contact-section {
  padding-bottom: 130px;
}

.contact-card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 6vw, 70px);
  border-radius: 38px;
  text-align: center;
}

.contact-card::before {
  content: "";
  position: absolute;
  inset: -40% 10% auto;
  height: 120%;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.18), transparent 58%);
  pointer-events: none;
}

.contact-card .eyebrow {
  margin-inline: auto;
}

.contact-card p {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}

.contact-strip {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.contact-strip span {
  padding: 10px 14px;
  font-weight: 900;
}

.reveal {
  opacity: 0;
  transform: translateY(42px) scale(0.98);
  filter: blur(12px);
  transition: opacity 0.85s ease, transform 0.85s ease, filter 0.85s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

@keyframes preloaderPulse {
  from { transform: scale(0.9) rotate(0deg); }
  to { transform: scale(1.08) rotate(18deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotateX(0deg) rotateY(0deg); }
  50% { transform: translateY(-18px) rotateX(4deg) rotateY(-5deg); }
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(10px, -14px, 0); }
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

@keyframes marquee {
  to { transform: translateX(-100%); }
}

@media (max-width: 980px) {
  .hero__grid,
  .project-grid,
  .principle-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero__copy {
    grid-column: 1 / -1;
  }

  .hero-orbit {
    grid-column: 1 / -1;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .section-shell {
    width: min(100% - 22px, 1180px);
  }

  .command-dock {
    top: auto;
    bottom: 14px;
    width: calc(100% - 22px);
    justify-content: space-between;
  }

  .command-dock a {
    padding: 10px 11px;
    font-size: 0.78rem;
  }

  .hero {
    padding-top: 82px;
  }

  .hero__grid,
  .project-grid,
  .principle-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(3.15rem, 18vw, 5.4rem);
  }

  .hero__actions .button {
    width: 100%;
  }

  .orbital-card {
    border-radius: 34px;
  }

  .projects-section,
  .stack-section,
  .timeline-section,
  .contact-section {
    padding: 70px 0;
  }

  .timeline::before {
    left: 23px;
  }

  .timeline-item {
    grid-template-columns: 46px 1fr;
    gap: 14px;
    padding: 16px;
  }

  .timeline-item > span {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    font-size: 0.8rem;
  }

  .preloader__content {
    padding: 24px;
  }
}

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