/* ============ Design Tokens ============ */
:root {
  --bg: #0a0e1a;
  --bg-alt: #0d1326;
  --surface: #121a30;
  --surface-2: #16203c;
  --border: #232f52;
  --text: #e7ebf5;
  --text-muted: #93a0c2;
  --text-dim: #6b7594;

  --teal: #2dd4bf;
  --teal-rgb: 45,212,191;
  --purple: #a78bfa;
  --purple-rgb: 167,139,250;
  --gradient: linear-gradient(135deg, var(--teal) 0%, var(--purple) 100%);
  --gradient-soft: linear-gradient(135deg, rgba(45,212,191,0.15) 0%, rgba(167,139,250,0.15) 100%);
  --nav-scroll-bg: rgba(10,14,26,0.85);
  --glow-1: rgba(45,212,191,0.10);
  --glow-2: rgba(167,139,250,0.12);
  --glow-3: rgba(45,212,191,0.07);

  --font-head: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
  --bg-alt-veil: rgba(13,19,38,0.55);
}

:root[data-theme="light"] {
  --bg: #f7f9fc;
  --bg-alt: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f2f5fb;
  --border: #dde3f0;
  --text: #161b2e;
  --text-muted: #4c5674;
  --text-dim: #8791ac;

  --teal: #0d9488;
  --teal-rgb: 13,148,136;
  --purple: #7c3aed;
  --purple-rgb: 124,58,237;
  --gradient: linear-gradient(135deg, #14b8a6 0%, #8b5cf6 100%);
  --gradient-soft: linear-gradient(135deg, rgba(13,148,136,0.10) 0%, rgba(124,58,237,0.10) 100%);
  --nav-scroll-bg: rgba(247,249,252,0.85);
  --glow-1: rgba(13,148,136,0.08);
  --glow-2: rgba(124,58,237,0.08);
  --glow-3: rgba(13,148,136,0.05);

  --shadow: 0 20px 50px -20px rgba(30,41,80,0.18);
  --bg-alt-veil: var(--bg-alt);
}

* {
  margin:0; padding:0; box-sizing:border-box;
  transition: background-color .35s ease, border-color .35s ease, color .35s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .35s ease, color .35s ease;
}

/* ============ Site-wide starfield ============ */
#siteStars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
#siteStars .star {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  animation-name: exp-twinkle;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
:root[data-theme="light"] #siteStars { display: none; }
@media (prefers-reduced-motion: reduce) {
  #siteStars .star { animation: none; }
}
.navbar, .hero, .section, .footer, #backToTop { position: relative; z-index: 1; }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display:block; }

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

/* ============ Background glow ============ */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  transition: background .35s ease;
  background:
    radial-gradient(600px circle at 15% 10%, var(--glow-1), transparent 40%),
    radial-gradient(700px circle at 85% 25%, var(--glow-2), transparent 45%),
    radial-gradient(500px circle at 50% 90%, var(--glow-3), transparent 40%);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-body);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient);
  color: #06110f;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(var(--teal-rgb), 0.5); }

.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }

.btn-ghost {
  padding: 9px 20px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
}
.btn-ghost:hover { border-color: var(--purple); color: var(--purple); }

