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

:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --surface: #16161f;
  --surface2: #1e1e2e;
  --border: rgba(255,255,255,0.07);
  --text: #e2e2f0;
  --muted: #6b6b8a;
  --accent: #6366f1;
  --accent2: #8b5cf6;
  --green: #10b981;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 16px;
  --radius-sm: 10px;
}

html { scroll-behavior: smooth; }

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

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

/* ── Custom Cursor ── */
#cursor {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  transition: width 0.2s, height 0.2s, opacity 0.2s;
}

#cursor-follower {
  width: 36px; height: 36px;
  border: 1.5px solid rgba(99,102,241,0.5);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s;
}

/* cursor states set via JS classes — no :has() jank */
#cursor.on-btn    { width: 0; height: 0; opacity: 0; }
#cursor-follower.on-btn { width: 56px; height: 56px; border-color: var(--accent); }

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  background: rgba(10,10,15,0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-links {
  display: flex;
  gap: 32px;
}
.nav-links a {
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.2s;
  cursor: none;
}
.nav-links a:hover { color: var(--text); }

/* ── Magnetic Button ── */
.magnetic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  border: none;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
  white-space: nowrap;
  /* magnetic transform handled by JS — no CSS transition on transform here */
}

.magnetic-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.06);
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: inherit;
  pointer-events: none;
}
.magnetic-btn:hover::before { opacity: 1; }

.magnetic-btn.primary {
  background: var(--accent);
  color: #fff;
}
.magnetic-btn.primary:hover { box-shadow: 0 0 32px rgba(99,102,241,0.5); }

.magnetic-btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.magnetic-btn.ghost:hover { border-color: rgba(255,255,255,0.25); }

.magnetic-btn.nav-cta {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 20px;
  font-size: 0.85rem;
}

.magnetic-btn.sm { padding: 8px 18px; font-size: 0.85rem; }

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  padding: 120px 48px 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--green);
  margin-bottom: 24px;
}

.badge-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}

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

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2), #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 440px;
  margin-bottom: 36px;
}

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

/* ── Code Window ── */
.hero-code-window { display: flex; justify-content: center; }

.code-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
}

.code-window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }

.code-window-title {
  margin-left: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--mono);
}

.code-content {
  padding: 20px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #cdd6f4;
  min-height: 220px;
  white-space: pre;
  overflow: hidden;
}

.t-kw   { color: #cba6f7; }
.t-fn   { color: #89b4fa; }
.t-str  { color: #a6e3a1; }
.t-num  { color: #fab387; }
.t-cm   { color: #585b70; }
.t-type { color: #f38ba8; }
.t-prop { color: #89dceb; }

.cursor-blink {
  display: inline-block;
  width: 2px; height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Scroll hint ── */
.hero-scroll-hint {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, transparent, var(--muted));
  animation: scroll-line 2s ease-in-out infinite;
}

@keyframes scroll-line {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ── Marquee ── */
.marquee-section {
  overflow: hidden;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

.marquee-track { overflow: hidden; }

.marquee-inner {
  display: flex;
  gap: 32px;
  width: max-content;
  animation: marquee 30s linear infinite;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.marquee-inner span:not(:nth-child(even)) { color: var(--text); }
.marquee-inner span:nth-child(even) { color: var(--accent); opacity: 0.5; }

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

/* ── Section Shared ── */
.section-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* ── Bento Grid ── */
.bento-section { padding: 100px 48px; }
.section-header { margin-bottom: 48px; }

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.bento-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.3s;
}
.bento-card:hover { border-color: rgba(255,255,255,0.15); }

.bento-card-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 80% 20%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
  pointer-events: none;
}

.bento-large { grid-column: span 7; }
.bento-tall  { grid-column: span 5; grid-row: span 2; }
.bento-small { grid-column: span 3; }
.bento-wide  { grid-column: span 9; }

/* ── Bento image slots ── */
.bento-img-wrap {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface2);
  border: 1px dashed rgba(255,255,255,0.1);
  position: relative;
  flex-shrink: 0;
}

.bento-img-wide { height: 140px; }

.bento-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.bento-card:hover .bento-img { transform: scale(1.04); }

/* placeholder shown when src is empty */
.bento-img-wrap:has(img[src=""]) {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bento-img-wrap:has(img[src=""])::after {
  content: attr(data-label);
  font-size: 0.75rem;
  color: var(--muted);
  position: absolute;
}
.bento-img[src=""] { opacity: 0; }

.bento-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface2);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid var(--border);
  width: fit-content;
}

.bento-card-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.bento-card-content p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
}

.bento-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.bento-stack span {
  font-size: 0.75rem;
  padding: 3px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--muted);
}

.bento-link {
  margin-top: auto;
  width: fit-content;
  padding: 8px 18px;
  font-size: 0.82rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}

/* ── Gallery ── */
.gallery-section {
  padding: 100px 48px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 260px;
  gap: 12px;
  margin-top: 48px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px dashed rgba(255,255,255,0.08);
  cursor: none;
}

.gallery-item.gallery-tall  { grid-row: span 2; }
.gallery-item.gallery-wide  { grid-column: span 2; }

.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.06); }

/* placeholder for empty gallery images */
.gallery-item:has(img[src=""])::before {
  content: '+ Add image';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  z-index: 1;
}
.gallery-item img[src=""] { opacity: 0; }

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.3s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

.gallery-overlay span {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
}

/* ── Reveal animation ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].revealed { opacity: 1; transform: translateY(0); }

/* ── About Section ── */
.about-section {
  padding: 100px 48px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

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

.about-text p {
  color: var(--muted);
  margin-bottom: 16px;
  max-width: 480px;
}

.about-actions { display: flex; gap: 12px; margin-top: 32px; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.3s;
}
.stat-card:hover { border-color: rgba(255,255,255,0.15); }

.stat-value {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--text), var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-suffix {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.stat-label { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

/* ── Contact ── */
.contact-section { padding: 120px 48px; text-align: center; }

.contact-inner {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.contact-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.contact-sub { color: var(--muted); font-size: 1rem; }

/* ── Contact Cards ── */
.contact-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.contact-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
  border-radius: 100px;
}
.contact-card:hover {
  border-color: rgba(255,255,255,0.2);
  background: var(--surface2);
}
.contact-card svg { color: var(--accent); flex-shrink: 0; }

/* ── Footer ── */
.footer {
  padding: 24px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Float animation ── */
[data-float] { animation: float 6s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; padding: 100px 32px 80px; }
  .hero-code-window { display: none; }
  .bento-large { grid-column: span 12; }
  .bento-tall  { grid-column: span 12; grid-row: span 1; }
  .bento-small { grid-column: span 6; }
  .bento-wide  { grid-column: span 12; }
  .about-grid  { grid-template-columns: 1fr; gap: 48px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav { padding: 16px 20px; }
  .nav-links { display: none; }
  .hero { padding: 90px 20px 60px; }
  .bento-section, .about-section, .contact-section, .gallery-section { padding: 60px 20px; }
  .bento-small { grid-column: span 12; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer { flex-direction: column; gap: 8px; padding: 20px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item.gallery-tall, .gallery-item.gallery-wide { grid-column: span 1; grid-row: span 1; }
}
