/* ===== CSS VARIABLES ===== */
:root {
  --bg:           #0d0f14;
  --bg-2:         #111318;
  --bg-card:      #14161d;
  --border:       rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.16);

  --fg:           #e8eaf0;
  --fg-muted:     #6b7280;
  --fg-dim:       #3d4350;

  --accent:       #7eb8f7;   /* calm blue */
  --accent-2:     #a78bfa;   /* soft violet */
  --accent-3:     #34d399;   /* mint green for "live" */
  --accent-warn:  #fbbf24;   /* amber for WIP */

  --screen-fill:  rgba(126,184,247,0.03);

  --font-display: 'Syne', sans-serif;
  --font-mono:    'Space Mono', monospace;

  --radius:       6px;
  --radius-lg:    12px;
  --section-gap:  120px;
  --glow-blue:    rgba(126,184,247,0.15);
  --glow-violet:  rgba(167,139,250,0.10);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
svg { display: block; }

/* ===== NOISE OVERLAY ===== */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  background: rgba(13,15,20,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--fg);
}
.nav__links {
  display: flex;
  gap: 36px;
}
.nav__links a {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--fg-muted);
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--accent); }

.nav__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent-3);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-3);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}

/* Hamburger (mobile) */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  transition: transform 0.3s, opacity 0.3s;
}
.nav__hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav__hamburger.active span:nth-child(2) { opacity: 0; }
.nav__hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(13,15,20,0.97);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--accent); }
.mobile-menu__status {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--accent-3);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.btn--primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: transparent;
  color: var(--accent);
}
.btn--ghost {
  background: transparent;
  color: var(--fg-muted);
  border-color: var(--border);
}
.btn--ghost:hover {
  border-color: var(--fg-muted);
  color: var(--fg);
}
.btn--xs { padding: 6px 14px; font-size: 10px; }
.btn--sm { padding: 8px 18px; }

/* ===== TAGS / CHIPS ===== */
.tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
  background: rgba(126,184,247,0.08);
  color: var(--accent);
  border: 1px solid rgba(126,184,247,0.2);
  border-radius: 3px;
}
.tag--outline {
  background: transparent;
  color: var(--fg-muted);
  border-color: var(--border);
}
.chip {
  display: inline-block;
  padding: 3px 9px;
  font-size: 10px;
  letter-spacing: 0.08em;
  background: rgba(255,255,255,0.04);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 3px;
}

/* ===== SECTION COMMON ===== */
section {
  padding: var(--section-gap) 48px;
  max-width: 1200px;
  margin: 0 auto;
}
.section-header {
  margin-bottom: 56px;
}
.section-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--fg-muted);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.blink { animation: blink 1.1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  max-width: 100%;
  padding: 0 48px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  gap: 80px;
}