/* ============ Navbar ============ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background .3s ease, padding .3s ease, backdrop-filter .3s ease;
}
.navbar.scrolled {
  background: var(--nav-scroll-bg);
  backdrop-filter: blur(12px);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
}
.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
}
.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  padding: 4px 0;
  transition: color .2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--gradient);
  transition: width .25s ease;
}
.nav-links a:hover::after { width: 100%; }

.nav-actions { display:flex; align-items:center; gap:16px; position: relative; z-index: 101; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .25s ease, color .25s ease, transform .25s ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-2px);
}
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ============ Hero ============ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 60px;
  position: relative;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  color: var(--teal);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 14px;
}
.hero-text h1 {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
}
.hero-text h2 {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 24px;
  min-height: 1.4em;
}
.typed { border-right: 2px solid var(--teal); padding-right: 4px; }
.hero-desc {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 32px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.hero-socials { display: flex; gap: 18px; }
.hero-socials a {
  width: 42px; height: 42px;
  display: flex; align-items:center; justify-content:center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  transition: all .25s ease;
  animation: iconJump 5s ease-in-out infinite;
}
.hero-socials a:nth-child(2) { animation-delay: .15s; }
.hero-socials a:nth-child(3) { animation-delay: .3s; }
.hero-socials a:hover {
  color: var(--bg);
  background: var(--gradient);
  border-color: transparent;
  animation-play-state: paused;
  transform: translateY(-3px);
}
@keyframes iconJump {
  0%, 92%, 100% { transform: translateY(0); }
  95% { transform: translateY(-9px); }
  97.5% { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-socials a { animation: none; }
}

.hero-photo { display: flex; justify-content: center; }
.photo-frame {
  position: relative;
  width: 320px;
  height: 320px;
  border-radius: 28px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.photo-frame::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient);
  z-index: -1;
  border-radius: 30px;
  opacity: 0.6;
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder {
  display: none;
  position: absolute; inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-dim);
  background: var(--surface-2);
  text-align: center;
  font-size: 0.85rem;
  padding: 20px;
}
.photo-frame.no-photo img { display: none; }
.photo-frame.no-photo .photo-placeholder { display: flex; }

.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid var(--border);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.scroll-cue span {
  width: 4px; height: 8px;
  border-radius: 2px;
  background: var(--teal);
  animation: scrollDown 1.8s infinite;
}
@keyframes scrollDown {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(14px); }
}

/* ============ Sections ============ */
.section { padding: 110px 0; }
.section.alt { background: var(--bg-alt-veil); }
.section-tag {
  color: var(--teal);
  font-weight: 600;
  font-family: var(--font-head);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin-bottom: 14px;
}
.section-sub {
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 48px;
  font-size: 1.02rem;
}

.currently-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.currently-badge strong { color: var(--text); font-weight: 600; }
.currently-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(var(--teal-rgb), 0.6);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--teal-rgb), 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(var(--teal-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--teal-rgb), 0); }
}

/* ============ Skills ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .3s ease, border-color .3s ease;
}
.skill-card:hover {
  transform: translateY(-6px);
  border-color: var(--teal);
}
.skill-icon { font-size: 1.8rem; margin-bottom: 14px; }
.skill-card h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  margin-bottom: 16px;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============ Experience timeline ============ */
.exp-section { overflow: hidden; }
@keyframes exp-twinkle {
  from { opacity: .15; }
  to { opacity: 1; }
}
:root[data-theme="light"] .exp-section {
  background:
    radial-gradient(620px circle at 50% -8%, rgba(255,196,102,.55), transparent 55%),
    radial-gradient(480px circle at 12% 105%, rgba(45,212,191,.16), transparent 60%),
    linear-gradient(180deg, #dff1ff 0%, #eef8ff 32%, #fff7e6 66%, #ffedc7 100%);
}

.exp-timeline { position: relative; max-width: 980px; margin: 0 auto; }
.exp-line {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--purple);
  opacity: .45;
  box-shadow: 0 0 16px 2px rgba(var(--purple-rgb), .5);
}

.exp-item {
  display: grid;
  grid-template-columns: 1fr 76px 1fr;
  align-items: start;
  gap: 20px;
  position: relative;
  padding: 36px 0;
}
.exp-item .exp-card { grid-column: 1; }
.exp-item .exp-marker { grid-column: 2; }
.exp-item .exp-date { grid-column: 3; }
.exp-item--reverse .exp-card { grid-column: 3; }
.exp-item--reverse .exp-date { grid-column: 1; text-align: right; align-items: flex-end; }

.exp-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 42px;
}
.exp-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 4px var(--bg-alt), 0 0 20px 5px rgba(var(--purple-rgb), .6);
  position: relative;
  z-index: 2;
}

.exp-date {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 46px;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: .5px;
  font-size: .92rem;
  color: var(--purple);
  text-transform: uppercase;
}
.exp-date .exp-location {
  color: var(--text-dim);
  font-weight: 500;
  font-size: .8rem;
  text-transform: none;
  letter-spacing: normal;
}

.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  text-align: center;
}
.exp-company {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--purple);
  border-radius: 999px;
  color: var(--purple);
  background: rgba(var(--purple-rgb), .12);
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: 18px;
}
.exp-icon {
  width: 54px; height: 54px;
  margin: 0 auto 18px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.exp-role {
  font-family: var(--font-head);
  font-size: 1.2rem;
  margin-bottom: 20px;
}
.exp-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
.exp-points li {
  color: var(--text-muted);
  font-size: .92rem;
  padding-left: 18px;
  position: relative;
}
.exp-points li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--purple);
}

