:root {
  --bg: #0A0A0A;
  --bg-elev: #131315;
  --bg-elev-2: #1A1A1D;
  --ink: #F2F3F5;
  --ink-soft: #9AA0A8;
  --line: #232326;
  --accent: #3B82F6;
  --accent-soft: rgba(59, 130, 246, 0.10);
  --glow: 0 0 0 1px rgba(59, 130, 246, 0.18), 0 12px 34px rgba(59, 130, 246, 0.10);
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 10px 30px rgba(0,0,0,0.35);
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
}
:root[data-theme="light"] {
  --bg: #FAFAFA;
  --bg-elev: #FFFFFF;
  --bg-elev-2: #F1F2F4;
  --ink: #0E0F11;
  --ink-soft: #5B5F66;
  --line: #E4E6EA;
  --accent: #2A54D6;
  --accent-soft: #EEF2FE;
  --glow: 0 1px 2px rgba(16,18,22,0.04), 0 10px 30px rgba(16,18,22,0.06);
  --shadow: 0 1px 2px rgba(16,18,22,0.04), 0 10px 30px rgba(16,18,22,0.06);
}

* { box-sizing: border-box; }
:root {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: inherit; }

/* progress bar */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--accent); z-index: 60; transition: width 0.1s linear;
}

/* nav */
nav {
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-left { display: flex; align-items: center; gap: 16px; }
.logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #fff;
  font-family: var(--mono); font-weight: 600; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 22px; font-family: var(--mono); font-size: 13px; }
.nav-links a { color: var(--ink-soft); text-decoration: none; padding-bottom: 3px; border-bottom: 1px solid transparent; }
.nav-links a.active { color: var(--ink); border-color: var(--accent); }
#theme-toggle {
  font-family: var(--mono); font-size: 12px;
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 11px; cursor: pointer;
}
#theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 640px) { .nav-links { display: none; } }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
section { padding: 72px 0; scroll-margin-top: 84px; border-bottom: 1px solid var(--line); }
section:last-of-type { border-bottom: none; }

.eyebrow { font-family: var(--mono); font-size: 13px; color: var(--accent); margin: 0 0 10px; }
h2.section-title {
  font-family: var(--sans); font-size: clamp(22px, 3vw, 28px); font-weight: 700;
  margin: 0 0 32px; letter-spacing: -0.01em;
}
p.lead { max-width: 64ch; color: var(--ink-soft); font-size: 15.5px; }

