/* ============================================================
   Design Tokens
============================================================ */
:root {
  --bg:           #141414;
  --bg-surface:   #1c1c1c;
  --bg-elevated:  #242424;
  --text:         #E8E2D5;
  --text-muted:   #807A70;
  --accent:       #CAFF47;
  --accent-dim:   #a8d936;
  --border:       rgba(232, 226, 213, 0.08);
  --border-hover: rgba(202, 255, 71, 0.2);

  --font-display: 'Syne', sans-serif;
  --font-body:    'Manrope', sans-serif;

  --radius:       12px;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --transition:   all 0.3s var(--ease);
}

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

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

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

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
}

/* ============================================================
   Custom Cursor
============================================================ */
.cursor {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s;
}

.cursor-follower {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), opacity 0.3s;
}

.cursor.is-hovering          { width: 14px; height: 14px; }
.cursor-follower.is-hovering { width: 56px; height: 56px; opacity: 0.25; }

/* ============================================================
   Navigation
============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 3rem;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.nav.scrolled {
  background: rgba(20, 20, 20, 0.8);
  border-bottom-color: var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.4rem;
  border-radius: 100px;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: var(--transition);
}
.nav-cta:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
}

/* ============================================================
   Utility
============================================================ */
.accent      { color: var(--accent); }
.accent-text { color: var(--accent); }

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.section-tag::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  display: block;
}
.section-tag.light         { color: rgba(255,255,255,0.4); }
.section-tag.light::before { background: var(--accent); }

/* ============================================================
   Reveal Animation
============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Hero
============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 3rem 5rem;
  position: relative;
  overflow: hidden;
}

/* ambient glow */
.hero::after {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(202,255,71,0.05) 0%, transparent 65%);
  right: -150px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.6s var(--ease) forwards 0.2s;
}

.dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.5rem, 9vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}

.hero-title .line            { display: block; opacity: 0; }
.hero-title .line:nth-child(1) { animation: fadeUp 0.7s var(--ease) forwards 0.4s; }
.hero-title .line:nth-child(2) { animation: fadeUp 0.7s var(--ease) forwards 0.55s; }
.hero-title .line:nth-child(3) { animation: fadeUp 0.7s var(--ease) forwards 0.7s; }

.hero-desc {
  max-width: 460px;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) forwards 0.85s;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-bottom: 4.5rem;
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) forwards 1s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.875rem 2rem;
  border-radius: 100px;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: var(--transition);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(202,255,71,0.22);
}

.btn-ghost {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: var(--transition);
}
.btn-ghost:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.hero-stats {
  display: flex;
  gap: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
  opacity: 0;
  animation: fadeUp 0.7s var(--ease) forwards 1.15s;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 0.35rem;
}

/* ============================================================
   About
============================================================ */
.about {
  padding: 9rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
}

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

.about-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.about-content p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-size: 0.975rem;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.skill-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  transition: var(--transition);
}
.skill-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   Work
============================================================ */
.work {
  padding: 0 3rem 9rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 3.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(202,255,71,0.03) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.project-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 24px 72px rgba(0,0,0,0.5);
}
.project-card:hover::before { opacity: 1; }

.project-num {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.project-img {
  width: 100%;
  height: 150px;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}
.project-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.02));
}

.project-img--green { background: #141f14; }
.project-img--blue  { background: #14141f; }
.project-img--red   { background: #1f1414; }

.project-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.65rem;
}

.project-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.project-tags {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.project-tags span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  background: var(--bg-elevated);
  border-radius: 100px;
  color: var(--text-muted);
}

.project-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: opacity 0.2s;
}
.project-link:hover { opacity: 0.7; text-decoration: underline; }

/* ============================================================
   Contact
============================================================ */
.contact {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.contact-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 9rem 3rem;
  text-align: center;
}

.contact-inner h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.contact-inner p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 2.5rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.email-link {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 3vw, 1.9rem);
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
  margin-bottom: 3rem;
  transition: var(--transition);
}
.email-link:hover { opacity: 0.7; transform: translateY(-2px); }

.social-links {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  list-style: none;
}

.social-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.social-links a:hover { color: var(--text); }

/* ============================================================
   Footer
============================================================ */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 3rem;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.back-top {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}
.back-top:hover { color: var(--accent); }

/* ============================================================
   Keyframes
============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   Responsive
============================================================ */
@media (max-width: 1024px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid    { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 768px) {
  .nav          { padding: 1rem 1.5rem; }
  .nav-links    { display: none; }

  .hero,
  .about        { padding: 7rem 1.5rem 4rem; }
  .work         { padding: 0 1.5rem 6rem; }
  .contact-inner { padding: 6rem 1.5rem; }
  .footer       { padding: 1.5rem; flex-direction: column; gap: 0.75rem; text-align: center; }

  .hero-stats   { gap: 2rem; }
  .stat-num     { font-size: 1.6rem; }

  .projects-grid { grid-template-columns: 1fr; }

  /* disable custom cursor on touch */
  .cursor,
  .cursor-follower { display: none; }
  body { cursor: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
