:root {
  --bg: #07080a;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.065);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent-1: #a78bfa;
  --accent-2: #38bdf8;
  --accent-3: #34d399;
  --radius: 20px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Subtle background glow & grain */
.cursor-glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(167, 139, 250, 0.14) 0%,
    rgba(56, 189, 248, 0.07) 40%,
    transparent 70%
  );
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: opacity 0.3s ease;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: radial-gradient(#ffffff 0.75px, transparent 0.75px);
  background-size: 24px 24px;
}

main,
.header,
.footer {
  position: relative;
  z-index: 2;
}

/* Header */
.header {
  position: sticky;
  top: 16px;
  max-width: 1120px;
  margin: 16px auto 0;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(12, 14, 18, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.7);
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--text);
}

.nav .nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

.nav .nav-cta:hover {
  color: var(--bg);
  opacity: 0.9;
}

.menu-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 36px;
  height: 36px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease;
}

/* Hero */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 96px 24px 72px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6.2vw, 5.1rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  max-width: 920px;
  margin-bottom: 24px;
}

.gradient-text {
  background: linear-gradient(120deg, #ffffff 10%, var(--accent-1) 55%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.02rem, 1.8vw, 1.25rem);
  color: var(--muted);
  max-width: 600px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 64px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-hover);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  max-width: 680px;
}

.meta-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
}

.meta-label {
  font-size: 0.85rem;
  color: var(--muted);
}

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

.marquee-track {
  display: flex;
  gap: 32px;
  width: max-content;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  color: var(--muted);
  animation: marquee 28s linear infinite;
}

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

/* Sections */
.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 24px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 36px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 8px;
  font-weight: 600;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.7rem);
  letter-spacing: -0.02em;
}

/* Filter */
.filter-group {
  display: flex;
  gap: 8px;
  background: var(--surface);
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.filter-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--text);
  color: var(--bg);
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--surface-hover);
}

.project-card.is-hidden {
  display: none;
}

.project-thumb {
  height: 230px;
  padding: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.thumb-1 {
  background: linear-gradient(135deg, #16132b, #0c1824);
}
.thumb-2 {
  background: linear-gradient(135deg, #0b1b26, #171429);
}
.thumb-3 {
  background: linear-gradient(135deg, #161618, #0d0e11);
}
.thumb-4 {
  background: linear-gradient(135deg, #10201a, #111827);
}

.project-tag {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(7, 8, 10, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  color: var(--text);
  backdrop-filter: blur(8px);
}

.thumb-art {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
}

.orb {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.75;
  transition: transform 0.4s ease;
}

.project-card:hover .orb {
  transform: scale(1.15);
}

.orb-a {
  background: radial-gradient(circle, var(--accent-1), var(--accent-2));
}

.orb-b {
  background: radial-gradient(circle, var(--accent-3), var(--accent-2));
}

.grid-lines {
  position: absolute;
  inset: -20px;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.16) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle, black 35%, transparent 75%);
}

.ring {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.08);
}

.glass-chip {
  position: absolute;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
}

.project-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-top h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.project-year {
  font-size: 0.82rem;
  color: var(--muted);
}

.project-body p {
  color: var(--muted);
  font-size: 0.94rem;
  flex: 1;
}

.project-link {
  align-self: flex-start;
  background: none;
  border: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.project-link:hover {
  color: var(--accent-2);
  transform: translateX(3px);
}

/* Bento */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bento-large {
  grid-column: span 2;
  grid-row: span 2;
  justify-content: space-between;
  background: linear-gradient(145deg, rgba(167, 139, 250, 0.09), rgba(255, 255, 255, 0.02));
}

.bento-large h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.2;
}

.bento-wide {
  grid-column: span 3;
}

.bento-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.bento-big {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
}

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

.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stack-pills span {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.88rem;
}

/* Contact */
.contact-card {
  padding: 52px 32px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: radial-gradient(
    circle at top right,
    rgba(56, 189, 248, 0.14),
    rgba(167, 139, 250, 0.06) 45%,
    var(--surface) 100%
  );
  text-align: center;
}

.contact-card h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
}

.contact-card p {
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 28px;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.copy-hint {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(7, 8, 10, 0.12);
}

/* Footer */
.footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 7, 0.76);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 50;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 520px;
  background: #101217;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.modal p {
  color: var(--muted);
  margin-bottom: 18px;
}

.modal-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.modal-metrics span {
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.modal-note {
  font-size: 0.82rem;
  color: var(--muted);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

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

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

@media (max-width: 860px) {
  .projects-grid,
  .bento-grid {
    grid-template-columns: 1fr;
  }

  .bento-large,
  .bento-wide {
    grid-column: span 1;
    grid-row: span 1;
  }
}

@media (max-width: 720px) {
  .header {
    margin: 12px 16px 0;
    border-radius: 18px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #101217;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    display: none;
  }

  .nav.open {
    display: flex;
  }

  .nav .nav-cta {
    text-align: center;
  }

  .hero-meta {
    grid-template-columns: 1fr;
  }
}
