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

:root {
  --bg: #050d0f;
  --bg-2: #070f12;
  --bg-card: #0a1518;
  --border: rgba(255,255,255,0.07);
  --accent: #06b6d4;
  --accent-2: #22d3ee;
  --accent-glow: rgba(6,182,212,0.25);
  --text: #e2f0f2;
  --text-muted: #4d7a84;
  --font: 'Space Grotesk', sans-serif;
  --mono: 'Space Mono', monospace;
  --radius: 12px;
  --radius-lg: 20px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── Nav ── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 2rem;
  backdrop-filter: blur(16px);
  background: rgba(10,10,15,0.8);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
#nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-2);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Shared ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 3rem;
}

.accent { color: var(--accent-2); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  box-shadow: 0 0 24px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-2);
  box-shadow: 0 0 32px rgba(34,211,238,0.4);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  transform: translateY(-1px);
}

/* ── Hero ── */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6,182,212,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,182,212,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 40%, transparent 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.glow-1 {
  width: 500px; height: 500px;
  background: rgba(6,182,212,0.1);
  top: -100px; left: -100px;
  animation: float 8s ease-in-out infinite;
}
.glow-2 {
  width: 400px; height: 400px;
  background: rgba(34,211,238,0.07);
  bottom: -80px; right: -80px;
  animation: float 10s ease-in-out infinite reverse;
}
.glow-center {
  width: 600px; height: 400px;
  background: rgba(6,182,212,0.08);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
}

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

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  padding: 0 2rem;
}

.hero-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.2);
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  color: var(--text-muted);
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ── About ── */
#about {
  padding: 8rem 0;
  background: var(--bg-2);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-text h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.75;
}

.stat-row {
  display: flex;
  gap: 2.5rem;
  margin-top: 2.5rem;
}
.stat {
  display: flex;
  flex-direction: column;
}
.stat-num {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent-2);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Terminal */
.terminal {
  background: #0d0d18;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(6,182,212,0.08), 0 20px 60px rgba(0,0,0,0.4);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }
.terminal-title {
  margin-left: auto;
  margin-right: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.terminal-body {
  padding: 1.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 2;
}
.terminal-body p { white-space: nowrap; }
.prompt { color: var(--accent); margin-right: 0.5rem; }
.output { color: var(--text-muted); padding-left: 1.4rem; }
.tag-badge {
  background: rgba(6,182,212,0.12);
  color: var(--accent-2);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}
.cursor {
  display: inline-block;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Projects ── */
#projects {
  padding: 8rem 0;
  background: var(--bg);
}

.category-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

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

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6,182,212,0.3);
  box-shadow: 0 12px 40px rgba(6,182,212,0.1);
}
.project-card.featured {
  grid-column: span 2;
}
@media (max-width: 700px) {
  .project-card.featured { grid-column: span 1; }
}

.project-screenshot {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-2);
  overflow: hidden;
}
.project-screenshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}
.project-card:hover .project-screenshot img {
  transform: scale(1.03);
}

.screenshot-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: repeating-linear-gradient(
    -45deg,
    rgba(6,182,212,0.03),
    rgba(6,182,212,0.03) 10px,
    transparent 10px,
    transparent 20px
  );
  border-bottom: 1px dashed rgba(6,182,212,0.2);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}
.plus-icon {
  font-size: 2rem;
  color: rgba(6,182,212,0.3);
  line-height: 1;
}
.hint {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: rgba(255,255,255,0.15);
}

.project-badge {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  color: #ffd700;
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255,215,0,0.2);
}

.project-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.6rem;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--accent-2);
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.15);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}
.project-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}
.project-info p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
  flex: 1;
}
.project-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-2);
  margin-top: auto;
  transition: gap 0.2s;
  display: inline-block;
}
.project-link:hover { color: #fff; }

/* ── Skills ── */
#skills {
  padding: 8rem 0;
  background: var(--bg-2);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem;
}
.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.skill-group h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.skill-pills span {
  font-size: 0.82rem;
  font-weight: 500;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}
.skill-pills span:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

/* ── Contact ── */
#contact {
  padding: 8rem 0;
  background: var(--bg);
}

.contact-box {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  overflow: hidden;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.contact-box h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
}
.contact-box p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}
.contact-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  transition: all 0.2s;
}
.contact-btn svg { width: 16px; height: 16px; }
.contact-btn:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  background: rgba(6,182,212,0.06);
  transform: translateY(-2px);
}

/* ── Project Detail Panel ── */
#project-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#project-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#project-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(680px, 100vw);
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
#project-overlay.open #project-panel {
  transform: translateX(0);
}

#panel-close {
  position: sticky;
  top: 1.25rem;
  margin: 1.25rem 1.25rem 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  z-index: 2;
}
#panel-close:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  background: rgba(6,182,212,0.08);
}

/* Gallery */
#panel-gallery {
  padding: 0 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
#panel-gallery img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
  object-fit: cover;
}
#panel-gallery img:first-child {
  border-radius: var(--radius-lg);
}
.panel-gallery-empty {
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(6,182,212,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: repeating-linear-gradient(
    -45deg,
    rgba(6,182,212,0.02),
    rgba(6,182,212,0.02) 10px,
    transparent 10px,
    transparent 20px
  );
}

/* Body */
#panel-body {
  padding: 0 2rem 3rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

#panel-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

#panel-tagline {
  color: var(--accent-2);
  font-size: 1rem;
  font-weight: 500;
  margin-top: -0.75rem;
}

.panel-section h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.panel-section div {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}
.panel-section div p { margin-bottom: 0.6rem; }
.panel-section div p:last-child { margin-bottom: 0; }

#panel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.5rem;
}
.panel-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.panel-link-btn:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  background: rgba(6,182,212,0.06);
}

/* Make cards feel clickable */
.project-card { cursor: pointer; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}
footer a { color: var(--accent-2); }
footer a:hover { color: #fff; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .about-visual { order: -1; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: rgba(10,10,15,0.97);
    padding: 2rem;
    border-bottom: 1px solid var(--border);
    gap: 1.5rem;
  }
  .nav-toggle { display: flex; }
  .stat-row { gap: 1.5rem; }
}

/* ── Fade-in on scroll ── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