/* HERO */
.hero { padding-top: 96px; padding-bottom: 96px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: no-preference) {
  .hero-text > * { opacity: 0; animation: rise 0.6s ease forwards; }
  .hero-text > *:nth-child(1) { animation-delay: 0.05s; }
  .hero-text > *:nth-child(2) { animation-delay: 0.15s; }
  .hero-text > *:nth-child(3) { animation-delay: 0.25s; }
  .hero-text > *:nth-child(4) { animation-delay: 0.35s; }
  .hero-text > *:nth-child(5) { animation-delay: 0.45s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

h1 {
  font-family: var(--sans); font-size: clamp(32px, 5vw, 48px); font-weight: 800;
  margin: 0 0 12px; letter-spacing: -0.02em;
}
.headline { font-family: var(--mono); font-size: 15px; color: var(--accent); margin: 0 0 18px; }
.hero-desc { font-size: 15.5px; color: var(--ink-soft); max-width: 54ch; margin: 0 0 28px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  padding: 12px 22px; border-radius: 10px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--glow); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

/* terminal visual */
.terminal {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--glow); overflow: hidden;
}
.terminal-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.terminal-body { padding: 20px 18px; font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.terminal-body .line { margin-bottom: 10px; }
.terminal-body .prompt { color: var(--accent); }
.terminal-body .ok { color: #34D399; }
.terminal-cursor { display: inline-block; width: 7px; height: 14px; background: var(--accent); vertical-align: -2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ABOUT */
.about-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }

/* EDUCATION */
.edu-card {
  display: flex; align-items: flex-start; gap: 16px;
  border: 1px solid var(--line); background: var(--bg-elev);
  border-radius: 14px; padding: 24px;
}
.edu-icon {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.edu-icon svg { width: 22px; height: 22px; }
.edu-card h3 { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
.edu-major { margin: 0 0 6px; font-family: var(--mono); font-size: 13px; color: var(--accent); }
.edu-status {
  display: inline-block; margin-top: 8px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.edu-list { display: flex; flex-direction: column; gap: 14px; }
.edu-level {
  display: inline-block; margin-bottom: 6px;
  font-family: var(--mono); font-size: 11.5px; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 3px 10px;
}

/* SKILLS */
.skill-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 720px) { .skill-cats { grid-template-columns: 1fr; } }
.skill-cat {
  border: 1px solid var(--line); background: var(--bg-elev);
  border-radius: 14px; padding: 22px;
}
.skill-cat.emphasis { border-color: rgba(59,130,246,0.35); box-shadow: var(--glow); }
.skill-cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.skill-cat-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.skill-cat-icon svg { width: 16px; height: 16px; }
.skill-cat-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; }
.skill-item { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.skill-item:last-child { margin-bottom: 0; }
.skill-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--bg-elev-2); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.skill-icon svg { width: 16px; height: 16px; }
.skill-info { flex: 1; }
.skill-info .name-row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12.5px; margin-bottom: 6px; }
.skill-info .name-row span:last-child { color: var(--ink-soft); }
.skill-track { height: 6px; background: var(--bg-elev-2); border-radius: 99px; overflow: hidden; }
.skill-fill { height: 100%; background: var(--accent); border-radius: 99px; width: 0%; transition: width 1.1s ease; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip {
  font-family: var(--mono); font-size: 11.5px;
  background: var(--bg-elev-2); border: 1px solid var(--line);
  padding: 6px 11px; border-radius: 999px; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip svg { width: 13px; height: 13px; }

/* PROJECTS */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.project {
  border: 1px solid var(--line); background: var(--bg-elev);
  border-radius: 14px; padding: 24px;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.project:hover { transform: translateY(-3px); box-shadow: var(--glow); border-color: rgba(59,130,246,0.3); }
.project-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.project-icon svg { width: 20px; height: 20px; }
.project h3 { margin: 0; font-size: 17px; font-weight: 700; }
.project p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }
.project-btns { display: flex; gap: 10px; margin-top: auto; padding-top: 4px; }

.project-placeholder {
  border: 1px dashed var(--line); border-radius: 14px; padding: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; color: var(--ink-soft); min-height: 180px;
}
.project-placeholder svg { width: 26px; height: 26px; color: var(--accent); }
.project-placeholder span { font-family: var(--mono); font-size: 13px; }

/* CONTACT */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-list { display: flex; flex-direction: column; gap: 16px; }
.contact-item { display: flex; align-items: center; gap: 14px; }
.contact-item .ico {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: var(--bg-elev); border: 1px solid var(--line); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.contact-item .ico svg { width: 18px; height: 18px; }
.contact-item a, .contact-item span.value { font-size: 14.5px; text-decoration: none; }
.contact-item a:hover { color: var(--accent); }
.contact-item .label { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); margin-bottom: 2px; }

form.contact-form { display: flex; flex-direction: column; gap: 14px; }
.field label { display: block; font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; color: var(--ink); font-family: var(--sans); font-size: 14px;
  transition: border-color 0.15s ease;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 110px; }
.form-note { font-size: 12px; color: var(--ink-soft); margin: 0; }

footer {
  padding: 28px 0; display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px; font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
}

@media (max-width: 480px) {
  section { padding: 56px 0; }
  .hero { padding-top: 56px; padding-bottom: 56px; }
  .edu-card { flex-direction: column; }
}
