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

:root {
  --bg: #030407;
  --panel: rgba(8, 10, 17, 0.78);
  --text: #f4f5f7;
  --muted: #9aa0ae;
  --line: rgba(255, 255, 255, .12);
  --accent: #8b7cff;
  --cyan: #00aef5;
  --gold: #e8b76a;
  --ease: cubic-bezier(.16, .84, .28, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", Arial, sans-serif;
  overflow-x: hidden;
}

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

button {
  font: inherit;
}

/* Subtle film-grain texture — the one aesthetic risk that ties every
   section together without adding visual noise to the content itself. */
.grain {
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.section {
  position: relative;
  width: 100%;
}

@keyframes badgeSwing {

  0%,
  100% {
    transform: rotate(-2.5deg) translateY(0);
  }

  50% {
    transform: rotate(2.5deg) translateY(3px);
  }
}

@media (max-width: 1250px) {
  .id-badge {
    right: 24px;
    transform: scale(.92);
    transform-origin: top right;
  }
}

@media (max-width: 1000px) {
  .id-badge {
    display: none;
  }
}

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  border-bottom: 1px solid transparent;
  background: rgba(3, 4, 7, .42);
  backdrop-filter: blur(18px);
  transition: background .4s var(--ease), border-color .4s var(--ease), height .4s var(--ease);
}

.site-header.is-scrolled {
  height: 76px;
  background: rgba(3, 4, 7, .82);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .08em;
}

.brand span {
  color: var(--cyan);
}

.main-nav {
  display: flex;
  gap: 34px;
}

.main-nav a,
.header-cta {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #b9bec9;
  transition: color .25s ease;
}

.main-nav a {
  position: relative;
  padding-bottom: 4px;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s var(--ease);
}

.main-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.main-nav a:hover,
.header-cta:hover {
  color: white;
}

.header-cta {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 22px;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .3s ease, border-color .3s ease, transform .3s ease;
}

.header-cta:hover {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .28);
}

.header-cta span {
  color: var(--cyan);
  transition: transform .3s var(--ease);
}

.header-cta:hover span {
  transform: translate(2px, -2px);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: white;
  cursor: pointer;
}

.hero {
  min-height: 100vh;
  padding: 150px 7vw 80px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.spline-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: auto;
}

.spline-background iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Covers the free Spline "Built with Spline" badge visually.
   This does not remove Spline branding from the iframe itself. */
.spline-watermark-cover {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 235px;
  height: 78px;
  background: #030407;
  z-index: 10;
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 25% 50%, rgba(73, 61, 160, .12), transparent 35%),
    linear-gradient(90deg, rgba(3, 4, 7, .78) 0%, rgba(3, 4, 7, .22) 50%, rgba(3, 4, 7, .18) 100%);
}

.hero-content,
.hero-side-copy,
.scroll-indicator {
  position: relative;
  z-index: 20;
}

.hero-content {
  width: min(760px, 60vw);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: #d8dbe2;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 22px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(232, 183, 106, .55);
  animation: pulse-dot 2.4s ease-out infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(232, 183, 106, .5);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(232, 183, 106, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(232, 183, 106, 0);
  }
}

.eyebrow {
  color: #858c9b;
  font-size: 11px;
  letter-spacing: .18em;
  font-weight: 600;
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(58px, 7vw, 112px);
  line-height: .94;
  letter-spacing: -.065em;
  font-weight: 800;
  max-width: 900px;
}

.hero h1 span,
.section-heading h2 span,
.contact h2 span {
  color: #8c7cff;
}

.hero-description {
  max-width: 650px;
  margin-top: 36px;
  color: #aeb4c0;
  line-height: 1.8;
  font-size: 16px;
}

.hero-actions,
.contact-actions,
.side-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.button {
  min-height: 52px;
  padding: 0 25px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  transition: transform .25s var(--ease), background .25s ease, color .25s ease, border-color .25s ease;
}

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

.button-light {
  background: #f5f6f8;
  color: #08090b;
}

.button-outline {
  background: rgba(3, 4, 7, .35);
  color: white;
}

.button-outline:hover {
  background: rgba(255, 255, 255, .08);
}

.hero-side-copy {
  position: absolute;
  z-index: 20;
  right: 7vw;
  bottom: 18%;
  width: 285px;
}

.hero-side-copy p {
  color: #b8bec8;
  font-size: 13px;
  line-height: 1.65;
}

.hero-side-copy .button {
  min-height: 48px;
  padding: 0 20px;
}

.round-plus b {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #079bd7;
  font-size: 20px;
}