.reveal-left, .reveal-right {
  opacity: 0;
  transition: opacity .7s ease, transform .7s ease;
}
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-left.visible, .reveal-right.visible { opacity: 1; transform: translateX(0); }

/* ============ Projects ============ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .3s ease, border-color .3s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover { transform: translateY(-6px); border-color: var(--purple); }
.project-thumb {
  height: 180px;
  background-color: var(--surface-2);
  background-image: var(--gradient-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.project-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.project-body h3 { font-family: var(--font-head); font-size: 1.1rem; }
.project-body p { color: var(--text-muted); font-size: 0.92rem; flex: 1; }
.project-body .tags span { font-size: 0.75rem; padding: 5px 11px; }

/* ============ Education ============ */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  transition: transform .3s ease, border-color .3s ease;
}
.edu-card:hover { transform: translateY(-6px); border-color: var(--teal); }
.edu-icon { font-size: 1.8rem; margin-bottom: 14px; }
.edu-card h3 { font-family: var(--font-head); font-size: 1.1rem; margin-bottom: 8px; }
.edu-place { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 10px; }
.edu-date { color: var(--text-dim); font-size: 0.85rem; }

/* ============ Contact ============ */
.contact-wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
}
.contact-info { display: flex; flex-direction: column; gap: 16px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  transition: border-color .25s ease, transform .25s ease;
}
a.contact-item:hover { border-color: var(--teal); transform: translateX(4px); }
.contact-icon { font-size: 1.4rem; }
.contact-item strong { display: block; font-size: 0.85rem; color: var(--text-dim); font-weight: 500; }
.contact-item p { font-size: 0.98rem; color: var(--text); word-break: break-word; }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-row { display: flex; gap: 16px; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color .2s ease;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--teal);
}
.contact-form ::placeholder { color: var(--text-dim); }
.form-note { font-size: 0.8rem; color: var(--text-dim); text-align: center; }
.form-note-success { color: var(--teal); }
.form-note-error { color: #e5484d; }

/* ============ Footer ============ */
.footer {
  padding: 32px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* ============ Back to top ============ */
#backToTop {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--teal);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all .3s ease;
  z-index: 90;
}
#backToTop.show { opacity: 1; visibility: visible; transform: translateY(0); }
#backToTop:hover { background: var(--gradient); color: var(--bg); border-color: transparent; }

/* ============ Reveal animation ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .photo-frame { width: 240px; height: 240px; }
  .hero-socials { margin-bottom: 64px; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-wrap { grid-template-columns: 1fr; }

  .exp-timeline { padding-left: 46px; }
  .exp-line { left: 46px; transform: none; }
  .exp-item, .exp-item--reverse {
    display: flex;
    flex-direction: column;
    padding: 28px 0;
  }
  .exp-item .exp-card, .exp-item--reverse .exp-card { order: 1; }
  .exp-item .exp-date, .exp-item--reverse .exp-date { order: 2; }
  .exp-item .exp-card, .exp-item--reverse .exp-card { text-align: left; }
  .exp-item .exp-company, .exp-item .exp-icon,
  .exp-item--reverse .exp-company, .exp-item--reverse .exp-icon { margin-left: 0; }
  .exp-marker {
    position: absolute;
    left: 0;
    top: 28px;
    transform: translateX(-50%);
    padding-top: 0;
  }
  .exp-item .exp-date, .exp-item--reverse .exp-date {
    text-align: left;
    align-items: flex-start;
    padding-top: 0;
    padding-left: 4px;
    margin-bottom: 14px;
  }
}

@media (max-width: 720px) {
  .hero-text h2 {
    line-height: 1.3;
    min-height: 2.6em;
  }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--bg-alt);
    border-left: 1px solid var(--border);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    padding: 40px;
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 99;
  }
  .nav-links.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; }
  .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .btn-ghost { display: none; }

  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }

  .skills3d-panel { width: 96vw; height: min(80vh, 520px); }
  .orbit-center { width: 78px; height: 78px; }
  .orbit-icon { width: 40px; height: 40px; }
  .orbit-icon img { width: 20px; height: 20px; }
  .orbit-label { font-size: .6rem; }
  .skills3d-extra { height: 66px; gap: 14px; padding: 0 16px; }
  .orbit-extra-icon { width: 24px; height: 24px; }
  .orbit-extra-icon img { width: 14px; height: 14px; }
  .orbit-extra-item { font-size: .74rem; }
}

/* ============ Skills 3D Universe ============ */
.skills-3d-cta {
  display: flex;
  justify-content: center;
  margin: 28px 0 40px;
}
.btn-3d-highlight {
  box-shadow: 0 0 0 0 rgba(var(--teal-rgb), .55), 0 10px 30px -8px rgba(var(--teal-rgb), .45);
  animation: btn3dPulse 2.4s ease-out infinite;
}
.btn-3d-highlight:hover { animation-play-state: paused; }
@keyframes btn3dPulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--teal-rgb), .55), 0 10px 30px -8px rgba(var(--teal-rgb), .45); }
  70% { box-shadow: 0 0 0 14px rgba(var(--teal-rgb), 0), 0 10px 30px -8px rgba(var(--teal-rgb), .45); }
  100% { box-shadow: 0 0 0 0 rgba(var(--teal-rgb), 0), 0 10px 30px -8px rgba(var(--teal-rgb), .45); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-3d-highlight { animation: none; }
}

