/* =============================================================
   base.css — Shared reset, layout, and component structure
   Theme-specific colors/fonts live in theme-*.css files
   ============================================================= */

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img, svg { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── Skip link (accessibility) ──────────────────────────────── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: #000;
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 3.5rem 0;
}

/* ── Theme toggle button (always visible) ───────────────────── */
.theme-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.3s ease, color 0.3s ease;
}
.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}
.theme-toggle:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

/* ── Header ─────────────────────────────────────────────────── */
.section-header { padding-top: 4rem; padding-bottom: 3.5rem; }

.header-content {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-avatar {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
}

.header-text { flex: 1; }

.name {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.title {
  font-size: 1.05rem;
  font-weight: 500;
  margin-top: 0.3rem;
  opacity: 0.8;
}

.tagline {
  font-size: 0.9rem;
  margin-top: 0.2rem;
  opacity: 0.6;
}

.header-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  transition: opacity 0.15s;
}
.contact-link:hover { opacity: 0.7; }
.contact-link svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Section titles ─────────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  letter-spacing: -0.01em;
}
.section-title svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Experience ─────────────────────────────────────────────── */
.experience-list { display: flex; flex-direction: column; gap: 2rem; }

.experience-item {}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.experience-company { font-size: 1.05rem; font-weight: 700; }
.experience-title   { font-size: 0.9rem; margin-top: 0.15rem; }
.experience-meta    { font-size: 0.78rem; margin-top: 0.15rem; opacity: 0.6; }

.experience-dates {
  font-size: 0.78rem;
  white-space: nowrap;
  opacity: 0.6;
  text-align: right;
}

.experience-highlights {
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.experience-highlights li {
  font-size: 0.88rem;
  line-height: 1.55;
  position: relative;
  padding-left: 0.75rem;
}
.experience-highlights li::before {
  content: "▸";
  position: absolute;
  left: 0;
  opacity: 0.5;
}

/* ── Skills ─────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.5rem;
}

.skills-category {}
.skills-category-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
  opacity: 0.6;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tag {
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-weight: 500;
  transition: transform 0.15s;
}
.skill-tag:hover { transform: translateY(-1px); }

/* ── Education ──────────────────────────────────────────────── */
.education-list { display: flex; flex-direction: column; gap: 1.5rem; }

.education-item {}

.education-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.education-degree { font-size: 1rem; font-weight: 700; }
.education-school { font-size: 0.88rem; margin-top: 0.15rem; opacity: 0.75; }
.education-honors { font-size: 0.78rem; margin-top: 0.1rem; font-style: italic; }
.education-dates  { font-size: 0.78rem; white-space: nowrap; opacity: 0.6; text-align: right; }

/* ── Projects ───────────────────────────────────────────────── */
.projects-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  padding: 1.5rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-name { font-size: 1rem; font-weight: 700; }
.project-desc { font-size: 0.86rem; line-height: 1.55; opacity: 0.8; }

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.project-tech-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-weight: 600;
}

.project-link {
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
  transition: opacity 0.15s;
}
.project-link:hover { opacity: 0.7; }
.project-link svg { width: 13px; height: 13px; }

/* ── Contact CTA ────────────────────────────────────────────── */
.contact-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  padding: 2rem 0;
}
.contact-cta-text { font-size: 1rem; opacity: 0.8; }
.contact-buttons  { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.btn svg { width: 16px; height: 16px; }

.footer-note {
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.4;
  margin-top: 2.5rem;
}
.footer-note a { text-decoration: underline; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .header-content { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .header-avatar  { width: 64px; height: 64px; }
  .avatar-initials { font-size: 1.4rem; }
  .experience-header { flex-direction: column; }
  .education-header  { flex-direction: column; }
  .experience-dates, .education-dates { text-align: left; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .projects-list { grid-template-columns: 1fr; }
  .theme-toggle .theme-toggle-label { display: none; }
}

@media (max-width: 400px) {
  .skills-grid { grid-template-columns: 1fr; }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
