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

:root {
  --bg: #000;
  --s1: #060608;
  --s2: #0a0a0c;
  --b1: rgba(255,255,255,0.04);
  --b2: rgba(255,255,255,0.07);
  --t1: #fff;
  --t2: rgba(255,255,255,0.70);
  --t3: rgba(255,255,255,0.45);
  --t4: rgba(255,255,255,0.30);
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--sans); background: var(--bg); color: var(--t1); line-height: 1.5; }
a { color: inherit; text-decoration: none; }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; transition: background 0.4s, border-color 0.4s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(0,0,0,0.7); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom-color: var(--b1); }
.nav-inner { max-width: 1100px; margin: 0 auto; padding: 20px 40px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo svg { width: 22px; height: 22px; color: var(--t2); }
.nav-logo span { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; color: var(--t2); }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.06em; color: var(--t3); transition: color 0.3s; }
.nav-links a:hover { color: var(--t2); }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 5px; }
.nav-toggle span { display: block; width: 18px; height: 1px; background: var(--t2); transition: all 0.3s; }

/* Hero */
.hero { height: 100vh; min-height: 500px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-content { text-align: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.8rem, 7vw, 5.5rem); font-weight: 300; letter-spacing: -0.04em; color: var(--t1); line-height: 1; margin-bottom: 16px; }
.hero p { font-size: 0.85rem; font-weight: 300; color: var(--t2); }

/* Pixel animation */
.glitch { position: relative; display: inline-block; }
.glitch-canvas { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; image-rendering: pixelated; image-rendering: crisp-edges; }

