/* ===== CSS Variables ===== */
:root {
  --bg-dark: #0f172a;
  --bg-section: #1f2937;
  --bg-card: #111827;
  --accent: #22d3ee;
  --accent-dark: #0891b2;
  --text-primary: #f3f4f6;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --border: #374151;
  --red-accent: #ef4444;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

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

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Matrix Canvas ===== */
#matrix-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.4;
}

/* ===== Navigation ===== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  transition: background 0.3s, backdrop-filter 0.3s;
  background: transparent;
}

#navbar.scrolled {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 60;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero ===== */
#home {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}

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

.hero-content h1 {
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  margin-bottom: 16px;
  animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 8px rgba(34, 211, 238, 0.3); }
  to   { text-shadow: 0 0 24px rgba(34, 211, 238, 0.6), 0 0 48px rgba(34, 211, 238, 0.2); }
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 40px;
  min-height: 1.8em;
}

.cursor {
  color: var(--accent);
  font-weight: 300;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--accent-dark);
  color: #fff;
  border-color: var(--accent-dark);
}

.btn-primary:hover {
  background: #0e7490;
  border-color: #0e7490;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: rgba(34, 211, 238, 0.1);
}

.btn-full {
  width: 100%;
}

/* Scroll Arrow */
.scroll-arrow {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  z-index: 2;
}

.scroll-arrow svg {
  width: 28px;
  height: 28px;
  color: var(--text-muted);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-12px); }
  60% { transform: translateX(-50%) translateY(-6px); }
}

/* ===== Sections Common ===== */
section {
  position: relative;
  z-index: 1;
  padding: 96px 0;
}

#about, #contact {
  background: rgba(31, 41, 55, 0.7);
}

#projects, #sponsor {
  background: rgba(15, 23, 42, 0.65);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.section-line {
  width: 64px;
  height: 4px;
  background: var(--accent);
  margin: 0 auto;
  border-radius: 2px;
}

/* ===== About ===== */
.about-row {
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: 900px;
  margin: 0 auto;
}

.about-avatar {
  flex-shrink: 0;
}

.about-avatar img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.25);
  object-fit: cover;
}

.about-right {
  flex: 1;
  min-width: 0;
}

.about-text {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
  text-align: left;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #374151;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: background 0.2s;
}

.social-btn:hover {
  background: #4b5563;
}

.social-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Skill Cards */
.skill-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 64px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(34, 211, 238, 0.08);
}

.skill-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.skill-icon svg {
  width: 24px;
  height: 24px;
}

.skill-icon-teal {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent);
}

.skill-icon-green {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.skill-icon-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

.skill-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.skill-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== Stats Row ===== */
#stats {
  padding: 48px 0;
  background: rgba(15, 23, 42, 0.75);
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 120px;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.thm-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.thm-badge {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-guardian {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

.badge-pro {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ===== Projects ===== */
.disclaimer {
  background: rgba(17, 24, 39, 0.75);
  border-left: 4px solid var(--red-accent);
  border-radius: 8px;
  padding: 14px 20px;
  margin-bottom: 32px;
}

.disclaimer summary {
  color: var(--red-accent);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.disclaimer summary::before {
  content: '\25B6  ';
  font-size: 0.7rem;
  transition: transform 0.2s;
  display: inline-block;
}

.disclaimer[open] summary::before {
  transform: rotate(90deg);
}

.disclaimer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
  margin-top: 10px;
}

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

.project-card {
  background: rgba(31, 41, 55, 0.75);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(34, 211, 238, 0.1);
}

.project-img {
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.project-card:hover .project-img img {
  transform: scale(1.05);
}

.project-body {
  padding: 20px;
}

.project-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-tags span {
  padding: 4px 10px;
  background: rgba(55, 65, 81, 0.8);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.project-link:hover {
  color: var(--accent);
}

.project-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ===== Sponsor ===== */
.sponsor-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.sponsor-card {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.sponsor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 48px;
  background: var(--accent);
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 700;
  border-radius: 14px;
  transition: background 0.25s, transform 0.2s, box-shadow 0.25s;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.3);
}

.sponsor-btn:hover {
  background: #67e8f9;
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(34, 211, 238, 0.5);
}

.sponsor-heart {
  font-size: 1.3rem;
}

.sponsor-link-text {
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.sponsor-link-text a {
  color: var(--accent);
  transition: color 0.2s;
}

.sponsor-link-text a:hover {
  color: #67e8f9;
}

/* ===== Contact ===== */
.contact-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 24px;
}

.contact-email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
  color: var(--accent);
}

.contact-email svg {
  flex-shrink: 0;
}

.contact-email a {
  font-size: 1.1rem;
  color: var(--accent);
  transition: color 0.2s;
}

.contact-email a:hover {
  color: #67e8f9;
}

.contact-form {
  max-width: 520px;
  margin: 0 auto;
  background: rgba(17, 24, 39, 0.6);
  padding: 32px;
  border-radius: 16px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-status {
  text-align: center;
  margin-top: 12px;
  font-size: 0.9rem;
}

.form-status.success {
  color: #22c55e;
}

.form-status.error {
  color: var(--red-accent);
}

/* ===== Footer ===== */
footer {
  position: relative;
  z-index: 1;
  background: rgba(17, 24, 39, 0.95);
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-inner p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-socials {
  display: flex;
  gap: 16px;
}

.footer-socials a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-socials a:hover {
  color: var(--accent);
}

.footer-socials svg {
  width: 20px;
  height: 20px;
}

/* ===== Scroll to Top ===== */
#scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bg-section);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#scroll-top:hover {
  background: var(--accent-dark);
  color: #fff;
}

#scroll-top svg {
  width: 22px;
  height: 22px;
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .skill-cards {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.97);
    padding: 16px 24px;
    gap: 0;
    backdrop-filter: blur(12px);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .about-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-text {
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }

  .skill-cards {
    grid-template-columns: 1fr;
  }

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

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  section {
    padding: 64px 0;
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }
}
