@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url('assets/fonts/poppins-400.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url('assets/fonts/poppins-500.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url('assets/fonts/poppins-600.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url('assets/fonts/poppins-700.woff2') format('woff2'); }

:root {
  --bg: #060409;
  --border: rgba(255, 255, 255, 0.08);
  --card: linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));

  --text: #f4f1f8;
  --text-2: #a39cad;
  --text-3: #6e6878;

  --accent: #b07cff;
  --accent-rgb: 176, 124, 255;

  --mono: ui-monospace, 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  --container: 1200px;
  --section-spacing: clamp(96px, 12vw, 160px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 85% 0%, rgba(var(--accent-rgb), 0.1), transparent 35%),
    radial-gradient(circle at 0% 100%, rgba(var(--accent-rgb), 0.06), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: 'Poppins', system-ui, sans-serif;
  overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

/* Ambient background: drifting blurred orbs, faint grid, film grain */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 10%, transparent 70%);
}

.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.07;
  mix-blend-mode: overlay;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

.orb-1 {
  top: -18vmax;
  right: -12vmax;
  width: 55vmax;
  height: 55vmax;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.55), transparent 65%);
  animation: drift-a 28s ease-in-out infinite alternate;
}

.orb-2 {
  bottom: -22vmax;
  left: -16vmax;
  width: 50vmax;
  height: 50vmax;
  background: radial-gradient(circle, rgba(176, 124, 255, 0.35), transparent 65%);
  animation: drift-b 34s ease-in-out infinite alternate;
}

.orb-3 {
  top: 30%;
  left: 35%;
  width: 34vmax;
  height: 34vmax;
  background: radial-gradient(circle, rgba(76, 29, 149, 0.45), transparent 65%);
  animation: drift-c 40s ease-in-out infinite alternate;
}

@keyframes drift-a { to { transform: translate(-14vmax, 10vmax) scale(1.15); } }
@keyframes drift-b { to { transform: translate(12vmax, -12vmax) scale(1.1); } }
@keyframes drift-c { to { transform: translate(-10vmax, -8vmax) scale(0.85); } }

a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, h3, p { margin: 0; }
::selection { background: rgba(var(--accent-rgb), 0.3); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

svg.lucide { width: 18px; height: 18px; flex-shrink: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 200;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.site-header.scrolled {
  background: rgba(6, 4, 9, 0.75);
  border-color: var(--border);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}

.logo { font-family: var(--mono); font-weight: 600; font-size: 1.05rem; }
.logo-mark { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 32px; font-size: 0.92rem; }

.nav-links a { color: var(--text-2); transition: color 0.25s ease; }
.nav-links a:hover { color: var(--text); }

.nav-links a span,
.mobile-menu-links a span {
  margin-right: 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.75em;
}

.nav-links .nav-cta {
  padding: 10px 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 10px;
  color: var(--text);
  transition: background 0.25s ease;
}

.nav-links .nav-cta:hover { background: rgba(var(--accent-rgb), 0.12); }

/* ---------- Mobile menu ---------- */
.mobile-toggle,
#mobile-close {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  cursor: pointer;
}

.mobile-toggle { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.mobile-toggle span { width: 18px; height: 2px; background: #fff; border-radius: 2px; }
#mobile-close { font-size: 1.4rem; }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  background: rgba(6, 4, 9, 0.97);
  backdrop-filter: blur(20px);
}

.mobile-menu.active { opacity: 1; visibility: visible; }
.mobile-menu-inner { height: 100%; display: flex; flex-direction: column; padding: 16px; }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; }

.mobile-menu-header span {
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mobile-menu-links { display: flex; flex-direction: column; gap: 20px; margin: auto 0; }
.mobile-menu-links a { font-size: clamp(2rem, 9vw, 3.5rem); font-weight: 600; letter-spacing: -0.04em; }

/* ---------- Hero ---------- */
.hero { padding: 168px 0 var(--section-spacing); }

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 32px;
  align-items: center;
}

.hero-copy { grid-column: span 7; }
.terminal { grid-column: span 5; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-size: 0.85rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); } }

