:root {
  --bg: #faf9f6;
  --bg-alt: #f1efe8;
  --bg-card: #ffffff;
  --border: #e6e2d8;
  --border-light: #d5d0c1;
  --text: #1b1e24;
  --text-dim: #5b6270;
  --text-faint: #8b93a0;
  --accent: #2f5d8a;
  --accent-dim: #234563;
  --accent-soft: rgba(47, 93, 138, 0.08);
  --accent-border: rgba(47, 93, 138, 0.22);
  --shadow-sm: 0 1px 2px rgba(30, 24, 14, 0.05);
  --shadow-md: 0 12px 28px rgba(30, 24, 14, 0.08);
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 10px;
  --maxw: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.02;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 249, 246, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.nav__brand .dot { color: var(--accent); }
.nav__links {
  display: flex;
  gap: 28px;
  margin-right: auto;
  margin-left: 48px;
}
.nav__links a {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.15s ease;
}
.nav__links a:hover { color: var(--text); }
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav__burger span {
  width: 20px;
  height: 2px;
  background: var(--text);
  display: block;
}
.nav__mobile {
  display: none;
  flex-direction: column;
  padding: 8px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.nav__mobile a {
  padding: 12px 0;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.nav__mobile.is-open { display: flex; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: var(--accent-dim); transform: translateY(-1px); }
.btn--ghost {
  border-color: var(--border-light);
  color: var(--text);
  background: var(--bg-card);
}
.btn--ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn--small { padding: 8px 16px; font-size: 0.82rem; }
.btn__arrow { color: var(--accent); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: 120px 24px 100px;
  overflow: hidden;
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 0%, black, transparent);
  opacity: 0.7;
}
.hero__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}
.hero__main { flex: 1; min-width: 0; }
.hero__photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-card);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16);
}
.hero__title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 26px;
}
.hero__title-sub {
  color: var(--text-dim);
  font-size: 0.5em;
  font-weight: 600;
  display: inline-block;
  margin-top: 14px;
}
.hero__desc {
  max-width: 620px;
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 40px;
}
.hero__actions {
  display: flex;
  gap: 14px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.hero__meta {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-faint);
}
.hero__meta .sep { margin: 0 10px; color: var(--border-light); }

/* ---------- SECTIONS ---------- */
.section {
  padding: 100px 24px;
  position: relative;
  z-index: 2;
}
.section--alt { background: var(--bg-alt); }
.section__inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.section__label {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}
.section__title {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  max-width: 620px;
}
.section__intro {
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 40px;
  font-size: 1.02rem;
}
.section__intro a { color: var(--accent); border-bottom: 1px solid var(--accent-border); }

