/* ═══════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #050505;
  --bg-card:   #0c0c0c;
  --bg-raised: #111111;
  --border:    #1a1a1a;
  --border-hi: #2a2a2a;
  --text:      #e5e5e5;
  --text-dim:  #777;
  --text-mute: #444;
  --white:     #fff;
  --radius:    16px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; }

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

/* ═══════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5,5,5,0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}
.nav-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
}
.nav-logo {
  font-size: 1.4rem; font-weight: 800; color: var(--white);
  letter-spacing: -0.02em;
}
.nav-logo .dot { color: #818cf8; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.85rem; color: var(--text-dim); font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--white); }

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
}
.hero-bg {
  position: absolute; inset: 0; overflow: hidden;
  pointer-events: none;
}
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 100%);
}
.glow {
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0.15;
}
.glow-1 {
  width: 600px; height: 600px;
  background: #818cf8;
  top: -10%; left: 20%;
  animation: drift 12s ease-in-out infinite alternate;
}
.glow-2 {
  width: 500px; height: 500px;
  background: #4ade80;
  bottom: -10%; right: 15%;
  animation: drift 10s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(40px, -30px); }
}

.hero-content { position: relative; z-index: 1; max-width: 680px; }

.hero-badge {
  display: inline-block;
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: #818cf8;
  background: rgba(129, 140, 248, 0.08);
  border: 1px solid rgba(129, 140, 248, 0.15);
  padding: 0.4rem 1rem; border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800; color: var(--white);
  letter-spacing: -0.03em; line-height: 1.1;
  margin-bottom: 1.25rem;
}

.hero-sub {
  font-size: 1.15rem; color: var(--text-dim);
  line-height: 1.7; max-width: 520px; margin: 0 auto 2rem;
}

.hero-actions { display: flex; gap: 0.75rem; justify-content: center; margin-bottom: 3rem; }

.btn {
  display: inline-flex; align-items: center;
  padding: 0.7rem 1.6rem; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-primary {
  background: #818cf8; color: #050505;
}
.btn-primary:hover { background: #a5b4fc; transform: translateY(-1px); }
.btn-ghost {
  border: 1px solid var(--border-hi); color: var(--text);
}
.btn-ghost:hover { border-color: #555; color: var(--white); }

.hero-stats {
  display: flex; gap: 2rem; justify-content: center; align-items: center;
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-size: 1.8rem; font-weight: 700; color: var(--white);
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 0.75rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-divider { width: 1px; height: 32px; background: var(--border-hi); }

.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%;
  transform: translateX(-50%);
}
.scroll-line {
  width: 1px; height: 50px; background: var(--border-hi);
  position: relative; overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute; top: -50px; left: 0;
  width: 1px; height: 50px;
  background: linear-gradient(to bottom, transparent, #818cf8);
  animation: scrollDown 2s ease-in-out infinite;
}
@keyframes scrollDown {
  0%   { top: -50px; }
  100% { top: 50px; }
}

/* ═══════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════ */
.section { padding: 7rem 0; }
.section-dark { background: var(--bg-card); }

.section-header { margin-bottom: 3.5rem; }
.section-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem; color: #818cf8;
  margin-bottom: 0.75rem;
}
.section-header h2 {
  font-size: 2.2rem; font-weight: 700; color: var(--white);
  letter-spacing: -0.02em; margin-bottom: 0.5rem;
}
.section-header p { color: var(--text-dim); font-size: 1rem; }

/* ═══════════════════════════════════════════
   LIVE PROJECT CARDS
   ═══════════════════════════════════════════ */
.live-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.live-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.live-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: translateY(-4px);
}

.live-card-preview {
  position: relative;
  background: #080808;
  border-right: 1px solid var(--border);
  overflow: hidden;
  min-height: 260px;
}

