/* ---------------------------------------------------------
   Tokens — light, warm, professional palette with one clear
   accent (indigo) plus soft category tints for icons/tags.
--------------------------------------------------------- */
:root {
  --bg:        #FAF8F4;
  --surface:   #FFFFFF;
  --surface-2: #F3F1EA;
  --rule:      #E6E2D8;
  --text:      #22242B;
  --muted:     #6B7280;

  --accent:      #4F46E5; /* indigo */
  --accent-dark: #3730A3;
  --accent-soft: #EEF0FE;

  --tone-blue:   #2563EB; --tone-blue-soft:   #EAF1FE;
  --tone-green:  #059669; --tone-green-soft:  #E7F7F1;
  --tone-sky:    #0284C7; --tone-sky-soft:    #E7F5FC;
  --tone-violet: #7C3AED; --tone-violet-soft: #F3ECFE;
  --tone-amber:  #D97706; --tone-amber-soft:  #FDF1E1;

  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max-w: 780px;
  --pad: 1.25rem;
  --shadow-sm: 0 1px 2px rgba(34, 36, 43, 0.05);
  --shadow-md: 0 10px 24px -14px rgba(79, 70, 229, 0.28), 0 2px 6px rgba(34, 36, 43, 0.05);
}

@media (min-width: 640px) {
  :root { --pad: 1.75rem; }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}
