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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* ─── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--nav-bg);
  border-bottom: var(--border-width) solid var(--border);
  box-shadow: 0 var(--border-width) 0 var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.25s ease;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Logo */
.logo {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo::before {
  content: "< ";
  color: var(--primary);
}

.logo::after {
  content: " />";
  color: var(--accent);
}

/* Nav */
.site-nav {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.nav-link {
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  border: var(--border-width) solid transparent;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
  color: var(--text-muted);
}

.nav-link:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 2px 2px 0 var(--shadow);
}

.nav-link--active {
  background: var(--primary);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 3px 3px 0 var(--shadow);
}

.nav-link--active:hover {
  transform: translateY(-1px);
  box-shadow: 4px 4px 0 var(--shadow);
}

/* Theme toggle */
.theme-toggle {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: 50%;
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 var(--shadow);
}

.theme-toggle:active {
  transform: translateY(0);
  box-shadow: 1px 1px 0 var(--shadow);
}

/* ─── Main content area ────────────────────────────────────────────────────── */
.site-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* ─── Section title ────────────────────────────────────────────────────────── */
.section-title {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 2rem;
  display: inline-block;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 4px;
}

/* ─── Project grid ─────────────────────────────────────────────────────────── */
.projects-section { }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.75rem;
}

/* ─── Project card ─────────────────────────────────────────────────────────── */
.project-card {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
  transform: translate(-2px, -3px);
  box-shadow: calc(var(--shadow-offset) + 3px) calc(var(--shadow-offset) + 3px) 0 var(--shadow);
}

.project-card__img-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: var(--border-width) solid var(--border);
  background: var(--tag-bg);
  position: relative;
}

.project-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-card__img {
  transform: scale(1.04);
}

.project-card__unsplash {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.45);
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.85);
  text-align: right;
}

.project-card__unsplash a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
}

.project-card__body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.project-card__title {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
}

.project-card__desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

/* Tags */
.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
}

/* Project card link row */
.project-card__links {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  border: var(--border-width) solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 3px 3px 0 var(--shadow);
  white-space: nowrap;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--shadow);
}

.btn--primary {
  background: var(--primary);
  color: var(--text);
}

.btn--primary:hover {
  background: var(--primary-dark);
}

.btn--outline {
  background: var(--surface);
  color: var(--text);
}

.btn--outline:hover {
  background: var(--tag-bg);
}

/* ─── About page ───────────────────────────────────────────────────────────── */
.about-section {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.about-card {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow);
  padding: 2rem;
}

.about-card__photo-wrap {
  flex-shrink: 0;
}

.about-card__photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: var(--border-width) solid var(--border);
  box-shadow: 4px 4px 0 var(--shadow);
}

.about-card__photo-placeholder {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--tag-bg);
  border: var(--border-width) solid var(--border);
  box-shadow: 4px 4px 0 var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.about-card__content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.about-card__name {
  font-size: 2rem;
  font-weight: 900;
}

.about-card__tagline {
  font-size: 1rem;
  color: var(--primary-dark);
  font-weight: 700;
}

.about-card__bio {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.about-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* ─── CV section ───────────────────────────────────────────────────────────── */
.cv-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cv-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.cv-section__header .section-title {
  margin-bottom: 0;
}

.cv-embed-wrap {
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow);
  overflow: hidden;
  background: var(--surface);
  min-height: 600px;
  position: relative;
}

.cv-embed {
  width: 100%;
  height: 750px;
  display: block;
  border: none;
}

/* ─── CV page ──────────────────────────────────────────────────────────────── */
.cv-page {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Header card */
.cv-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow);
  padding: 2rem;
}

.cv-header-card__name {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
}

.cv-header-card__headline {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-top: 0.3rem;
}

.cv-header-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.cv-header-card__meta li { display: flex; align-items: center; gap: 0.3rem; }
.cv-header-card__meta a  { color: var(--primary-dark); font-weight: 700; text-decoration: underline; }

/* Two-column body */
.cv-body {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Generic cv card */
.cv-card {
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cv-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cv-card__title {
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
  border-bottom: var(--border-width) solid var(--border);
}

/* Skills */
.cv-skills-list { display: flex; flex-direction: column; gap: 0.9rem; }

.cv-skill__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.cv-skill__name   { font-weight: 800; font-size: 0.92rem; }
.cv-skill__years  { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }

.cv-skill__keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

/* Languages */
.cv-lang-list { display: flex; flex-direction: column; gap: 0.5rem; }

.cv-lang {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.cv-lang__name  { font-weight: 800; }
.cv-lang__level { color: var(--text-muted); font-size: 0.82rem; font-weight: 600; }

/* Certifications */
.cv-cert-list { display: flex; flex-direction: column; gap: 0.75rem; }

.cv-cert { display: flex; flex-direction: column; gap: 0.15rem; }
.cv-cert__name   { font-weight: 800; font-size: 0.9rem; }
.cv-cert__issuer { font-size: 0.8rem; color: var(--text-muted); }
.cv-cert__date   { font-size: 0.78rem; color: var(--text-muted); }

/* Timeline (experience + projects) */
.cv-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.cv-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: var(--border-width);
  background: var(--border);
}

.cv-timeline__item {
  display: flex;
  gap: 1rem;
  position: relative;
  padding-bottom: 1.5rem;
}

.cv-timeline__item:last-child { padding-bottom: 0; }

.cv-timeline__dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: var(--border-width) solid var(--border);
  box-shadow: 2px 2px 0 var(--shadow);
  flex-shrink: 0;
  margin-top: 3px;
  z-index: 1;
}

.cv-timeline__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cv-timeline__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.cv-timeline__role    { font-weight: 900; font-size: 1rem; }
.cv-timeline__company { font-weight: 700; font-size: 0.88rem; color: var(--primary-dark); }

.cv-timeline__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.cv-timeline__date     { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; white-space: nowrap; }
.cv-timeline__location { font-size: 0.75rem; color: var(--text-muted); text-align: right; }

.cv-timeline__summary {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Shared link style used in CV */
.link {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: underline;
}

/* ─── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 2rem;
  border: var(--border-width) dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}

/* ─── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: var(--border-width) solid var(--border);
  text-align: center;
  padding: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .about-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-card__links {
    justify-content: center;
  }

  .cv-section__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cv-embed {
    height: 500px;
  }

  .cv-body {
    grid-template-columns: 1fr;
  }

  .cv-header-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .cv-timeline__header {
    flex-direction: column;
  }

  .cv-timeline__meta {
    align-items: flex-start;
  }

  .header-inner {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 0.95rem;
  }

  .nav-link {
    padding: 0.35rem 0.65rem;
  }
}