/* ── App Mockups ── */
.preview-mock {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  padding: 0;
}
.mock-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: #0e0e0e;
  border-bottom: 1px solid #1a1a1a;
}
.mock-btn {
  width: 8px; height: 8px; border-radius: 50%;
  background: #333;
}
.mock-btn:nth-child(1) { background: #f87171; }
.mock-btn:nth-child(2) { background: #fbbf24; }
.mock-btn:nth-child(3) { background: #4ade80; }
.mock-tool {
  width: 20px; height: 20px; border-radius: 4px;
  background: #1a1a1a; margin-left: 4px;
}
.mock-url-bar {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; color: #555;
  background: #1a1a1a;
  padding: 3px 10px; border-radius: 4px;
}

/* Excalidraw mock */
.excalidraw-mock .mock-canvas {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.excalidraw-mock .mock-canvas svg { width: 100%; max-width: 300px; }

/* URL Shortener mock */
.mock-shortener {
  flex: 1; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  justify-content: center;
}
.mock-input-group {
  display: flex; gap: 6px;
}
.mock-input {
  flex: 1; padding: 8px 12px;
  background: #1a1a1a; border: 1px solid #2a2a2a;
  border-radius: 6px;
  font-size: 0.7rem; color: #555;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mock-shorten-btn {
  padding: 8px 14px; border-radius: 6px;
  background: #f87171; color: #fff;
  font-size: 0.7rem; font-weight: 600;
  white-space: nowrap;
}
.mock-result {
  display: flex; gap: 6px; align-items: center;
}
.mock-short-url {
  flex: 1; padding: 8px 12px;
  background: rgba(248,113,113,0.06); border: 1px solid rgba(248,113,113,0.15);
  border-radius: 6px;
  font-size: 0.7rem; color: #888;
  font-family: 'JetBrains Mono', monospace;
}
.mock-short-url .highlight { color: #f87171; font-weight: 600; }
.mock-copy {
  padding: 8px 12px; border-radius: 6px;
  background: #1a1a1a; border: 1px solid #2a2a2a;
  font-size: 0.7rem; color: #555;
}
.mock-stats-row {
  display: flex; gap: 6px; align-items: flex-end;
  height: 50px; padding-top: 0.5rem;
}
.mock-stat-bar {
  flex: 1; height: var(--h, 50%);
  background: linear-gradient(to top, rgba(248,113,113,0.3), rgba(248,113,113,0.08));
  border-radius: 3px 3px 0 0;
}

/* Algos mock */
.mock-viz {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 0.5rem;
}
.mock-viz svg { width: 100%; max-width: 300px; }

/* Preview overlay */
.preview-overlay {
  position: absolute; inset: 0;
  background: rgba(5,5,5,0.6);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.live-card:hover .preview-overlay { opacity: 1; }
.preview-open {
  padding: 0.6rem 1.4rem;
  background: var(--white);
  color: var(--bg);
  font-size: 0.85rem; font-weight: 600;
  border-radius: 8px;
  transform: translateY(8px);
  transition: transform 0.3s;
}
.live-card:hover .preview-open { transform: translateY(0); }

/* Card info */
.live-card-info { padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.live-card-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.live-card-head h3 { font-size: 1.4rem; font-weight: 700; color: var(--white); }
.live-badge {
  font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.2rem 0.55rem; border-radius: 4px;
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.2);
}
.live-card-info > p {
  font-size: 0.9rem; color: var(--text-dim); line-height: 1.6;
  margin-bottom: 1rem;
}
.live-url {
  margin-top: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; color: var(--text-mute);
}

/* ── Tech Tags ── */
.tech-row {
  display: flex; flex-wrap: wrap; gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.tech-row span {
  font-size: 0.68rem; font-weight: 500;
  padding: 0.2rem 0.55rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════
   PROJECT CARDS (other projects)
   ═══════════════════════════════════════════ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex; flex-direction: column;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.project-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.project-card-link { cursor: pointer; }
.project-card-link:hover { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

.project-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.project-card h3 {
  font-size: 1.15rem; font-weight: 600; color: var(--white);
  margin-bottom: 0.5rem;
}
.external-icon { font-size: 0.85em; opacity: 0.5; }
.project-card > p {
  font-size: 0.88rem; color: var(--text-dim); line-height: 1.6;
  margin-bottom: 1rem; flex-grow: 1;
}
.project-card .live-url {
  margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════
   TECH STACK
   ═══════════════════════════════════════════ */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.stack-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.stack-group h4 {
  font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-mute);
  margin-bottom: 1rem;
}
.stack-items { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stack-chip {
  font-size: 0.82rem; font-weight: 500;
  padding: 0.35rem 0.8rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s;
}
.stack-chip:hover {
  background: rgba(255,255,255,0.08);
  border-color: #444;
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
}
.footer-name { font-weight: 600; font-size: 0.85rem; color: var(--text-dim); }
.footer-copy { font-size: 0.8rem; color: var(--text-mute); }

/* ═══════════════════════════════════════════
   SCROLL ANIMATIONS
   ═══════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .live-card {
    grid-template-columns: 1fr;
  }
  .live-card-preview {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: 200px;
  }
}

@media (max-width: 600px) {
  .hero { padding: 5rem 1rem 3rem; }
  .hero h1 { font-size: 2.2rem; }
  .hero-sub { font-size: 1rem; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-stats { gap: 1.2rem; }
  .stat-num { font-size: 1.4rem; }

  .section { padding: 4rem 0; }
  .section-header h2 { font-size: 1.6rem; }

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

  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.8rem; }

  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}
