/* ─────────────────────────────────────────────
   DESIGN TOKENS
   Central source of truth for the visual system.
   Change here; everything updates.
───────────────────────────────────────────── */
:root {
  /* Colors */
  --bg:          #0a0a0f;
  --surface:     #12121a;
  --surface-2:   #1a1a26;
  --border:      rgba(255, 255, 255, 0.07);
  --border-hover:rgba(255, 255, 255, 0.18);

  --accent:      #7c5cfc;       /* violet */
  --accent-dim:  rgba(124, 92, 252, 0.18);
  --accent-glow: rgba(124, 92, 252, 0.35);

  --green:       #3ab84e;
  --text-primary:   #f0eff6;
  --text-secondary: #8885a0;
  --text-muted:     #4e4c62;

  /* Typography */
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 24px;

  /* Transitions */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 180ms var(--ease);
  --t-med:  320ms var(--ease);
  --t-slow: 500ms var(--ease);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  /* Subtle noise grain for depth */
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 92, 252, 0.12), transparent),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

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

ul { list-style: none; }

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

/* ─────────────────────────────────────────────
   NAVBAR
───────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  /* Glass effect */
  background: rgba(10, 10, 15, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med), background var(--t-med);
}

/* Scrolled state added by JS */
.navbar.scrolled {
  border-bottom-color: var(--border);
  background: rgba(10, 10, 15, 0.85);
}

.navbar-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  border: 1px solid var(--accent-dim);
  padding: 0.3rem 0.6rem;
  border-radius: var(--r-sm);
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.navbar-logo:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* Desktop nav links */
.navbar-links {
  display: flex;
  gap: 2rem;
}

.navbar-links .nav-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: relative;
  transition: color var(--t-fast);
}

.navbar-links .nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 100%;
  height: 1px;
  background: var(--accent);
  transition: right var(--t-med);
}

.navbar-links .nav-link:hover,
.navbar-links .nav-link.active {
  color: var(--text-primary);
}

.navbar-links .nav-link:hover::after,
.navbar-links .nav-link.active::after {
  right: 0;
}

/* ─── Hamburger ─── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 1000;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--t-med), opacity var(--t-med);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Mobile drawer ─── */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 80vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 950;
  padding: 6rem 2rem 2rem;
  transform: translateX(100%);
  transition: transform var(--t-slow);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer ul {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-drawer .nav-link {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  transition: color var(--t-fast);
}
.mobile-drawer .nav-link:hover { color: var(--text-primary); }

/* Overlay behind drawer */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 940;
  opacity: 0;
  transition: opacity var(--t-med);
}
.drawer-overlay.open { opacity: 1; }

/* ─────────────────────────────────────────────
   HERO
───────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 8rem 2rem 5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  max-width: 720px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--green);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

/* Animated status dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58, 184, 78, 0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(58, 184, 78, 0); }
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 1.05;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 1rem;
  /* Staggered fade-in from JS class */
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.hero-name em {
  font-style: italic;
  color: var(--accent);
  display: block;
}

.hero-name.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--text-secondary);
  line-height: 1.3;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s 0.15s var(--ease), transform 0.7s 0.15s var(--ease);
}
.hero-tagline.visible { opacity: 1; transform: translateY(0); }

.hero-bio {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin-bottom: 2.5rem;
  line-height: 1.75;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s 0.3s var(--ease), transform 0.7s 0.3s var(--ease);
}
.hero-bio.visible { opacity: 1; transform: translateY(0); }

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s 0.45s var(--ease), transform 0.7s 0.45s var(--ease);
}
.hero-cta.visible { opacity: 1; transform: translateY(0); }

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.6rem;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  border: none;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  box-shadow: 0 8px 28px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--border-hover);
}

/* ─── Decorative lines ─── */
.hero-deco {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40%;
  pointer-events: none;
  display: flex;
  gap: 60px;
  justify-content: flex-end;
  overflow: hidden;
}

.deco-line {
  width: 1px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--border) 30%,
    var(--border) 70%,
    transparent 100%
  );
  opacity: 0.5;
}

/* ─────────────────────────────────────────────
   SHARED SECTION STYLES
───────────────────────────────────────────── */
.section {
  padding: var(--space-xl) 2rem;
}

.section-inner {
  max-width: 900px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

/* Accent underline on section titles */
.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent);
}

/* ─────────────────────────────────────────────
   SCROLL REVEAL
   Elements start invisible; JS adds .visible
───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

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

/* ─────────────────────────────────────────────
   SKILLS SECTION
───────────────────────────────────────────── */
.skills-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* Skill chips are injected by JS; style here */
.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
  cursor: default;
  /* Stagger set inline by JS */
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
              border-color var(--t-fast), color var(--t-fast);
}

.skill-chip.visible {
  opacity: 1;
  transform: scale(1);
}

.skill-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--accent-dim);
}

.skill-chip-icon {
  font-size: 0.9rem;
  line-height: 1;
}

/* ─────────────────────────────────────────────
   PROJECTS SECTION
───────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}

/* Cards are injected by JS; style here */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color var(--t-med), transform var(--t-med), box-shadow var(--t-med);
  cursor: default;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease),
              border-color var(--t-med), box-shadow var(--t-med);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-hover);
}

.project-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.project-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.25;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  flex: 1;
}

/* Tech stack tags inside cards */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.05em;
}

.project-links {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.project-link {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: color var(--t-fast);
}

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

/* ─────────────────────────────────────────────
   CONTACT SECTION
───────────────────────────────────────────── */
.contact-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.contact-inner {
  text-align: center;
}

.contact-inner .section-title::after {
  left: 50%;
  transform: translateX(-50%);
}

.contact-sub {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto 3rem;
  line-height: 1.75;
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Contact items injected by JS */
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}

.contact-item:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.contact-item svg {
  flex-shrink: 0;
  color: var(--accent);
}

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
.footer {
  padding: 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ─────────────────────────────────────────────
   RESPONSIVE — MOBILE FIRST
───────────────────────────────────────────── */

/* Hide desktop nav on small screens */
@media (max-width: 640px) {
  .navbar-links { display: none; }
  .hamburger    { display: flex; }
  .mobile-drawer { display: block; }

  .navbar { padding: 1rem 1.25rem; }

  .hero { padding: 7rem 1.25rem 4rem; }

  .hero-deco { display: none; }

  .section { padding: 5rem 1.25rem; }

  .contact-links { flex-direction: column; align-items: center; }
}

/* Fine-tune tablet */
@media (min-width: 641px) and (max-width: 900px) {
  .hero-name { font-size: clamp(2.8rem, 7vw, 5rem); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