.scroll-indicator {
  position: absolute;
  right: 2.5vw;
  bottom: 15%;
  writing-mode: vertical-rl;
  color: #737987;
  font-size: 9px;
  letter-spacing: .18em;
}

.scroll-indicator span {
  color: var(--cyan);
  margin-top: 10px;
}

.about,
.projects,
.skills,
.contact {
  padding: 140px 7vw;
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 850px;
  margin-bottom: 70px;
}

.section-heading h2 {
  margin-top: 15px;
  font-size: clamp(48px, 6vw, 88px);
  line-height: .98;
  letter-spacing: -.06em;
}

.section-note {
  color: var(--muted);
  margin-top: 22px;
  line-height: 1.6;
  max-width: 600px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 30px;
}

.about-copy,
.about-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 42px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .01));
  transition: transform .4s var(--ease), border-color .4s ease;
}

.about-copy:hover,
.about-card:hover {
  border-color: rgba(255, 255, 255, .22);
}

.about-copy .lead {
  color: white;
  font-size: 30px;
  line-height: 1.25;
  margin-bottom: 24px;
}

.about-copy>p:not(.lead),
.about-card p {
  color: var(--muted);
  line-height: 1.8;
}

.about-tags,
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 30px;
}

.about-tags span,
.project-stack span {
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 999px;
  color: #c2c6d0;
  font-size: 11px;
  transition: border-color .25s ease, color .25s ease;
}

.about-tags span:hover {
  border-color: rgba(0, 174, 245, .6);
  color: white;
}

.about-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    radial-gradient(circle at 70% 20%, rgba(82, 66, 190, .25), transparent 45%),
    rgba(8, 10, 17, .7);
}

.about-card h3 {
  font-size: 30px;
  margin-bottom: 16px;
}

/* ---------- PROJECT GROUPS (Software / Hardware) ---------- */
.project-group+.project-group {
  margin-top: 64px;
}

.project-group-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #d8dbe2;
  margin-bottom: 26px;
}

.group-index {
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: .1em;
}

.project-group-note {
  margin-top: 22px;
  font-size: 12px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  perspective: 1200px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, .025);
  transform-style: preserve-3d;
  transition: transform .35s var(--ease), border-color .35s ease, box-shadow .35s ease;
}

.project-card:hover {
  transform: translateY(-7px);
  border-color: rgba(139, 124, 255, .55);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
}

.project-visual {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

/* Diamond mark shown while a slot has no media (or media fails to load) */
.project-visual::before {
  content: "";
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255, 255, 255, .4);
  transform: rotate(45deg);
  box-shadow: 0 0 80px rgba(105, 85, 255, .35);
  transition: opacity .3s ease;
}

.project-visual:has(.project-media:not(.media-missing))::before {
  opacity: 0;
}

/* Filmstrip sprocket-hole edges — the "running film" identity for previews */
.film-sprockets {
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  z-index: 4;
  background-image: radial-gradient(circle, rgba(0, 0, 0, .6) 3px, transparent 3.5px);
  background-size: 22px 12px;
  background-position: center;
  background-repeat: repeat-x;
  opacity: .5;
  pointer-events: none;
}

.film-sprockets-top {
  top: 0;
}

.film-sprockets-bottom {
  bottom: 0;
}

/* Shared frame for both <img> and <video> project previews.
   A slow, continuous drift gives the sense of footage rolling; it
   quickens gently on hover rather than jump-cutting. */
.project-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  animation: filmDrift 18s ease-in-out infinite;
}

.project-card:hover .project-media {
  animation: filmDriftHover 6s ease-in-out infinite;
}

@keyframes filmDrift {

  0%,
  100% {
    transform: scale(1.04) translateX(0);
  }

  50% {
    transform: scale(1.08) translateX(-1%);
  }
}

@keyframes filmDriftHover {

  0%,
  100% {
    transform: scale(1.1) translateX(0);
  }

  50% {
    transform: scale(1.16) translateX(-2%);
  }
}

.project-media.media-missing {
  display: none;
}

.project-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, .5), rgba(0, 0, 0, .05) 60%, rgba(0, 0, 0, .14));
}

.media-tag {
  position: relative;
  z-index: 2;
  font-size: 11px;
  letter-spacing: .18em;
  color: #d4d7df;
}

