/* ---------- Theme ---------- */
:root {
  --bg: #0b0e14;
  --bg-elev: #11151e;
  --bg-card: #131925;
  --border: #1f2737;
  --border-strong: #2c3850;
  --text: #d7dde8;
  --text-strong: #f3f6fb;
  --muted: #7d889c;
  --accent: #39ff88;
  --accent-dim: rgba(57, 255, 136, 0.12);
  --accent-2: #5cc8ff;
  --radius: 12px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 960px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* subtle grid + glow background */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(57, 255, 136, 0.10), transparent 70%),
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.05) 70%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.05) 70%);
}

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

main.container { flex: 1; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { color: var(--text-strong); line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.accent { color: var(--accent); }
.prompt { color: var(--accent); margin-right: 0.35em; }

::selection { background: var(--accent); color: var(--bg); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-strong);
}
.brand:hover { text-decoration: none; }

.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text-strong); background: var(--bg-elev); text-decoration: none; }
.nav-links a.active { color: var(--accent); background: var(--accent-dim); }
.nav-index { color: var(--accent); opacity: 0.6; margin-right: 4px; font-size: 0.8em; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 32px; }

.terminal {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(57, 255, 136, 0.04);
  max-width: 680px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #0e121a;
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.terminal-title { margin-left: 8px; color: var(--muted); font-size: 0.8rem; }

.terminal-body { padding: 24px 28px 20px; font-size: 0.95rem; }
.terminal-body p { margin: 0 0 6px; }

.hero-name {
  font-family: var(--sans);
  margin: 4px 0 18px;
  background: linear-gradient(90deg, var(--text-strong), var(--accent) 140%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline { color: var(--accent-2); margin-bottom: 18px !important; }

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

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

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  color: var(--text-strong);
  background: var(--bg-elev);
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #04110a; border-color: var(--accent); font-weight: 700; }
.btn-primary:hover { background: #5dffa0; }

/* ---------- Sections ---------- */
.section { padding: 40px 0; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 8px;
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.section-head .section-title { flex: 1; }
.link-more { font-size: 0.85rem; white-space: nowrap; }

.prose { max-width: 70ch; }
.prose p { margin: 0 0 1em; }
.prose strong { color: var(--text-strong); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--accent); }
.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
}
.prose pre {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; }

.social-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  transition: color 0.15s, border-color 0.15s;
}
.social:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
}

.project-card { display: flex; flex-direction: column; }
.project-card:hover {
  border-color: rgba(57, 255, 136, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px -20px rgba(57, 255, 136, 0.35);
}
.project-card h3 a { color: var(--text-strong); }
.project-card h3 a:hover { color: var(--accent); text-decoration: none; }
.project-card p { color: var(--muted); font-size: 0.95rem; margin: 0 0 16px; flex: 1; }

.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 0.8rem; }
.card-icons { display: flex; gap: 12px; font-family: var(--mono); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.tags li {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent-2);
  background: rgba(92, 200, 255, 0.08);
  border: 1px solid rgba(92, 200, 255, 0.2);
  padding: 3px 10px;
  border-radius: 999px;
}

.category {
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.page-head .category { margin: 8px 0 0; }

.card-image {
  display: block;
  margin: -22px -22px 18px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.card-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.project-card:hover .card-image img { transform: scale(1.04); }

.project-hero { margin: 8px 0 0; }
.project-hero img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: block;
}

/* ---------- Interests ---------- */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.interest { padding: 20px; }
.interest:hover { border-color: rgba(57, 255, 136, 0.45); transform: translateY(-2px); }
.interest-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(57, 255, 136, 0.25);
  margin-bottom: 14px;
}
.interest h3 { font-size: 1rem; margin-bottom: 6px; }
.interest p { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin: 0; }

/* ---------- Page headers ---------- */
.page-head { padding: 64px 0 16px; }
.page-head h1 { margin-top: 8px; }
.page-head .tags { margin: 16px 0 4px; }
.lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 20px; }
.lead.prose p { margin: 0; }
.back { display: inline-block; font-size: 0.85rem; margin-bottom: 8px; }
.back:hover { color: var(--accent); }

/* ---------- Resume ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--border); }
.timeline-item { position: relative; padding: 0 0 28px 8px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -31px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(57, 255, 136, 0.5);
}
.timeline-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.timeline-head h3 { margin: 0; }
.timeline-head .mono { font-size: 0.82rem; }
.timeline-item > .small { margin: 2px 0 8px; }

.bullets { margin: 8px 0 0; padding-left: 1.1em; }
.bullets li { margin-bottom: 6px; }
.bullets li::marker { content: "▹  "; color: var(--accent); }

.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.skill-group h3 { font-size: 0.9rem; color: var(--muted); text-transform: lowercase; margin-bottom: 12px; }

.edu + .edu { margin-top: 16px; }
.edu p { margin: 4px 0 0; }

/* ---------- 404 ---------- */
.not-found h1 { font-size: clamp(4rem, 14vw, 8rem); color: var(--accent); margin: 8px 0 0; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 48px;
  padding-top: 28px;
  padding-bottom: 36px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.site-footer p { font-size: 0.8rem; margin: 0; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { height: auto; padding-top: 12px; padding-bottom: 12px; flex-direction: column; gap: 8px; }
  .nav-links a { padding: 6px 8px; font-size: 0.85rem; }
  .nav-index { display: none; }
  .hero { padding-top: 40px; }
  .terminal-body { padding: 20px; }
  .page-head { padding-top: 40px; }
  .section-head { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