.skills3d-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.skills3d-modal.open { display: flex; }

.skills3d-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4,6,14,0.82);
  backdrop-filter: blur(6px);
}

.skills3d-panel {
  position: relative;
  width: min(92vw, 920px);
  height: min(86vh, 640px);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.skills3d-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(255,255,255,.7), transparent),
    radial-gradient(2px 2px at 30% 70%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 50% 30%, rgba(255,255,255,.55), transparent),
    radial-gradient(2px 2px at 70% 80%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.5px 1.5px at 85% 15%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.5px 1.5px at 92% 55%, rgba(255,255,255,.4), transparent);
  background-repeat: repeat;
  background-size: 480px 320px;
  opacity: .7;
  pointer-events: none;
}
:root[data-theme="light"] .skills3d-panel::before { display: none; }

.skills3d-title {
  position: absolute;
  top: 24px; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  z-index: 2;
  pointer-events: none;
}
.skills3d-hint {
  position: absolute;
  top: 54px; left: 0; right: 0;
  text-align: center;
  font-size: .82rem;
  color: var(--text-dim);
  z-index: 2;
  pointer-events: none;
}

.skills3d-close {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 3;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .25s ease, color .25s ease, transform .25s ease;
}
.skills3d-close:hover { border-color: var(--purple); color: var(--purple); transform: rotate(90deg); }

.skills3d-stage {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: 78px;
}

@keyframes orbit-ring-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px dashed rgba(var(--teal-rgb), .28);
  pointer-events: none;
  animation: orbit-ring-spin linear infinite;
}
.orbit-ring.ring-1 { width: 34%; height: 24%; animation-duration: 22.5s; }
.orbit-ring.ring-2 { width: 58%; height: 40%; border-color: rgba(var(--purple-rgb), .24); animation-duration: 32.7s; animation-direction: reverse; }
.orbit-ring.ring-3 { width: 82%; height: 58%; border-color: rgba(var(--teal-rgb), .16); animation-duration: 45s; }
@media (prefers-reduced-motion: reduce) {
  .orbit-ring { animation: none; }
}

.orbit-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background-image: url('../assets/images/logo.png'), radial-gradient(circle at 35% 28%, rgba(45,212,191,.35), rgba(10,14,26,.92) 72%);
  background-size: cover, cover;
  background-position: center, center;
  border: 2px solid rgba(var(--teal-rgb), .55);
  box-shadow: 0 0 0 6px rgba(var(--teal-rgb), .08), 0 0 34px 6px rgba(var(--teal-rgb), .22);
  z-index: 5;
}

.orbit-items { position: absolute; inset: 0; }

.orbit-item {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 4;
}
.orbit-item .orbit-dot {
  position: absolute;
  top: 4px;
  left: -10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c, var(--teal));
  box-shadow: 0 0 8px 1px var(--c, var(--teal));
}
.orbit-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 14px 0 var(--c, var(--teal));
}
.orbit-icon img { width: 28px; height: 28px; object-fit: contain; }
.orbit-icon span { font-size: 1rem; font-weight: 700; color: var(--purple); }
.orbit-label {
  font-size: .72rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-head);
}

.skills3d-extra {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 78px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt-veil);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  overflow-x: auto;
}
.orbit-extra-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--text-muted);
  font-family: var(--font-head);
  white-space: nowrap;
}
.orbit-extra-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.orbit-extra-icon img { width: 16px; height: 16px; object-fit: contain; }
.orbit-extra-icon span { font-size: .6rem; font-weight: 700; color: var(--purple); }