/* Topo contour lines */
.topo-lines { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Binary rain (hero) */
.binary-rain { position: absolute; inset: 0; overflow: hidden; }
.binary-col { position: absolute; top: 0; font-family: var(--mono); font-size: 0.55rem; line-height: 1.6; color: rgba(255,255,255,0.04); writing-mode: vertical-lr; white-space: nowrap; animation: binaryDrift 20s linear infinite; }
@keyframes binaryDrift { from { transform: translateY(-50%); } to { transform: translateY(0); } }

/* Topo accent (section bg) */
.section--topo, .section--binary { position: relative; overflow: hidden; }
.topo-accent { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Binary texture (apps bg) */
.binary-texture { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.binary-row { position: absolute; font-family: var(--mono); font-size: 0.5rem; letter-spacing: 0.3em; color: rgba(255,255,255,0.025); white-space: nowrap; }

/* Sections */
.section { border-top: 1px solid var(--b1); }
.section-inner { max-width: 1100px; margin: 0 auto; padding: 120px 40px; }
.section-inner h2 { font-size: 0.6rem; font-family: var(--mono); font-weight: 400; letter-spacing: 0.2em; text-transform: uppercase; color: var(--t3); margin-bottom: 64px; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.about-text p { font-size: 0.95rem; font-weight: 300; color: var(--t2); line-height: 1.8; }
.about-disciplines { display: flex; flex-direction: column; }
.disc { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.04em; color: var(--t3); padding: 14px 0; border-bottom: 1px solid var(--b1); }
.disc:first-child { border-top: 1px solid var(--b1); }

/* Project */
.project { display: grid; grid-template-columns: 340px 1fr; gap: 64px; align-items: center; }
.project-tag { font-family: var(--mono); font-size: 0.5rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--t3); margin-bottom: 10px; }
.project h3 { font-size: 1.6rem; font-weight: 300; letter-spacing: -0.02em; color: var(--t1); margin-bottom: 16px; }
.project p { font-size: 0.85rem; font-weight: 300; color: var(--t2); line-height: 1.7; margin-bottom: 20px; }
.project-stack { display: flex; gap: 8px; flex-wrap: wrap; }
.project-stack span { font-family: var(--mono); font-size: 0.5rem; letter-spacing: 0.04em; color: var(--t3); padding: 3px 10px; border: 1px solid var(--b2); }

/* Terminal mock */
.term { background: var(--s1); border: 1px solid var(--b1); }
.term-bar { display: flex; gap: 5px; padding: 10px 14px; border-bottom: 1px solid var(--b1); }
.term-bar span { width: 6px; height: 6px; border-radius: 50%; background: var(--b2); }
.term-body { display: flex; height: 220px; }
.term-side { width: 160px; border-right: 1px solid var(--b1); padding: 12px 0; flex-shrink: 0; }
.ti { font-family: var(--mono); font-size: 0.55rem; color: var(--t4); padding: 4px 14px; }
.ti.folder { color: var(--t3); }
.ti.sub { padding-left: 28px; }
.ti.sel { color: var(--t2); background: rgba(255,255,255,0.02); }
.term-map { flex: 1; position: relative; background: var(--bg); overflow: hidden; }
.grid-bg { position: absolute; inset: 0; background: linear-gradient(var(--b1) 1px, transparent 1px), linear-gradient(90deg, var(--b1) 1px, transparent 1px); background-size: 40px 40px; opacity: 0.5; }
.term-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.term-coords { position: absolute; bottom: 6px; right: 10px; font-family: var(--mono); font-size: 0.5rem; color: var(--t4); }

/* Showcase */
.showcase { display: grid; grid-template-columns: auto 1fr; gap: 80px; align-items: center; }
.showcase-video { display: flex; justify-content: center; }
.showcase-info h3 { font-size: 1.6rem; font-weight: 300; letter-spacing: -0.02em; color: var(--t1); margin-bottom: 16px; }
.showcase-info p { font-size: 0.85rem; font-weight: 300; color: var(--t2); line-height: 1.7; margin-bottom: 20px; }
.showcase-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.showcase-header .project-tag { margin-bottom: 4px; }

/* App icon */
.app-icon { display: flex; align-items: center; justify-content: center; }
.app-icon svg { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--b2); }

/* Phone frame */
.phone-frame { position: relative; width: 280px; background: #0a0a0a; border: 2px solid rgba(255,255,255,0.08); border-radius: 36px; padding: 12px; box-shadow: 0 0 80px rgba(55,148,255,0.06), 0 40px 80px rgba(0,0,0,0.5); }
.phone-notch { width: 80px; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; margin: 0 auto 10px; }
.phone-frame video { width: 100%; border-radius: 24px; display: block; }

/* Contact */
.contact-inner { padding: 160px 40px; }
.contact-link { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--t2); border-bottom: 1px solid var(--t4); padding-bottom: 2px; transition: color 0.3s, border-color 0.3s; }
.contact-link:hover { color: var(--t1); border-color: var(--t2); }

/* Footer */
.footer { border-top: 1px solid var(--b1); }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 24px 40px; display: flex; align-items: center; justify-content: space-between; }
.footer-mark { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.1em; color: var(--t3); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-family: var(--mono); font-size: 0.55rem; letter-spacing: 0.06em; color: var(--t3); transition: color 0.3s; }
.footer-links a:hover { color: var(--t2); }
.footer-copy { font-family: var(--mono); font-size: 0.55rem; color: var(--t3); }

/* Reveal */
.rv { opacity: 0; transform: translateY(16px); transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1); }
.rv.v { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .project { grid-template-columns: 1fr; gap: 40px; }
  .showcase { grid-template-columns: 1fr; gap: 48px; justify-items: center; }
  .showcase-info { text-align: center; }
  .showcase-info .project-stack { justify-content: center; }
  .showcase-header { justify-content: center; }
}

@media (max-width: 680px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: rgba(0,0,0,0.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding: 20px 40px; gap: 14px; border-bottom: 1px solid var(--b1); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-toggle.open span:first-child { transform: translateY(3px) rotate(45deg); }
  .nav-toggle.open span:last-child { transform: translateY(-3px) rotate(-45deg); }
  .section-inner { padding: 80px 24px; }
  .contact-inner { padding: 100px 24px; }
  .nav-inner { padding: 16px 24px; }
  .term-side { width: 120px; }
  .footer-inner { flex-direction: column; gap: 16px; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: 16px; }
}