/* dot grid bg */
.hero__bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(126,184,247,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero__content {
  flex: 0 0 auto;
  max-width: 520px;
  position: relative;
  z-index: 1;
  padding-top: 80px;
}
.hero__label {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 62px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.hero__title-line {
  display: block;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s forwards;
}
.hero__title-line[data-line="1"] { animation-delay: 0.1s; }
.hero__title-line[data-line="2"] { animation-delay: 0.2s; }
.hero__title-line[data-line="3"] { animation-delay: 0.3s; }
.hero__title-line--accent {
  color: var(--accent);
  text-shadow: 0 0 30px rgba(126,184,247,0.3), 0 0 60px rgba(126,184,247,0.1);
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.hero__sub {
  color: var(--fg-muted);
  margin-bottom: 36px;
  font-size: 13px;
  line-height: 1.8;
}
.hero__actions {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
}
.hero__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  opacity: 0;
  animation: fadeUp 0.6s 0.5s forwards;
}
.hero__stack span {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  padding: 3px 0;
}
.hero__stack span::after { content: ' ·'; }
.hero__stack span:last-child::after { content: ''; }

/* ===== MONITOR SVG ===== */
.hero__visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  padding-top: 80px;
}
.monitor-svg {
  width: 100%;
  max-width: 420px;
  filter: drop-shadow(0 0 24px rgba(126,184,247,0.12));
  animation: floatMonitor 5s ease-in-out infinite;
}
@keyframes floatMonitor {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* SVG draw animation */
.draw {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 1.2s ease forwards;
}
.delay-1 { animation-delay: 0.3s; }
.delay-2 { animation-delay: 0.6s; }
.delay-3 { animation-delay: 0.9s; }
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* SVG text */
.code-text {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: var(--fg-muted);
  opacity: 0;
  animation: fadeIn 0.5s 1.2s forwards;
}
.code-comment { fill: var(--fg-dim); font-style: italic; }
.code-kw  { fill: var(--accent); }
.code-fn  { fill: var(--accent-2); }
.code-str { fill: var(--accent-3); }

@keyframes fadeIn { to { opacity: 1; } }

.cursor {
  opacity: 0;
  animation: fadeIn 0.1s 1.4s forwards, cursorBlink 1s 1.4s step-end infinite;
}
@keyframes cursorBlink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* floating shapes */
.float-el {
  animation: floatEl 4s ease-in-out infinite;
}
.float-el--2 { animation-delay: 1.5s; animation-duration: 5s; }
.float-el--3 { animation-delay: 0.8s; animation-duration: 6s; }
@keyframes floatEl {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-6px) rotate(5deg); }
}

/* scan line */
.scan-overlay {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.04) 3px,
    rgba(0,0,0,0.04) 4px
  );
  pointer-events: none;
  border-radius: 4px;
}

/* scroll hint */
.hero__scroll {
  position: absolute;
  bottom: 40px; left: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--fg-dim);
}
.scroll-line {
  width: 48px; height: 1px;
  background: var(--fg-dim);
  transform-origin: left;
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%   { transform: scaleX(0); opacity: 0; }
  50%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(0); opacity: 0; transform-origin: right; }
}

/* ===== MARQUEE STRIP ===== */
.marquee-strip {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  background: var(--bg-2);
}
.marquee-strip__inner {
  display: inline-flex;
  animation: marquee 30s linear infinite;
}
.marquee-strip__inner span {
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--fg-dim);
  padding: 0 24px;
}
.marquee-strip__inner .m-accent { color: var(--accent); }
.marquee-strip__inner .m-violet { color: var(--accent-2); }
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== PROJECTS ===== */
.projects { padding-top: var(--section-gap); }
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
}
.project-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px var(--glow-blue), 0 0 0 1px rgba(126,184,247,0.05);
}
.project-card__img {
  position: relative;
  height: 160px;
  background: linear-gradient(135deg, var(--bg-2), #1a1d27);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.project-card__placeholder {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
}
.project-card__logo {
  position: relative;
  z-index: 1;
  display: block;
  width: min(70%, 320px);
  max-height: 130px;
  object-fit: contain;
}
.project-card__logo--insomnia {
  width: auto;
  height: 72%;
  max-width: 72%;
  max-height: 150px;
  filter: drop-shadow(0 0 10px var(--glow-blue));
}
.project-card__img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(0,0,0,0.06) 3px, rgba(0,0,0,0.06) 4px
  );
}
.project-card__status {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 9px;
  letter-spacing: 0.15em;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  z-index: 1;
}
.project-card__status--live { background: rgba(52,211,153,0.15); color: var(--accent-3); border: 1px solid rgba(52,211,153,0.3); }
.project-card__status--wip  { background: rgba(251,191,36,0.12); color: var(--accent-warn); border: 1px solid rgba(251,191,36,0.25); }

.project-card__body { padding: 20px; }
.project-card__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.project-card__desc {
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.7;
  margin-bottom: 14px;
}
.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.project-card__links { display: flex; gap: 8px; }