/* ---------- ABOUT ---------- */
.about {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  align-items: start;
}
.about__text p {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 20px;
}
.about__text strong { color: var(--text); font-weight: 600; }
.about__side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.stat-card__num {
  display: block;
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.stat-card__label {
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* ---------- TIMELINE ---------- */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--border);
  margin-left: 6px;
}
.tl-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 32px 0 32px 32px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.tl-item:last-child { border-bottom: none; }
.tl-item::before {
  content: '';
  position: absolute;
  left: -5.5px;
  top: 38px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 2px solid var(--accent);
}
.tl-item__date {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-faint);
  padding-top: 3px;
}
.tl-item__logo {
  display: inline-block;
  height: 26px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 12px;
}
.tl-item__body h3 {
  display: inline-flex;
  align-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.tl-item__body h3 span {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.9em;
  margin-left: 5px;
}
.tl-item__org {
  color: var(--accent);
  font-size: 0.92rem;
  margin-bottom: 14px;
  font-weight: 600;
}
.tl-item__body ul {
  margin-bottom: 16px;
}
.tl-item__body li {
  color: var(--text-dim);
  font-size: 0.95rem;
  padding-left: 18px;
  position: relative;
  margin-bottom: 8px;
}
.tl-item__body li::before {
  content: '-';
  position: absolute;
  left: 0;
  color: var(--text-faint);
}
.tl-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tl-item__tags span {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: 100px;
}

/* ---------- SKILLS ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.skill-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.skill-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.skill-card__icon {
  width: 26px;
  height: 26px;
  color: var(--accent);
  margin-bottom: 14px;
}
.skill-card h3 {
  font-size: 1.05rem;
  margin-bottom: 10px;
}
.skill-card > p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 18px;
  min-height: 42px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags span {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--accent-dim);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 5px 11px;
  border-radius: 6px;
}

/* ---------- PROJECTS ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}
.filter-btn {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 9px 16px;
  border-radius: 100px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.filter-btn span {
  font-size: 0.72rem;
  color: var(--text-faint);
  background: var(--bg-alt);
  padding: 1px 7px;
  border-radius: 100px;
}
.filter-btn:hover { border-color: var(--accent-border); color: var(--text); }
.filter-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.filter-btn.is-active span { background: rgba(255,255,255,0.22); color: #fff; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.filter-empty {
  color: var(--text-faint);
  font-size: 0.95rem;
  padding: 40px 0;
  text-align: center;
}
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.project-card {
  cursor: pointer;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}
.project-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.project-card--featured {
  border-color: var(--accent-border);
}
.project-card__img {
  width: calc(100% + 52px);
  margin: -26px -26px 20px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.project-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.project-card__tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.project-card__date {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.project-card h3 {
  font-size: 1.08rem;
  margin-bottom: 10px;
  line-height: 1.35;
}
.project-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 18px;
  flex-grow: 1;
}

/* ---------- EDUCATION ---------- */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}
.edu-col h3 {
  font-size: 0.95rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
  font-weight: 600;
}
.edu-item {
  display: grid;
  grid-template-columns: 100px 40px 1fr;
  align-items: start;
  gap: 16px;
  padding-bottom: 26px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--border);
}
.edu-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.edu-item__date {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-faint);
}
.edu-item__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-top: 2px;
}
.edu-item h4 {
  font-size: 1rem;
  margin-bottom: 6px;
}
.edu-item p {
  color: var(--text-dim);
  font-size: 0.88rem;
}
.edu-item__verify {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-border);
}
.edu-item__verify:hover { color: var(--accent-dim); border-color: var(--accent-dim); }
.edu-item--upcoming h4 { color: var(--text); }
.edu-item--upcoming .edu-item__date { color: var(--accent); font-weight: 600; }

/* ---------- CONTACT ---------- */
.section--contact { text-align: left; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.contact-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.contact-card:not(.contact-card--static):hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.contact-card__label {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.contact-card__value {
  font-size: 0.95rem;
  font-weight: 600;
  word-break: break-word;
}

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-faint);
}
.footer__inner a:hover { color: var(--text-dim); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .hero__inner { flex-direction: column-reverse; gap: 24px; }
  .hero__photo { width: 96px; height: 96px; }
  .about { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .edu-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .tl-item { grid-template-columns: 1fr; gap: 8px; padding-left: 24px; }
  .tl-item::before { left: -5.5px; top: 6px; }
}

@media (max-width: 560px) {
  .hero { padding: 90px 20px 70px; }
  .section { padding: 70px 20px; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .nav__inner { padding: 14px 20px; }
  .btn--small span.btn__arrow { display: none; }
  .edu-item { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- MODAL ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal.is-open { display: flex; }
.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 12, 0.55);
  backdrop-filter: blur(2px);
}
.modal__panel {
  position: relative;
  background: var(--bg-card);
  border-radius: 14px;
  max-width: 720px;
  width: 100%;
  box-shadow: 0 30px 60px rgba(20, 18, 12, 0.25);
  overflow: hidden;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}
.modal__close:hover { background: #fff; }
.modal__cover {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  background: var(--bg-alt);
}
.modal__content {
  padding: 32px 36px 40px;
}
.modal__meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 10px;
}
.modal__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
.modal__body {
  margin-top: 22px;
  color: var(--text-dim);
  font-size: 0.96rem;
  line-height: 1.7;
}
.modal__body h4 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  margin: 24px 0 8px;
}
.modal__body h4:first-child { margin-top: 0; }
.modal__body p { margin-bottom: 12px; }
.modal__body ul, .modal__body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}
.modal__body ul { list-style: disc; }
.modal__body ol { list-style: decimal; }
.modal__body li { margin-bottom: 6px; }
.modal__body strong { color: var(--text); font-weight: 600; }
.modal__body code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-dim);
}
.modal__body pre {
  background: #1b1e24;
  color: #e7ebf0;
  padding: 16px 18px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 14px;
}
.modal__body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.6;
}
.modal__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 20px;
}
.modal__gallery img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}
body.modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .modal { padding: 0; }
  .modal__panel { max-width: 100%; min-height: 100%; border-radius: 0; }
  .modal__content { padding: 26px 20px 40px; }
  .modal__cover { height: 180px; }
}
