:root {
  --bg: #f4f2ff;
  --bg-2: #eef4ff;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: rgba(99, 102, 241, 0.12);
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --grad: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(59, 130, 246, 0.08));
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 76px;
  --shadow: 0 4px 24px rgba(99, 102, 241, 0.08);
  --shadow-lg: 0 12px 40px rgba(99, 102, 241, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 50%, #f0f5ff 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 30px rgba(99, 102, 241, 0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  flex-shrink: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.02em;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
}

.nav-link {
  position: relative;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.25s, background 0.25s;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(124, 58, 237, 0.06);
}

.nav-link.active {
  color: var(--purple);
  background: rgba(124, 58, 237, 0.1);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
  transition: transform 0.25s, box-shadow 0.25s;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.nav-toggle:hover {
  background: var(--grad-soft);
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  top: var(--header-h);
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.nav-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Hero */
.hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--header-h);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 48px 0 32px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.hero-greeting {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.hero-greeting strong {
  color: var(--text);
  font-weight: 600;
}

.hero-headline {
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--text);
}

.hero-headline .line { display: block; }

.typewriter-line {
  min-height: 1.2em;
  margin-top: 2px;
}

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

.tw-cursor {
  color: var(--purple);
  font-weight: 400;
  -webkit-text-fill-color: var(--purple);
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.hero-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 440px;
  line-height: 1.75;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.25s var(--ease);
}

.btn-fill {
  background: var(--grad);
  color: #fff;
  border: none;
}

.btn-fill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--purple-light);
  color: var(--purple);
}

.hero-stats {
  display: flex;
  gap: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.hstat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--purple);
}

.hstat-lbl {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Hero visual */
.hero-visual {
  display: flex;
  justify-content: center;
}

.visual-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
}

.visual-glow {
  position: absolute;
  inset: -15%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
}

.visual-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 36px;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
}

.visual-role {
  font-size: 0.88rem;
  color: var(--muted);
}

.visual-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.visual-tags span {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--grad-soft);
  color: var(--purple);
  border: 1px solid var(--border);
}

.orbit { display: none; }

/* Marquee */
.marquee-wrap {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
  padding: 14px 0;
  margin-top: 16px;
}

.marquee {
  display: flex;
  gap: 32px;
  animation: marquee 30s linear infinite;
}

.marquee span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Sections */
.section {
  position: relative;
  z-index: 2;
  padding: 80px 0;
}

.section-top { margin-bottom: 40px; }

.sec-num {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 8px;
}

.sec-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* About */
.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: start;
}

.about-lead {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.8;
}

.about-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mini-card {
  padding: 20px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}

.mini-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.mini-icon {
  font-size: 1.2rem;
  display: block;
  margin-bottom: 8px;
}

.mini-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.mini-card p {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Skills */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-pill {
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.2s, color 0.2s;
}

.skill-pill:hover {
  border-color: var(--purple-light);
  color: var(--purple);
}

/* Projects */
.work-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
  transition: box-shadow 0.3s, transform 0.3s;
}

.work-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.work-thumb {
  min-height: 180px;
}

.work-thumb-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #ede9fe 0%, #dbeafe 100%);
  padding: 32px;
  transition: background 0.3s;
}

.work-thumb-logo:hover {
  background: linear-gradient(160deg, #ddd6fe 0%, #bfdbfe 100%);
}

.work-logo {
  width: auto;
  max-width: 85%;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(99, 102, 241, 0.15));
}

.work-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.work-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue);
  transition: color 0.2s;
}

.work-link:hover {
  color: var(--purple);
}

.work-body {
  padding: 28px 32px;
}

.work-num {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 8px;
}

.work-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.work-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 12px;
}

.work-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--grad-soft);
  color: var(--purple);
}

/* Contact */
.contact-box {
  text-align: center;
  padding: 56px 32px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.contact-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin: 12px 0;
}

.contact-lead {
  color: var(--muted);
  margin-bottom: 32px;
}

.contact-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 28px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  min-width: 200px;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.contact-btn:hover {
  border-color: var(--purple-light);
  background: var(--grad-soft);
}

.cb-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.cb-val {
  font-size: 1rem;
  font-weight: 600;
  color: var(--purple);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--border);
  padding: 24px 0;
  background: rgba(255, 255, 255, 0.5);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-link:hover { color: var(--purple); }

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

.reveal-d1.visible { transition-delay: 0.06s; }
.reveal-d2.visible { transition-delay: 0.12s; }
.reveal-d3.visible { transition-delay: 0.18s; }
.reveal-d4.visible { transition-delay: 0.24s; }
.reveal-d5.visible { transition-delay: 0.3s; }

/* Admin */
.admin-body {
  background: linear-gradient(160deg, var(--bg), var(--bg-2));
}

.admin {
  position: relative;
  z-index: 2;
  padding: 100px 0 64px;
}

.admin .section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.admin h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--purple);
}

.admin-form { display: grid; gap: 14px; }

.admin-form label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-form input,
.admin-form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
}

.admin-form input:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--purple-light);
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

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

.admin code {
  padding: 2px 6px;
  background: var(--grad-soft);
  color: var(--purple);
  border-radius: 4px;
  font-size: 0.88em;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-visual { order: -1; }
  .visual-card { max-width: 260px; margin: 0 auto; }

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

  .work-card { grid-template-columns: 1fr; }
  .work-thumb { min-height: 140px; }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 16px;
    right: 16px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 4px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    z-index: 201;
  }

  .site-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-backdrop { display: block; }

  .nav-link {
    padding: 14px 18px;
    font-size: 1rem;
    border-radius: 10px;
  }

  .nav-cta span:first-child { display: none; }

  .nav-cta {
    padding: 10px 14px;
  }

  .nav-toggle { display: flex; }

  .hero-stats { gap: 20px; }
  .contact-btn { min-width: 100%; }
}