.project-card--more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  border-style: dashed;
}
.project-card__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.project-card__more-icon {
  font-size: 32px;
  color: var(--fg-dim);
  font-family: var(--font-display);
}
.project-card--more p {
  font-size: 12px;
  color: var(--fg-muted);
}

/* ===== THE LAB ===== */
.lab {
  border-top: 1px solid var(--border);
}
.lab__grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.lab__category {
  background: var(--bg-card);
  padding: 36px 32px;
}
.lab__category--featured {
  background: rgba(126,184,247,0.04);
  border-left: 1px solid rgba(126,184,247,0.15);
  border-right: 1px solid rgba(126,184,247,0.15);
}
.lab__category-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
}
.lab__num {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-family: var(--font-mono);
}
.lab__category h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--fg);
}
.lab__category ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lab__category li {
  font-size: 13px;
  color: var(--fg-muted);
  padding-left: 16px;
  position: relative;
  transition: color 0.2s;
}
.lab__category li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--fg-dim);
  font-size: 10px;
}
.lab__category li:hover { color: var(--fg); }

/* ===== TERMINAL ===== */
.terminal-section { border-top: 1px solid var(--border); }
.terminal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 720px;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.terminal__dots {
  display: flex;
  gap: 6px;
}
.terminal__dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--fg-dim);
}
.terminal__dots span:nth-child(1) { background: #f87171; }
.terminal__dots span:nth-child(2) { background: var(--accent-warn); }
.terminal__dots span:nth-child(3) { background: var(--accent-3); }
.terminal__title {
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
}
.terminal__body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 240px;
  max-height: 420px;
  overflow-y: auto;
}
.terminal__body::-webkit-scrollbar { width: 4px; }
.terminal__body::-webkit-scrollbar-track { background: transparent; }
.terminal__body::-webkit-scrollbar-thumb { background: var(--fg-dim); border-radius: 2px; }
.terminal__line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.t-prompt {
  color: var(--accent-3);
  font-weight: 700;
  user-select: none;
}
.t-cmd { color: var(--fg); }
.terminal__output {
  color: var(--fg-muted);
  font-size: 13px;
  padding-left: 22px;
  margin-bottom: 4px;
  line-height: 1.8;
}
.t-link {
  color: var(--accent);
  border-bottom: 1px solid rgba(126,184,247,0.3);
  transition: border-color 0.2s;
}
.t-link:hover { border-color: var(--accent); }
.t-green { color: var(--accent-3); }
.terminal__line--active { margin-top: 4px; }
.t-cursor {
  color: var(--accent);
  animation: cursorBlink 1s step-end infinite;
  font-size: 16px;
  line-height: 1;
}
.terminal__cta {
  display: block;
  margin: 0 20px 20px;
  text-align: center;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
}
.footer__left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.1em;
}
.footer__copy {
  font-size: 11px;
  color: var(--fg-dim);
}
.footer__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
}
.footer__stack { color: var(--fg-muted); }

/* ===== SECTION GLOW ===== */
.projects { position: relative; }
.projects::before {
  content: '';
  position: absolute;
  top: -60px; right: -150px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--glow-blue) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.lab { position: relative; }
.lab::before {
  content: '';
  position: absolute;
  bottom: -60px; left: -150px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--glow-violet) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    padding: 100px 24px 60px;
    gap: 40px;
    text-align: center;
  }
  .hero__label { justify-content: center; }
  .hero__actions { justify-content: center; }
  .hero__stack { justify-content: center; }
  .hero__scroll { display: none; }
  .hero__visual { padding-top: 0; }

  .nav { padding: 16px 24px; }
  .nav__links { display: none; }
  .nav__status { display: none; }
  .nav__hamburger { display: flex; }
  section { padding: 80px 24px; }

  .lab__grid { grid-template-columns: 1fr; }
  .lab__category--featured { border: none; }

  .footer { flex-direction: column; gap: 16px; text-align: center; }
  .footer__right { align-items: center; }
}
