/* ===== Theme tokens ===== */
:root {
  --bg: #0a192f;
  --bg-tint: #112240;
  --bg-tint-2: #1d2d50;
  --text: #ccd6f6;
  --text-muted: #8892b0;
  --heading: #e6f1ff;
  --accent: #64ffda;
  --accent-tint: rgba(100, 255, 218, 0.1);
  --border: rgba(100, 255, 218, 0.25);
  --shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --maxw: 1100px;
  --nav-h: 72px;
}

html[data-theme="light"] {
  --bg: #f7fafc;
  --bg-tint: #ffffff;
  --bg-tint-2: #eef2f7;
  --text: #2d3a52;
  --text-muted: #5a6a85;
  --heading: #0a192f;
  --accent: #0ca678;
  --accent-tint: rgba(12, 166, 120, 0.1);
  --border: rgba(12, 166, 120, 0.3);
  --shadow: 0 10px 30px -15px rgba(45, 58, 82, 0.25);
}

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}
h1, h2, h3 { color: var(--heading); line-height: 1.1; margin: 0; }
a { color: var(--accent); text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }
img, svg { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--bg); padding: 10px 16px; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 14px 24px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.btn-primary { background: var(--accent-tint); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-large { padding: 18px 34px; font-size: 1rem; }

/* ===== Header / Nav ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.site-header.scrolled { box-shadow: var(--shadow); border-color: var(--bg-tint-2); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.brand { font-family: var(--font-mono); font-weight: 700; font-size: 1.4rem; color: var(--heading); }
.brand-dot { color: var(--accent); }

.nav-menu { display: flex; align-items: center; gap: 28px; }
.nav-menu a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  position: relative;
}
.nav-menu a:hover { color: var(--accent); }
.nav-menu a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
  background: var(--accent); transition: width 0.25s ease;
}
.nav-menu a:hover::after { width: 100%; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--accent-tint);
  cursor: pointer; display: grid; place-items: center; padding: 0;
  transition: transform 0.2s ease;
}
.theme-toggle:hover { transform: rotate(20deg); }
.theme-toggle-icon { width: 16px; height: 16px; border-radius: 50%; position: relative; background: var(--accent); }
html[data-theme="dark"] .theme-toggle-icon {
  background: transparent;
  box-shadow: inset -5px -3px 0 0 var(--accent);
}

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 26px; height: 2px; background: var(--accent); transition: 0.3s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 40px; padding-bottom: 80px;
}
.hero-eyebrow { font-family: var(--font-mono); color: var(--accent); margin: 0 0 18px; font-size: 1rem; }
.hero-title { font-size: clamp(2.6rem, 8vw, 5rem); font-weight: 800; letter-spacing: -0.02em; }
.hero-subtitle { font-size: clamp(2rem, 7vw, 4.2rem); font-weight: 800; color: var(--text-muted); letter-spacing: -0.02em; margin-top: 6px; }
.hero-lead { max-width: 560px; margin: 26px 0 0; color: var(--text-muted); font-size: 1.1rem; }
.hero-actions { display: flex; gap: 16px; margin-top: 40px; flex-wrap: wrap; }

/* ===== Weather page ===== */
.weather-page { max-width: 720px; }
.weather-back { font-family: var(--font-mono); font-size: 0.9rem; margin: 0 0 32px; }
.weather-date { font-family: var(--font-mono); color: var(--accent); margin: 12px 0 0; }
.weather-current { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 24px 0 0; }
.weather-temp { font-size: 3.5rem; font-weight: 700; color: var(--heading); line-height: 1; }
.weather-meta { color: var(--text-muted); }
.weather-subtitle { font-size: 1.2rem; margin-top: 48px; }
.weather-table { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 0.95rem; }
.weather-table th { font-family: var(--font-mono); font-weight: 500; color: var(--accent); text-align: left; }
.weather-table th, .weather-table td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--bg-tint-2); }
.weather-source { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); margin-top: 40px; }
.radar-figure { margin: 16px 0 0; }
.radar-img { width: 100%; height: auto; border-radius: 8px; display: block; border: 1px solid var(--border); }
.radar-caption { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); margin-top: 8px; }


/* ===== Sections ===== */
.section { padding: 100px 24px; max-width: 960px; }
.section-title {
  display: flex; align-items: center; gap: 12px;
  font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; margin-bottom: 40px;
}
.section-title::after {
  content: ""; height: 1px; flex: 1; max-width: 280px;
  background: var(--bg-tint-2);
}
.section-num { font-family: var(--font-mono); color: var(--accent); font-size: 1.1rem; font-weight: 500; }

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 50px; align-items: start; }
.about-text p { margin: 0 0 16px; color: var(--text-muted); }
.tech-list {
  display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 8px 16px; margin-top: 8px;
}
.tech-list li { font-family: var(--font-mono); font-size: 0.88rem; position: relative; padding-left: 22px; }
.tech-list li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }

.about-portrait { display: flex; justify-content: center; }
.portrait-frame {
  position: relative; width: 240px; height: 240px; border-radius: 8px;
  background: var(--accent-tint); border: 1px solid var(--accent);
  display: grid; place-items: center;
  transition: transform 0.3s ease;
}
.portrait-frame::after {
  content: ""; position: absolute; inset: 16px 16px -16px -16px;
  border: 2px solid var(--accent); border-radius: 8px; z-index: -1;
}
.portrait-frame:hover { transform: translate(-6px, -6px); }
.portrait-initials { font-size: 5rem; font-weight: 800; color: var(--accent); font-family: var(--font-mono); }

/* ===== Projects ===== */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.project-card {
  background: var(--bg-tint); border-radius: 10px; padding: 28px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow); transition: transform 0.25s ease;
  border: 1px solid transparent;
}
.project-card:hover { transform: translateY(-8px); border-color: var(--border); }
.project-top { display: flex; align-items: center; justify-content: space-between; }
.project-folder { width: 42px; height: 42px; fill: var(--accent); }
.project-links { display: flex; gap: 14px; }
.project-links a { color: var(--text); display: grid; place-items: center; }
.project-links a:hover { color: var(--accent); }
.project-links svg { width: 22px; height: 22px; fill: currentColor; }
.project-title { font-size: 1.35rem; }
.project-desc { color: var(--text-muted); font-size: 0.96rem; flex: 1; margin: 0; }
.project-tech { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.project-tech li { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }

/* ===== Experience timeline ===== */
.timeline { position: relative; margin-left: 8px; padding-left: 32px; border-left: 2px solid var(--bg-tint-2); }
.timeline-item { position: relative; padding-bottom: 38px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
  position: absolute; left: -41px; top: 4px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--accent);
}
.timeline-role { font-size: 1.2rem; }
.timeline-company { color: var(--accent); font-weight: 600; }
.timeline-date { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); margin: 4px 0 10px; }
.timeline-desc { color: var(--text-muted); margin: 0; max-width: 620px; }

/* ===== Contact ===== */
.section-contact { text-align: center; max-width: 640px; padding-top: 120px; padding-bottom: 120px; }
.contact-eyebrow { font-family: var(--font-mono); color: var(--accent); margin: 0 0 16px; }
.contact-eyebrow .section-num { display: inline; }
.contact-title { font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 800; }
.contact-text { color: var(--text-muted); margin: 20px auto 40px; font-size: 1.1rem; }

/* ===== Footer ===== */
.site-footer { text-align: center; padding: 40px 24px 50px; }
.footer-social { display: flex; justify-content: center; gap: 22px; margin-bottom: 18px; }
.footer-social a { color: var(--text-muted); transition: color 0.2s ease, transform 0.2s ease; }
.footer-social a:hover { color: var(--accent); transform: translateY(-3px); }
.footer-social svg { width: 22px; height: 22px; fill: currentColor; }
.footer-note { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); margin: 0; }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal:nth-child(1) { transition-delay: 0.05s; }
.reveal:nth-child(2) { transition-delay: 0.15s; }
.reveal:nth-child(3) { transition-delay: 0.25s; }
.reveal:nth-child(4) { transition-delay: 0.35s; }
.reveal:nth-child(5) { transition-delay: 0.45s; }
.reveal:nth-child(6) { transition-delay: 0.55s; }

/* ===== Todo ===== */
.todo-page { max-width: 640px; padding-top: 60px; padding-bottom: 80px; }

.todo-form {
  display: flex; gap: 12px; margin-bottom: 32px;
}
.todo-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
}
.todo-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.todo-input::placeholder { color: var(--text-muted); }

.todo-list { display: flex; flex-direction: column; gap: 8px; }

.todo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.todo-item--done .todo-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.todo-check {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  padding: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.todo-check svg { width: 14px; height: 14px; }
.todo-item--done .todo-check { background: var(--accent-tint); border-color: var(--accent); }
.todo-check:hover { border-color: var(--accent); }

.todo-text { flex: 1; }

.todo-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s ease;
}
.todo-delete:hover { color: var(--accent); }

.todo-empty { color: var(--text-muted); margin-top: 16px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-toggle { display: flex; z-index: 60; }
  .nav-menu {
    position: fixed; inset: 0 0 0 30%;
    flex-direction: column; justify-content: center; gap: 30px;
    background: var(--bg-tint); box-shadow: var(--shadow);
    transform: translateX(100%); transition: transform 0.3s ease;
  }
  .nav-menu.open { transform: translateX(0); }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-portrait { order: -1; }
  .section { padding: 70px 24px; }
}