.hero h1 {
  margin-top: 44px;
  font-size: clamp(4rem, 11vw, 8.5rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.hero h1 span {
  display: block;
  margin-top: 0.75em;
  font-size: 0.42em;
  line-height: 1.15;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, var(--accent), #e2d2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-text {
  max-width: 52ch;
  margin-top: 28px;
  color: var(--text-2);
  font-size: 1.1rem;
  line-height: 1.8;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 22px;
  border-radius: 12px;
  font-weight: 600;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.button:hover { transform: translateY(-3px); }
.button-primary { background: var(--accent); color: #0b0612; }
.button-primary:hover { box-shadow: 0 12px 32px rgba(var(--accent-rgb), 0.35); }
.button-ghost { border: 1px solid var(--border); color: var(--text); }
.button-ghost:hover { background: rgba(255, 255, 255, 0.05); }

/* Terminal */
.terminal {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(12, 9, 18, 0.8);
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(var(--accent-rgb), 0.06);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.92rem;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.terminal-bar span:first-child { background: var(--accent); }
.terminal-bar p { margin-left: auto; color: var(--text-3); font-size: 0.8rem; }

.terminal-body { display: flex; flex-direction: column; gap: 6px; padding: 24px; }
.terminal-body b { color: var(--accent); font-weight: 400; }
.terminal-body .out { margin-bottom: 10px; color: var(--text-2); }
.terminal-body em { color: var(--text-3); font-style: normal; }

.cursor {
  display: inline-block;
  width: 9px;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sections (editorial split) ---------- */
.section { padding: var(--section-spacing) 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }

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

.section-side { grid-column: span 4; align-self: start; position: sticky; top: 120px; }
.section-main { grid-column: span 8; }

.section-index {
  display: block;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.section-index::after { content: ' /'; color: var(--text-3); }

.section-side h2 {
  margin-top: 14px;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 1.4;
  letter-spacing: -0.05em;
}

.lead {
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  line-height: 1.7;
  color: var(--text);
}

/* Skills list */
.skill-list {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.skill-list li { display: flex; }
.skill-list li:nth-child(n + 3) { border-top: 1px solid var(--border); }
.skill-list li:nth-child(even) { border-left: 1px solid var(--border); }

.skill-card {
  flex: 1;
  display: flex;
  gap: 18px;
  padding: 28px 32px;
  transition: background 0.25s ease;
}

.skill-card:hover { background: rgba(var(--accent-rgb), 0.05); }

.skill-card > span {
  padding-top: 5px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.skill-list h3 { font-size: 1.3rem; letter-spacing: -0.02em; }
.skill-list p { margin-top: 6px; color: var(--text-2); line-height: 1.6; }

/* Stack table */
.stack-table {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  backdrop-filter: blur(14px);
}

.stack-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: center;
  padding: 28px 32px;
}

.stack-row + .stack-row { border-top: 1px solid var(--border); }
.stack-row h3 { color: var(--text-2); font-family: var(--mono); font-size: 0.85rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.1em; }

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

.stack-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.95rem;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.stack-item svg { color: var(--accent); }
.stack-item:hover { border-color: rgba(var(--accent-rgb), 0.35); background: rgba(var(--accent-rgb), 0.07); }

/* Project card */
.project-card {
  position: relative;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--card);
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto auto;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.18), transparent 65%);
  pointer-events: none;
}

.project-card:hover { border-color: rgba(var(--accent-rgb), 0.35); transform: translateY(-4px); }

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

.project-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
}

.project-icon svg { width: 24px; height: 24px; }

.role {
  padding: 6px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 999px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.project-card h3 { margin-top: 32px; font-size: clamp(1.8rem, 3vw, 2.4rem); letter-spacing: -0.04em; }
.project-card > p { max-width: 55ch; margin-top: 12px; color: var(--text-2); line-height: 1.8; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 28px 0 0; padding: 0; }

.tags li {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* Contact */
.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(32px, 5vw, 56px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  backdrop-filter: blur(14px);
}

.contact-card > p { max-width: 36ch; color: var(--text-2); line-height: 1.7; }

.contact-handle {
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  cursor: pointer;
  transition: color 0.25s ease;
}

.contact-handle:hover { color: var(--accent); }

.copy-status { min-height: 1.5em; margin-top: 14px; color: var(--accent); font-size: 0.9rem; }

/* Footer */
.site-footer { padding: 32px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; color: var(--text-3); font-size: 0.9rem; }
.footer-inner a { color: var(--text-2); }
.footer-inner a:hover { color: var(--accent); }

/* Legal page */
.legal { padding: 160px 0 100px; }
.legal .container { max-width: 760px; }
.legal h1 { margin: 14px 0 48px; font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.4; letter-spacing: -0.05em; }
.legal h2 { margin: 48px 0 12px; font-size: 1.3rem; }
.legal p, .legal li { color: var(--text-2); line-height: 1.8; }
.legal a { color: var(--accent); text-decoration: underline; }
.legal .back { margin-top: 48px; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.visible { opacity: 1; transform: none; }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .status-dot, .cursor, .orb { animation: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .hero-copy, .terminal { grid-column: 1 / -1; }
  .terminal { max-width: 560px; }
  .section-side, .section-main { grid-column: 1 / -1; }
  .section-side { position: static; }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-toggle { display: flex; }
  .hero { padding-top: 132px; }
  .hero-text { font-size: 1rem; }
  .hero-actions .button { flex: 1 1 100%; }
  .skill-list { grid-template-columns: 1fr; }
  .skill-list li:nth-child(even) { border-left: 0; }
  .skill-list li + li { border-top: 1px solid var(--border); }
  .stack-row { grid-template-columns: 1fr; gap: 14px; padding: 24px; }
  .project-card { padding: 28px; }
  .footer-inner { flex-direction: column; }
  .contact-card { flex-direction: column; align-items: flex-start; gap: 24px; }
}
