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

:root {
  --bg:          #0d0f14;
  --surface:     #161a23;
  --surface2:    #1e2330;
  --border:      #2a3045;
  --text:        #6588b5;
  --text-muted:  #8892a4;
  --accent:      #4641b6;
  --accent2:     #ff6584;
  --accent3:     #43e97b;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,.45);
  --trans:       0.35s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
  --mx: 50vw;
  --my: 50vh;
}

.starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.starfield::before,
.starfield::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  opacity: 0.35;
}

.starfield::before {
  background-image:
    radial-gradient(circle at 10% 22%, rgba(255, 255, 255, 0.65) 0 1.4px, transparent 2.3px),
    radial-gradient(circle at 24% 34%, rgba(220, 228, 255, 0.5) 0 1.2px, transparent 2.1px),
    radial-gradient(circle at 39% 18%, rgba(255, 255, 255, 0.58) 0 1.5px, transparent 2.4px),
    radial-gradient(circle at 56% 29%, rgba(230, 235, 255, 0.48) 0 1.2px, transparent 2.1px),
    radial-gradient(circle at 73% 20%, rgba(255, 255, 255, 0.6) 0 1.4px, transparent 2.3px),
    radial-gradient(circle at 90% 32%, rgba(220, 230, 255, 0.5) 0 1.2px, transparent 2.1px);
}

.starfield::after {
  background-image:
    radial-gradient(circle at 14% 68%, rgba(255, 255, 255, 0.45) 0 1.2px, transparent 2.1px),
    radial-gradient(circle at 33% 58%, rgba(190, 204, 255, 0.38) 0 1.1px, transparent 2px),
    radial-gradient(circle at 52% 74%, rgba(255, 255, 255, 0.45) 0 1.2px, transparent 2.1px),
    radial-gradient(circle at 69% 62%, rgba(190, 204, 255, 0.36) 0 1px, transparent 1.9px),
    radial-gradient(circle at 86% 72%, rgba(255, 255, 255, 0.42) 0 1.1px, transparent 2px);
  opacity: 0.28;
  animation: star-twinkle 5s ease-in-out infinite alternate;
}

@keyframes star-twinkle {
  from { opacity: 0.22; }
  to   { opacity: 0.34; }
}

.mouse-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    360px circle at var(--mx) var(--my),
    rgba(108, 99, 255, 0.14),
    rgba(108, 99, 255, 0.06) 32%,
    transparent 72%
  );
  transition: opacity .3s ease;
}

.cursor-ring,
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translate3d(-100px, -100px, 0);
  transition: opacity .2s ease, width .2s ease, height .2s ease, border-color .2s ease, background .2s ease;
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(142, 134, 255, 0.8);
  background: rgba(108, 99, 255, 0.08);
}

.cursor-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(189, 183, 255, 0.95);
  box-shadow: 0 0 12px rgba(108, 99, 255, 0.65);
  --dot-scale: 1;
}

.custom-cursor-enabled,
.custom-cursor-enabled a,
.custom-cursor-enabled button,
.custom-cursor-enabled .btn,
.custom-cursor-enabled .tab-btn {
  cursor: none !important;
}

.custom-cursor-enabled .cursor-ring,
.custom-cursor-enabled .cursor-dot {
  opacity: 1;
}

.custom-cursor-enabled.cursor-hover .cursor-ring {
  width: 46px;
  height: 46px;
  border-color: rgba(255, 101, 132, 0.9);
  background: rgba(255, 101, 132, 0.1);
}

.custom-cursor-enabled.cursor-down .cursor-ring {
  width: 30px;
  height: 30px;
}

.custom-cursor-enabled.cursor-down .cursor-dot {
  --dot-scale: 0.85;
}

a { color: var(--accent); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--accent2); }

h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: .5rem; }
h3 { font-size: 1.15rem; margin-bottom: .5rem; }

.lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 2rem;
}

.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0d0f14 0%, #12172b 40%, #1a1030 100%);
  z-index: 0;
}
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 60%, rgba(108,99,255,.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 30%, rgba(255,101,132,.12) 0%, transparent 70%);
  animation: pulse-bg 8s ease-in-out infinite alternate;
}

@keyframes pulse-bg {
  from { opacity: .7; }
  to   { opacity: 1; }
}

.hero-shapes { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.shape {
  position: absolute;
  border-radius: 50%;
  opacity: .07;
  background: var(--accent);
  animation: float 12s ease-in-out infinite;
}
.shape-1 { width: 320px; height: 320px; top: -80px; left: -80px; animation-delay: 0s; }
.shape-2 { width: 220px; height: 220px; bottom: 40px; right: -60px; background: var(--accent2); animation-delay: -4s; }
.shape-3 { width: 140px; height: 140px; top: 50%; left: 60%; background: var(--accent3); animation-delay: -8s; }

@keyframes float {
  0%,100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-30px) scale(1.06); }
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--text-muted);
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(20px);
  animation: slide-up .7s .2s forwards;
}

.hero-name {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #fff 20%, var(--accent) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transform: translateY(24px);
  animation: slide-up .7s .45s forwards;
}

.hero-gallery {
  --gallery-size: min(96vw, 1120px);
  --orbit-radius: clamp(180px, 27vw, 330px);
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--gallery-size);
  height: min(75vw, 620px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

.gallery-img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(110px, 16vw, 206px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 3px;
  border: 10px solid rgba(5, 8, 14, 0.96);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.44);
  opacity: 0.88;
  animation: orbit-circulate 42s linear infinite;
}

