/* ═══════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ═══════════════════════════════════════
   TOKENS
   ═══════════════════════════════════════ */
:root {
  --bg: #08080e;
  --bg-section: #0e0d16;
  --bg-card: #12111a;
  --text: #d4d4dc;
  --text-bright: #eeeef2;
  --text-muted: rgba(212, 212, 220, 0.45);
  --text-dim: rgba(212, 212, 220, 0.3);
  --accent: #5b8def;
  --accent-dim: rgba(91, 141, 239, 0.25);
  --accent-glow: rgba(91, 141, 239, 0.06);
  --accent-bright: #7ba5ff;
  --border: rgba(212, 212, 220, 0.08);
  --border-hover: rgba(212, 212, 220, 0.15);
}

/* ═══════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════ */
.t-hero {
  font-weight: 700;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1;
  letter-spacing: -2px;
  color: var(--text-bright);
}
.t-section {
  font-weight: 700;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -1px;
  color: var(--text-bright);
}
.t-label {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
}
.t-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
}

/* ═══════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════ */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
section {
  position: relative;
  padding: 120px 0;
}

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes shimmer-line {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
/* CRT animations handled entirely by canvas */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }

/* ═══════════════════════════════════════
   HERO
   ═══════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

/* CRT canvas — full bleed, behind content */
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.hero-inner {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-name {
  animation: fade-in-up 0.8s ease both;
  /* Chromatic aberration */
  text-shadow:
    -1.5px 0 rgba(91, 141, 239, 0.2),
    1.5px 0 rgba(239, 91, 91, 0.12);
}
.hero-tagline {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 400;
  color: var(--text-muted);
  max-width: 640px;
  margin-top: 20px;
  line-height: 1.5;
  animation: fade-in-up 0.8s ease 0.15s both;
}
.hero-tagline strong {
  color: var(--text);
  font-weight: 500;
}
.cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
.hero-links {
  display: flex;
  gap: 24px;
  margin-top: 48px;
  flex-wrap: wrap;
  animation: fade-in-up 0.8s ease 0.3s both;
}
.hero-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}
.hero-link:hover {
  color: var(--accent);
}
.hero-link-label {
  color: var(--text-dim);
}

/* Scroll indicator */
.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.2;
  animation: fade-in-up 1s ease 1.2s both;
}
.scroll-hint span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text-dim);
}
.scroll-arrow {
  width: 1px;
  height: 24px;
  background: linear-gradient(to bottom, var(--text-dim), transparent);
}

/* ═══════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════ */
.section-label {
  margin-bottom: 16px;
}
.section-title {
  margin-bottom: 48px;
}
.section-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.section-divider::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 60px;
  height: 1px;
  background: var(--accent-dim);
}

/* ═══════════════════════════════════════
   IDENTITY
   ═══════════════════════════════════════ */
.identity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-top: 48px;
}
.identity-card {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}
.identity-card h3 {
  font-weight: 600;
  font-size: 18px;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.identity-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ═══════════════════════════════════════
   WHAT I DO
   ═══════════════════════════════════════ */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-top: 48px;
}
.pillar h3 {
  font-weight: 600;
  font-size: 20px;
  color: var(--text-bright);
  margin-bottom: 16px;
}
.pillar p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ═══════════════════════════════════════
   CAREER TIMELINE
   ═══════════════════════════════════════ */
.timeline {
  margin-top: 48px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  align-items: baseline;
}
.timeline-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  padding-top: 2px;
}
.timeline-content h3 {
  font-weight: 600;
  font-size: 18px;
  color: var(--text-bright);
  display: inline;
}
.timeline-role {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 8px;
}
.timeline-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.project-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 40px var(--accent-glow);
}
.project-card h3 {
  font-weight: 600;
  font-size: 18px;
  color: var(--text-bright);
  margin-bottom: 8px;
}
.project-card h3 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.project-card h3 a:hover {
  color: var(--accent);
}
.project-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.project-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════
   BRAND LOGOS (LEONI / CODEX)
   ═══════════════════════════════════════ */
.brand-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
  flex-wrap: wrap;
  column-gap: 8px;
}
.brand-leoni {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 3px;
  background: linear-gradient(160deg, #E8C060 0%, #C47A5A 60%, #A07828 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-codex {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 3px;
  background: linear-gradient(160deg, #E8C060 0%, #C8A040 35%, #F0D080 55%, #A07828 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-suffix {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 1px;
  opacity: 0.4;
  color: var(--text-bright);
  -webkit-text-fill-color: initial;
}
.brand-amp {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 13px;
  opacity: 0.3;
  color: var(--text-bright);
  -webkit-text-fill-color: initial;
}
.brand-logo:hover .brand-leoni,
.brand-logo:hover .brand-codex {
  filter: brightness(1.15);
}
.brand-logo:hover .brand-suffix,
.brand-logo:hover .brand-amp {
  opacity: 0.6;
}

/* ═══════════════════════════════════════
   STACK
   ═══════════════════════════════════════ */
.stack-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin-top: 48px;
}
.stack-group h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.stack-group p {
  font-size: 15px;
  color: var(--text);
  line-height: 1.8;
}
.stack-group span {
  color: var(--text-muted);
}
.stack-group .separator {
  color: var(--text-dim);
  margin: 0 2px;
}

/* ═══════════════════════════════════════
   BEYOND CODE
   ═══════════════════════════════════════ */
.beyond-text {
  max-width: 720px;
  margin-top: 48px;
}
.beyond-text p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
}
.beyond-text em {
  color: var(--text);
  font-style: normal;
  font-weight: 500;
}

/* ═══════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════ */
.contact-section {
  padding: 120px 0 80px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 48px;
}
.contact-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.2s;
}
.contact-item:hover {
  border-color: var(--accent-dim);
}
.contact-item-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
}
.contact-item-value {
  font-size: 15px;
  color: var(--text);
  transition: color 0.2s;
}
.contact-item:hover .contact-item-value {
  color: var(--accent);
}
.contact-availability {
  margin-top: 48px;
  font-size: 14px;
  color: var(--text-dim);
}
.contact-availability a {
  color: var(--accent);
  text-decoration: none;
}
.contact-availability a:hover {
  text-decoration: underline;
}

/* Footer */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}
.footer p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* ═══════════════════════════════════════
   LANGUAGE TOGGLE
   ═══════════════════════════════════════ */
.lang-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(8, 8, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.lang-toggle a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 14px;
  color: var(--text-dim);
  transition: color 0.2s, background 0.2s;
}
.lang-toggle a:hover {
  color: var(--text);
  background: rgba(212, 212, 220, 0.04);
}
.lang-toggle a.active {
  color: var(--accent);
  background: var(--accent-glow);
  pointer-events: none;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
  section {
    padding: 80px 0;
  }
  .pillars {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .stack-groups {
    grid-template-columns: 1fr;
  }
  .timeline-item {
    grid-template-columns: 60px 1fr;
    gap: 16px;
  }
  .identity-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero {
    padding: 60px 0;
  }
  .scroll-hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .identity-grid {
    grid-template-columns: 1fr;
  }
  .hero-links {
    flex-direction: column;
    gap: 12px;
  }
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}