.project-iot {
  background: radial-gradient(circle, #163b56, #05070c 65%);
}

.project-ai {
  background: radial-gradient(circle, #3c255a, #05070c 65%);
}

.project-web {
  background: radial-gradient(circle, #143e43, #05070c 65%);
}

.project-embedded {
  background: radial-gradient(circle, #44362a, #05070c 65%);
}

.project-marketplace {
  background: radial-gradient(circle, #143a3f, #05070c 65%);
}

.project-info {
  padding: 28px;
}

.project-info>p:first-child {
  font-size: 10px;
  letter-spacing: .15em;
  color: #777f8f;
}

.project-info h3 {
  margin: 10px 0;
  font-size: 25px;
}

.project-info>p:not(:first-child) {
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.skills-showcase {
  width: 100%;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  background: rgba(255, 255, 255, .012);
}

.skill-row {
  width: 100%;
  overflow: hidden;
  position: relative;
  padding: 7px 0;
  mask-image: linear-gradient(90deg, transparent, black 5%, black 95%, transparent);
}

.skill-track {
  display: flex;
  width: max-content;
  gap: 14px;
  will-change: transform;
}

.row-left .skill-track {
  animation: moveLeft 28s linear infinite;
}

.row-right .skill-track {
  animation: moveRight 31s linear infinite;
}

.row-third .skill-track {
  animation: moveLeft 34s linear infinite;
}

.skill-row:hover .skill-track {
  animation-play-state: paused;
}

.skill-card {
  width: 170px;
  height: 112px;
  flex: 0 0 170px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(20, 23, 35, .9), rgba(7, 9, 14, .95));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: .3s ease;
}

.skill-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 174, 245, .7);
  box-shadow: 0 18px 50px rgba(0, 174, 245, .09);
}

.skill-card i {
  font-size: 34px;
  line-height: 1;
}

/* Fallback mark for tools without a devicon logo (STM32CubeIDE, KiCad, Cisco, Adobe) */
.skill-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .01em;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
}

.skill-card span {
  font-size: 12px;
  color: #c5c9d3;
  font-weight: 600;
}

.skills-tip {
  color: #707786;
  font-size: 11px;
  text-align: center;
  margin-top: 18px;
  letter-spacing: .08em;
}

@keyframes moveLeft {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

@keyframes moveRight {
  from {
    transform: translateX(-50%);
  }

  to {
    transform: translateX(0);
  }
}

.contact {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(85, 69, 180, .18), transparent 50%);
}

.contact-inner {
  max-width: 900px;
}

.contact h2 {
  font-size: clamp(52px, 7vw, 100px);
  letter-spacing: -.065em;
  line-height: .95;
  margin-top: 18px;
}

.contact-inner>p:not(.eyebrow) {
  max-width: 570px;
  margin: 28px auto 0;
  color: var(--muted);
  line-height: 1.7;
}

.contact-actions {
  justify-content: center;
}

.site-footer {
  min-height: 90px;
  border-top: 1px solid var(--line);
  padding: 0 7vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #747b89;
  font-size: 11px;
  letter-spacing: .08em;
}

.cursor-glow {
  position: fixed;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 200;
  background: radial-gradient(circle, rgba(89, 76, 255, .09), transparent 68%);
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease, transform .8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1000px) {
  .main-nav {
    gap: 18px;
  }

  .hero-content {
    width: 70vw;
  }

  .hero-side-copy {
    display: none;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header {
    height: 74px;
    padding: 0 22px;
  }

  .main-nav,
  .header-cta {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .hero {
    min-height: 850px;
    padding: 120px 24px 60px;
  }

  .hero-overlay {
    background: linear-gradient(90deg, rgba(3, 4, 7, .9), rgba(3, 4, 7, .55));
  }

  .hero-content {
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(52px, 16vw, 82px);
  }

  .hero-description {
    font-size: 14px;
  }

  .spline-watermark-cover {
    width: 180px;
    height: 66px;
  }

  .about,
  .projects,
  .skills,
  .contact {
    padding: 90px 22px;
  }

  .about-copy,
  .about-card {
    padding: 28px;
  }

  .about-copy .lead {
    font-size: 24px;
  }

  .project-visual {
    height: 220px;
  }

  .skill-card {
    width: 145px;
    height: 100px;
    flex-basis: 145px;
  }

  .skill-card i {
    font-size: 29px;
  }

  .site-footer {
    padding: 25px 22px;
    gap: 20px;
    flex-direction: column;
    justify-content: center;
  }

  .cursor-glow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .skill-track {
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .status-dot {
    animation: none;
  }

  .grain {
    display: none;
  }

  .id-badge {
    animation: none;
  }

  .project-media,
  .project-card:hover .project-media {
    animation: none;
  }
}


@media (max-width: 720px) {
  .main-nav.mobile-open {
    display: flex;
    position: fixed;
    top: 74px;
    left: 0;
    right: 0;
    padding: 24px;
    flex-direction: column;
    gap: 20px;
    background: rgba(3, 4, 7, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
  }
}