a:hover, a:focus-visible { color: var(--accent-dark); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

/* Icon wrapper — sized/colored consistently wherever it's used */
.icon { display: inline-flex; flex-shrink: 0; }
.icon svg { width: 1em; height: 1em; }

/* ---------------------------------------------------------
   Top bar
--------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem var(--pad);
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar__mark {
  font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem;
  color: var(--accent); width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
}
.topbar__nav { display: flex; align-items: center; gap: 1.5rem; }
.topbar__nav a {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted);
}
.topbar__nav a:hover, .topbar__nav a:focus-visible { color: var(--accent); }
.topbar__cta {
  background: var(--accent); color: #fff !important; padding: 0.45rem 0.9rem;
  border-radius: 999px; font-weight: 600;
}
.topbar__cta:hover { background: var(--accent-dark); }

.topbar__toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 8px; }
.topbar__toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 1px; }

@media (max-width: 700px) {
  .topbar__nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    flex-direction: column; align-items: stretch; gap: 0; display: none;
    box-shadow: var(--shadow-md);
  }
  .topbar__nav.is-open { display: flex; }
  .topbar__nav a { padding: 1rem var(--pad); border-bottom: 1px solid var(--rule); }
  .topbar__cta { border-radius: 0; text-align: center; }
  .topbar__toggle { display: flex; }
}

/* ---------------------------------------------------------
   Buttons
--------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.92rem;
  padding: 0.7rem 1.2rem; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; min-height: 44px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-md); }
.btn--primary:hover, .btn--primary:focus-visible { background: var(--accent-dark); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--rule); }
.btn--ghost:hover, .btn--ghost:focus-visible { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------
   Hero
--------------------------------------------------------- */
.hero { max-width: var(--max-w); margin: 0 auto; padding: 3.5rem var(--pad) 3rem; opacity: 0; animation: rise 0.6s ease-out 0.1s forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.hero__top { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1.5rem; }
.hero__id { min-width: 0; }

.hero__photo {
  width: 72px; height: 72px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--surface);
  box-shadow: var(--shadow-md); flex-shrink: 0;
}

.hero__status {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-dark);
  display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem;
  background: var(--accent-soft); padding: 0.35rem 0.7rem; border-radius: 999px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

.hero__name { font-size: clamp(1.7rem, 6vw, 2.6rem); letter-spacing: -0.01em; line-height: 1.1; }
.hero__role { font-family: var(--font-sans); font-size: 1.1rem; color: var(--text); margin-top: 0; max-width: 46ch; font-weight: 600; }
.hero__bio { color: var(--muted); max-width: 60ch; margin-top: 0.75rem; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.hero__links { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; margin-top: 1.75rem; font-family: var(--font-mono); font-size: 0.85rem; }
.hero__links a { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.hero__links a:hover { color: var(--accent); }
.hero__links .icon { color: var(--accent); }

@media (min-width: 560px) {
  .hero__photo { width: 96px; height: 96px; }
  .hero__top { gap: 1.5rem; }
}

@media (max-width: 400px) {
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { width: 100%; }
}

/* ---------------------------------------------------------
   Sections (shared)
--------------------------------------------------------- */
.section { max-width: var(--max-w); margin: 0 auto; padding: 3rem var(--pad); border-top: 1px solid var(--rule); }
.section__title { font-size: 0.95rem; color: var(--muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.06em; }
.section__hint { font-size: 0.85rem; color: var(--muted); margin: 0 0 1.75rem; }
.section:has(.section__hint) .section__title { margin-bottom: 0.25rem; }

/* ---------------------------------------------------------
   Experience timeline
--------------------------------------------------------- */
.entry { display: grid; grid-template-columns: 34px 1fr; gap: 1rem; }
.entry + .entry { margin-top: 2.5rem; }
.entry__rail { display: flex; flex-direction: column; align-items: center; }
.entry__dot {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; flex-shrink: 0;
}
.entry__line { width: 1px; flex: 1; background: var(--rule); margin-top: 8px; min-height: 1.5rem; }

.entry__date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); margin: 0 0 0.35rem; }
.entry__role { font-family: var(--font-sans); font-size: 1.05rem; font-weight: 700; margin-bottom: 1.1rem; }
.entry__at { font-weight: 400; color: var(--muted); }

.entry__other { margin-top: 1.1rem; }
.entry__other li { position: relative; padding-left: 1.1rem; color: var(--muted); margin-bottom: 0.5rem; font-size: 0.95rem; }
.entry__other li::before { content: ''; position: absolute; left: 0; top: 0.65em; width: 5px; height: 1px; background: var(--muted); }

.work-items { display: flex; flex-direction: column; gap: 0.6rem; }
.work-item {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  padding: 0.85rem 1rem; cursor: pointer; min-height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.work-item:hover, .work-item:focus-visible { border-color: var(--accent); box-shadow: var(--shadow-sm); outline: none; }
.work-item:active { transform: translateY(1px); }
.work-item__text { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
.work-item__name { font-family: var(--font-sans); font-weight: 700; }
.work-item__summary { color: var(--muted); font-size: 0.88rem; }
.work-item__chev { color: var(--accent); flex-shrink: 0; }

/* ---------------------------------------------------------
   Projects
--------------------------------------------------------- */
.projects { display: flex; flex-direction: column; gap: 1.25rem; }
.project {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  padding: 1.5rem; cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.project:hover, .project:focus-visible { border-color: var(--accent); box-shadow: var(--shadow-md); outline: none; }
.project:active { transform: translateY(1px); }
.project__head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.65rem; }
.project__icon { color: var(--tone-violet); background: var(--tone-violet-soft); width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.project h3 { font-family: var(--font-sans); font-size: 1.1rem; }
.project__desc { color: var(--text); margin-bottom: 0.9rem; }
.project__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.project__cta { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.project__cta .icon { width: 0.9em; }

.tag {
  font-family: var(--font-mono); font-size: 0.72rem; padding: 0.25rem 0.55rem;
  border: 1px solid var(--tone-sky); background: var(--tone-sky-soft); color: var(--tone-sky);
  border-radius: 999px;
}

/* ---------------------------------------------------------
   Skills
--------------------------------------------------------- */
.skills { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 620px) { .skills { grid-template-columns: 1fr 1fr; } }

.skills__group {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; padding: 1.25rem;
}
.skills__group h4 {
  display: flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-sans); font-size: 0.92rem; font-weight: 700; color: var(--text); margin-bottom: 0.9rem;
}
.skills__icon { color: var(--accent); background: var(--accent-soft); width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  font-family: var(--font-mono); font-size: 0.8rem; padding: 0.35rem 0.7rem;
  background: var(--surface-2); border: 1px solid var(--rule); border-radius: 999px; color: var(--text);
}

/* ---------------------------------------------------------
   Certifications
--------------------------------------------------------- */
.certs { display: flex; flex-direction: column; gap: 0.9rem; }
.cert-item {
  display: flex; align-items: flex-start; gap: 0.85rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1rem;
}
.cert-item__icon { color: var(--tone-amber); background: var(--tone-amber-soft); width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.cert-item__text { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.cert-item a { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-sans); font-weight: 700; color: var(--text); }
.cert-item a:hover { color: var(--accent); }
.cert-item__ext { width: 0.85em; color: var(--muted); }
.cert-item__meta { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }

/* ---------------------------------------------------------
   Education
--------------------------------------------------------- */
.edu { display: flex; flex-direction: column; gap: 1rem; }
.edu__entry {
  display: flex; gap: 0.85rem; background: var(--surface); border: 1px solid var(--rule);
  border-radius: 10px; padding: 1.1rem;
}
.edu__icon { color: var(--tone-green); background: var(--tone-green-soft); width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.edu__school { font-weight: 700; margin: 0 0 0.3rem; }
.edu__degree { color: var(--text); margin: 0 0 0.3rem; }
.edu__meta { color: var(--muted); margin: 0 0 0.3rem; font-size: 0.92rem; }
.edu__date { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); margin: 0; }

/* ---------------------------------------------------------
   Resume
--------------------------------------------------------- */
.resume-card {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
  padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.resume-card__icon { color: var(--accent); background: var(--accent-soft); width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.resume-card__text { flex: 1; min-width: 160px; }
.resume-card__title { font-weight: 700; margin: 0 0 0.2rem; }
.resume-card__meta { color: var(--muted); font-size: 0.88rem; margin: 0; }
.resume-card__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

@media (max-width: 480px) {
  .resume-card__actions { width: 100%; }
  .resume-card__actions .btn { flex: 1; }
}

/* ---------------------------------------------------------
   Contact
--------------------------------------------------------- */
.contact__lede { color: var(--muted); max-width: 50ch; margin-bottom: 1.75rem; }
.contact__links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.contact__links a {
  display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.88rem;
  color: var(--text); background: var(--surface); border: 1px solid var(--rule);
  padding: 0.55rem 0.9rem; border-radius: 999px;
}
.contact__links a:hover { border-color: var(--accent); color: var(--accent); }
.contact__links .icon { color: var(--accent); }

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.footer { max-width: var(--max-w); margin: 0 auto; padding: 2rem var(--pad) 3rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }

/* ---------------------------------------------------------
   Modal
--------------------------------------------------------- */
.modal { border: none; padding: 0; background: transparent; max-width: min(620px, 94vw); width: 100%; }
.modal::backdrop { background: rgba(34, 36, 43, 0.45); backdrop-filter: blur(2px); }
.modal__inner {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px;
  padding: 1.75rem; max-height: 85vh; overflow-y: auto; position: relative;
  box-shadow: var(--shadow-md);
}
@media (min-width: 640px) { .modal__inner { padding: 2.25rem; } }

.modal__close {
  position: absolute; top: 0.75rem; right: 0.75rem; background: var(--surface-2); border: none;
  color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0.4rem 0.7rem;
  border-radius: 8px; min-width: 40px; min-height: 40px;
}
.modal__close:hover, .modal__close:focus-visible { color: var(--accent); outline: none; background: var(--accent-soft); }
.modal__kicker { display: inline-flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); margin: 0 0 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.modal__title { font-size: 1.35rem; margin-bottom: 1.25rem; padding-right: 2rem; }
.modal__label { font-family: var(--font-sans); font-size: 0.85rem; font-weight: 700; color: var(--accent-dark); margin: 1.25rem 0 0.5rem; }
.modal__label:first-of-type { margin-top: 0; }
.modal__inner p { margin: 0 0 0.5rem; color: var(--text); }
.modal__inner ul { margin-top: 0.5rem; }
.modal__inner li { position: relative; padding-left: 1.1rem; color: var(--text); margin-bottom: 0.5rem; }
.modal__inner li::before { content: ''; position: absolute; left: 0; top: 0.65em; width: 5px; height: 1px; background: var(--muted); }
.modal__gallery { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.25rem; }
.modal__gallery img { width: 100%; border-radius: 8px; border: 1px solid var(--rule); }