/* ---------- Theme ---------- */
:root {
  --bg: #0b0d12;
  --bg-2: #12151c;
  --text: #e8eaf0;
  --muted: #8b92a5;
  --accent: #6ee7b7;      /* change this one color to re-theme the whole site */
  --accent-2: #60a5fa;
  --border: #1f2430;
  --radius: 14px;
}
:root[data-theme="light"] {
  --bg: #f5f7f8;
  --bg-2: #ffffff;
  --text: #17211d;
  --muted: #53645d;
  --border: #cbd8d2;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image: linear-gradient(rgba(110, 231, 183, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(110, 231, 183, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 75% 12%, rgba(96, 165, 250, 0.12), transparent 26%), radial-gradient(circle at 12% 72%, rgba(110, 231, 183, 0.08), transparent 24%); z-index: 0; }
body.page-load { opacity: 0; }
body.page-loaded { opacity: 1; transition: opacity 0.45s ease; }

a { color: inherit; text-decoration: none; }
.accent { color: var(--accent); }

/* ---------- Cursor glow ---------- */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 500px; height: 500px;
  margin: -250px 0 0 -250px;
  background: radial-gradient(circle, rgba(110, 231, 183, 0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
  transition: transform 0.1s linear;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px max(6vw, calc((100vw - 1200px) / 2));
  backdrop-filter: blur(12px);
  background: rgba(11, 13, 18, 0.7);
  border-bottom: 1px solid var(--border);
}
.nav::after { content: ""; position: absolute; left: max(6vw, calc((100vw - 1200px) / 2)); right: max(6vw, calc((100vw - 1200px) / 2)); bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0.45; }
.logo { font-family: "JetBrains Mono", monospace; font-weight: 600; }
.logo span { color: var(--accent); }
.nav nav { display: flex; gap: 28px; }
.nav nav a { color: var(--muted); font-size: 0.95rem; transition: color 0.2s; }
.nav nav a:hover, .nav nav a[aria-current="page"] { color: var(--accent); }
.nav nav a { position: relative; }
.nav nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -5px; height: 1px; background: var(--accent); transition: right 0.2s ease; }
.nav nav a:hover::after, .nav nav a[aria-current="page"]::after { right: 0; }
.menu-toggle { display: none; }
.theme-toggle { display: block; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text); padding: 8px 12px; font: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
main, .footer { position: relative; z-index: 1; }

.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
  padding: 120px clamp(32px, 6vw, 100px) 80px;
  max-width: 1400px;
  margin: 0 auto;
}
.hero-copy { min-width: 0; }
.eyebrow { font-family: "JetBrains Mono", monospace; color: var(--accent); margin-bottom: 8px; }
.hero h1 { font-size: clamp(3.4rem, 7vw, 6rem); font-weight: 800; line-height: 0.95; letter-spacing: -3px; white-space: nowrap; }
.hero-name { color: transparent; background: linear-gradient(110deg, var(--text), var(--accent), var(--accent-2), var(--text)); background-size: 220% auto; background-clip: text; -webkit-background-clip: text; animation: shimmer 7s ease-in-out infinite; }
.hero-name .accent { color: transparent; }
.typing { font-size: clamp(1.4rem, 4vw, 2.4rem); font-weight: 600; color: var(--muted); margin-top: 12px; }
.caret { animation: blink 1s steps(1) infinite; color: var(--accent); }
.lead { max-width: 520px; margin-top: 20px; color: var(--muted); }
.cta { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }
.hero-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 34px; color: var(--muted); font: 0.78rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: 0.06em; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(110, 231, 183, 0.12); }
.hero-console { overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(145deg, rgba(18, 21, 28, 0.96), rgba(11, 13, 18, 0.88)); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(110, 231, 183, 0.05); transform: rotate(2deg); }
.console-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--muted); font: 0.75rem "JetBrains Mono", monospace; }
.console-lights { display: flex; gap: 5px; }
.console-lights i { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.console-lights i:first-child { background: #fca5a5; }
.console-lights i:nth-child(2) { background: #fcd34d; }
.console-lights i:last-child { background: var(--accent); }
.console-live { margin-left: auto; color: var(--accent); font-size: 0.62rem; }
.console-body { padding: clamp(26px, 4vw, 44px); }
.console-label { color: var(--accent) !important; font: 0.7rem "JetBrains Mono", monospace; letter-spacing: 0.12em; }
.console-title { margin-top: 16px; color: var(--text) !important; font-size: clamp(1.8rem, 3vw, 2.7rem); font-weight: 700; line-height: 1.1; }
.console-title span { color: var(--accent-2); }
.console-code { margin: 38px 0 28px; padding: 18px; border-left: 2px solid var(--accent); background: rgba(0, 0, 0, 0.18); color: var(--muted); font: 0.8rem/2 "JetBrains Mono", monospace; }
.console-code span { display: block; }
.console-code b { display: inline-block; width: 24px; color: #4c566b; font-weight: 400; }
.console-code em { color: var(--accent-2); font-style: normal; }
.console-code strong { color: var(--accent); font-weight: 500; }
.console-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font: 0.68rem "JetBrains Mono", monospace; letter-spacing: 0.08em; }
.console-footer strong { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 500; letter-spacing: 0; }

.section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 110px clamp(32px, 6vw, 100px);
}
.section:not(.hero) { border-top: 1px solid var(--border); }
.section h2 { font-size: 2rem; margin-bottom: 28px; }
.num { font-family: "JetBrains Mono", monospace; color: var(--accent); font-size: 1.1rem; margin-right: 8px; }
.section p { color: var(--muted); max-width: 640px; }
.teaser .link { display: inline-block; margin-top: 20px; }
.about-teaser { display: grid; grid-template-columns: 0.65fr 1fr; gap: 40px; }
.about-teaser h2 { margin-bottom: 0; }
.teaser-panel { display: grid; grid-template-columns: 0.65fr 1fr auto; gap: 30px; align-items: baseline; }
.teaser-panel h2, .teaser-panel p { margin: 0; }
.teaser-panel .link { margin-top: 0; white-space: nowrap; }
.page-intro { padding-top: 160px; min-height: 70vh; }
.page-shell { min-height: 100vh; }
.page-heading { max-width: 760px; }
.page-heading h1 { margin-top: 12px; font-size: clamp(3rem, 6vw, 5.6rem); line-height: 0.98; letter-spacing: -3px; white-space: nowrap; }
.page-lead { margin-top: 24px; font-size: 1.08rem; }
.about-layout, .contact-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(34px, 7vw, 96px); margin-top: 80px; align-items: start; }
.info-panel { padding: clamp(24px, 4vw, 42px); border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(145deg, var(--bg-2), rgba(110, 231, 183, 0.04)); }
.panel-label { color: var(--accent); font: 0.68rem "JetBrains Mono", monospace; letter-spacing: 0.14em; }
.info-panel h2, .timeline h2, .contact-note h2 { margin: 16px 0 34px; font-size: clamp(1.8rem, 3vw, 2.8rem); line-height: 1.08; }
.info-panel h2 span, .contact-note h2 span { color: var(--accent-2); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 32px 0; }
.filter-btn { border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--muted); padding: 9px 14px; font: inherit; cursor: pointer; }
.filter-btn:hover, .filter-btn.is-active { border-color: var(--accent); color: var(--accent); }
.project-grid { margin-top: 24px; }
.projects-heading { display: flex; justify-content: space-between; gap: 40px; align-items: end; max-width: none; }
.project-count { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; color: var(--muted); font: 0.72rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: 0.08em; }
.project-count strong { color: var(--accent); font-size: 3.5rem; line-height: 1; letter-spacing: -0.08em; }
.project-count span { line-height: 1.35; }
.project-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; margin-bottom: 20px; }
.project-card h2 { font-size: 1.3rem; margin-bottom: 8px; }
.project-card[hidden] { display: none; }
.project-links { display: flex; gap: 18px; }
.about-block, .timeline { margin-top: 0; }
.about-block h2, .timeline h2 { margin-bottom: 24px; }
.skill-group + .skill-group { margin-top: 26px; }
.skill-group h3 { font-size: 1rem; margin-bottom: 12px; color: var(--muted); }
.timeline { border-left: 1px solid var(--border); padding-left: 24px; }
.timeline-item + .timeline-item { margin-top: 24px; }
.timeline-item span { color: var(--accent); font-family: "JetBrains Mono", monospace; }
.timeline-item p { margin-top: 4px; }
.contact-form { max-width: none; margin-top: 0; padding: clamp(24px, 4vw, 42px); border: 1px solid var(--border); border-radius: 18px; background: var(--bg-2); }
.contact-note { padding-top: 18px; }
.contact-note h2 { margin-bottom: 20px; }
.contact-note > p { font-size: 1.05rem; }
.contact-rule { width: 100%; height: 1px; margin: 34px 0 22px; background: linear-gradient(90deg, var(--accent), transparent); }
.contact-detail { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font: 0.78rem "JetBrains Mono", monospace; }
.error-page { display: flex; min-height: 80vh; flex-direction: column; justify-content: center; align-items: flex-start; }
.error-page h1 { margin: 16px 0 20px; font-size: clamp(3.5rem, 9vw, 8rem); line-height: 0.92; letter-spacing: -4px; }
.error-page .btn { margin-top: 32px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 10px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn.primary { background: var(--accent); color: #05140d; }
.btn.primary:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(110, 231, 183, 0.3); }
.btn.ghost { border: 1px solid var(--border); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }
.btn.primary { box-shadow: 0 10px 28px rgba(110, 231, 183, 0.14); }
.btn.primary:hover { box-shadow: 0 14px 34px rgba(110, 231, 183, 0.24); }

button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.project-card { --card-delay: 0s; transition-delay: var(--card-delay); transform-style: preserve-3d; }
.project-card:nth-child(2) { --card-delay: 0.08s; }
.project-card:nth-child(3) { --card-delay: 0.16s; }
.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.card h3 { margin-bottom: 8px; }
.card p { font-size: 0.95rem; }
.tags { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.tags span {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(110, 231, 183, 0.08);
  padding: 3px 10px;
  border-radius: 6px;
}
.link { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

/* ---------- Skills ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 12px; }
.chips span {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-2);
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.chips span:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

/* ---------- Contact / footer ---------- */
.contact-form { max-width: 640px; margin-top: 36px; }
.form-field { display: grid; gap: 8px; margin-bottom: 20px; }
.form-field label { font-weight: 600; }
.form-field input, .form-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}
.form-field textarea { resize: vertical; }
.form-field input:focus, .form-field textarea:focus { border-color: var(--accent); outline: 2px solid rgba(110, 231, 183, 0.2); }
.honeypot { position: absolute; left: -9999px; }
.form-status { min-height: 1.6em; margin-top: 16px; }
.form-status.success { color: var(--accent); }
.form-status.error { color: #fca5a5; }
.footer { text-align: center; padding: 40px; color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--border); }

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Hero elements animate on page load, staggered by --d */
.fade-up {
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
  animation-delay: var(--d, 0s);
}

/* Sections animate when scrolled into view (class added by script.js) */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Respect users who turn animations off */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .fade-up, .reveal { opacity: 1; transform: none; }
  body.page-load { opacity: 1; }
  .hero-console { transform: none; }
}

@media (max-width: 1400px) and (min-width: 601px) {
  .hero { grid-template-columns: 1fr; gap: 64px; }
  .hero-copy { max-width: 760px; }
  .hero h1 { font-size: clamp(4rem, 9vw, 6rem); white-space: nowrap; }
  .hero-console { width: min(100%, 620px); justify-self: end; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .menu-toggle {
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    padding: 8px 12px;
    font: inherit;
    cursor: pointer;
  }
  .theme-toggle {
    display: block;
    margin-left: auto;
    margin-right: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    padding: 8px 12px;
    font: inherit;
    cursor: pointer;
  }
  .nav nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 6vw 16px;
    background: rgba(11, 13, 18, 0.96);
    border-bottom: 1px solid var(--border);
  }
  .nav nav.is-open { display: flex; }
  .nav nav a { padding: 10px 0; font-size: 0.95rem; }
  .cursor-glow { display: none; }
  .hero { display: flex; flex-direction: column; min-height: auto; gap: 54px; padding-top: 150px; padding-bottom: 72px; }
  .hero h1 { font-size: clamp(3.1rem, 15vw, 5rem); letter-spacing: -2px; white-space: normal; }
  .hero-console { width: 100%; transform: rotate(0); }
  .about-teaser, .teaser-panel { display: block; }
  .about-teaser h2 { margin-bottom: 24px; }
  .teaser-panel h2 { margin-bottom: 18px; }
  .teaser-panel .link { display: inline-block; margin-top: 24px; }
  .page-intro { padding-top: 140px; }
  .page-heading h1 { font-size: clamp(3rem, 15vw, 5rem); letter-spacing: -2px; white-space: normal; }
  .about-layout, .contact-layout { display: block; margin-top: 52px; }
  .timeline, .contact-note { margin-top: 52px; }
  .projects-heading { display: block; }
  .project-count { margin-top: 30px; }
  .filters { margin-top: 28px; }
  .error-page h1 { font-size: clamp(3.5rem, 16vw, 6rem); letter-spacing: -2px; }
}