@keyframes orbit-circulate {
  from {
    transform:
      translate(-50%, -50%)
      rotate(calc(var(--i) * 51.428571deg + 0deg))
      translateY(calc(var(--orbit-radius) * -1))
      rotate(calc((var(--i) * 51.428571deg + 0deg) * -1));
  }
  to {
    transform:
      translate(-50%, -50%)
      rotate(calc(var(--i) * 51.428571deg + 360deg))
      translateY(calc(var(--orbit-radius) * -1))
      rotate(calc((var(--i) * 51.428571deg + 360deg) * -1));
  }
}

.hero-tagline {
  font-size: clamp(.95rem, 2vw, 1.25rem);
  color: var(--text-muted);
  margin-top: .75rem;
  opacity: 0;
  transform: translateY(20px);
  animation: slide-up .7s .65s forwards;
}

.hero-cta {
  display: inline-block;
  margin-top: 2.5rem;
  padding: .85rem 2.2rem;
  border-radius: 100px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  letter-spacing: .04em;
  box-shadow: 0 0 24px rgba(108,99,255,.45);
  transition: transform var(--trans), box-shadow var(--trans), background var(--trans);
  opacity: 0;
  animation: slide-up .7s .9s forwards;
}
.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 40px rgba(108,99,255,.65);
  background: #7c74ff;
  color: #fff;
}

@keyframes slide-up {
  to { opacity: 1; transform: translateY(0); }
}

main { max-width: 1100px; margin: 0 auto; padding: 4rem 1.5rem 6rem; }
main, .site-footer { position: relative; z-index: 1; }

.tabs {
  position: relative;
  display: flex;
  gap: .25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: .35rem;
  margin-bottom: 3rem;
  width: fit-content;
  overflow: hidden;
}

.tab-indicator {
  position: absolute;
  top: .35rem;
  height: calc(100% - .7rem);
  background: var(--accent);
  border-radius: 100px;
  transition: left var(--trans), width var(--trans);
  z-index: 0;
  box-shadow: 0 0 18px rgba(108,99,255,.5);
}

.tab-btn {
  position: relative;
  z-index: 1;
  padding: .6rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: .95rem;
  font-weight: 500;
  border-radius: 100px;
  cursor: pointer;
  transition: color var(--trans);
  white-space: nowrap;
}
.tab-btn.active { color: #fff; }
.tab-btn:not(.active):hover { color: var(--text); }

.tab-panel {
  display: none;
  opacity: 0;
}
.tab-panel.active {
  display: block;
  animation: panel-in .45s ease forwards;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 680px) {
  .about-grid { grid-template-columns: 1fr; }
}

.about-photo-wrap { display: flex; justify-content: center; }

.about-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.about-photo-placeholder {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--text-muted);
  font-size: .8rem;
  text-align: center;
  padding: 1rem;
}

.about-photo-placeholder svg {
  width: 80px;
  fill: var(--border);
}

.about-text h2 { margin-bottom: 1rem; }

.about-facts {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.about-facts li {
  display: flex;
  gap: .75rem;
  font-size: .95rem;
  color: var(--text-muted);
}
.about-facts .fact-label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-weight: 600;
  color: var(--text);
  min-width: 100px;
}

.about-facts .fact-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 18px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
  --glow: hsl(var(--card-hue, 210), 100%, 65%);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 0 1px var(--glow);
  border-color: var(--glow);
}

.card-icon {
  width: 42px;
  height: 42px;
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--trans), box-shadow var(--trans);
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.project-thumb {
  height: 140px;
  background: hsl(var(--thumb-hue, 200), 60%, 20%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.project-thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-thumb-icon {
  display: none;
}
.project-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg,
    hsla(var(--thumb-hue,200),80%,55%,.18) 0%,
    transparent 70%);
}

.project-info { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.project-info p { color: var(--text-muted); font-size: .92rem; flex: 1; }

.project-links { display: flex; gap: .6rem; margin-top: .5rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: .55rem 1.3rem;
  border-radius: 100px;
  font-size: .88rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: 1.5px solid transparent;
  transition: background var(--trans), transform var(--trans), box-shadow var(--trans);
}
.btn:hover { background: #7c74ff; color: #fff; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(108,99,255,.4); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; box-shadow: none; }

.btn-sm { padding: .4rem 1rem; font-size: .82rem; }

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .75rem;
}
.tag-list li {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: .2rem .75rem;
  font-size: .78rem;
  color: var(--text-muted);
}

.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.social-links { display: flex; gap: 1.5rem; }
.social-links a { color: var(--text-muted); font-size: .9rem; }
.social-links a:hover { color: var(--accent); }

.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .55s ease, transform .55s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
.card:nth-child(2).fade-up      { transition-delay: .1s; }
.card:nth-child(3).fade-up      { transition-delay: .2s; }
.project-card:nth-child(2).fade-up { transition-delay: .1s; }
.project-card:nth-child(3).fade-up { transition-delay: .2s; }

@media (max-width: 520px) {
  .hero-gallery {
    --orbit-radius: clamp(120px, 34vw, 180px);
    height: min(82vw, 420px);
  }
  .gallery-img {
    width: clamp(78px, 24vw, 126px);
    border-width: 7px;
  }
  .cursor-ring,
  .cursor-dot { display: none; }
  .starfield { opacity: 0.75; }
  .mouse-glow { display: none; }
  .tabs { border-radius: var(--radius); flex-wrap: wrap; }
  .tab-indicator { display: none; }
  .tab-btn.active { background: var(--accent); color: #fff; }
  .hero-name { font-size: clamp(2.5rem, 14vw, 4rem); }
}
