:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #eef3f8;
  --text: #101820;
  --muted: #667085;
  --line: #d8e0ea;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #d9f3ee;
  --warm: #f97316;
  --shadow: 0 24px 70px rgba(16, 24, 32, 0.12);
  --radius: 8px;
  --max-width: 1180px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #171b22;
  --surface-strong: #202631;
  --text: #f3f6fa;
  --muted: #a9b4c1;
  --line: #313946;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.13);
  --warm: #fb923c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.15), transparent 36rem),
    linear-gradient(135deg, var(--bg), var(--surface-strong));
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(102, 112, 133, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 112, 133, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 72%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), white 18%);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  transform: translateY(-160%);
  border-radius: var(--radius);
  background: var(--text);
  color: var(--surface);
  padding: 0.75rem 1rem;
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2.5rem) 0;
}

.profile-panel {
  align-self: start;
  position: sticky;
  top: 2rem;
  display: grid;
  gap: 1rem;
}

.profile-card,
.panel-section,
.topbar,
.intro-section,
.content-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface), transparent 4%);
  box-shadow: var(--shadow);
}

.profile-card {
  padding: clamp(1.1rem, 3vw, 1.5rem);
}

.profile-photo {
  display: block;
  width: min(100%, 13rem);
  aspect-ratio: 1;
  margin-bottom: 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  filter: saturate(0.92) contrast(1.04);
}

.eyebrow,
.section-kicker,
.project-type {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-card h1 {
  margin-top: 0.35rem;
  font-size: clamp(2rem, 8vw, 3.1rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.role {
  margin-top: 1rem;
  color: var(--muted);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.button,
.project-card a,
.language-switch a,
.copy-link {
  display: inline-flex;
  min-height: 2.6rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.button {
  padding: 0.72rem 1rem;
  font-weight: 800;
}

.button:hover,
.project-card a:hover,
.language-switch a:hover,
.copy-link:hover {
  transform: translateY(-2px);
}

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

.button-ghost {
  border: 1px solid var(--line);
  background: var(--surface);
}

.panel-section {
  padding: 1.15rem;
}

.panel-section h2 {
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-list {
  display: grid;
  gap: 0.9rem;
  list-style: none;
}

.contact-list li {
  display: grid;
  gap: 0.18rem;
}

.contact-list span,
.language-item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-list a,
.copy-link {
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.copy-link[data-copied="true"] {
  color: var(--accent);
}

.language-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}

.language-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.cv-main {
  display: grid;
  gap: 1rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem;
}

.language-switch {
  display: flex;
  gap: 0.5rem;
}

.language-switch a {
  border: 1px solid var(--line);
  padding: 0 0.9rem;
  font-weight: 800;
}

.language-switch a[aria-current="page"] {
  border-color: transparent;
  background: var(--text);
  color: var(--surface);
}

.theme-toggle {
  display: inline-flex;
  gap: 0.65rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0.35rem 0.75rem 0.35rem 0.38rem;
  cursor: pointer;
  font-weight: 800;
}

.theme-toggle__track {
  position: relative;
  width: 2.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--surface-strong);
}

.theme-toggle__track::after {
  content: "";
  position: absolute;
  left: 0.18rem;
  top: 0.18rem;
  width: 0.99rem;
  height: 0.99rem;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 180ms ease;
}

:root[data-theme="dark"] .theme-toggle__track::after {
  transform: translateX(1rem);
}

.intro-section,
.content-section {
  padding: clamp(1.3rem, 4vw, 2rem);
}

.intro-section h2 {
  max-width: 820px;
  margin-top: 0.45rem;
  font-size: clamp(2.15rem, 5vw, 4.55rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.hero-metrics article,
.skill-group,
.project-card,
.timeline li,
.traits-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-metrics article {
  padding: 1rem;
}

.hero-metrics strong {
  display: block;
  color: var(--warm);
  font-size: clamp(1.7rem, 4vw, 2.45rem);
  line-height: 1;
}

.hero-metrics span {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.section-heading {
  display: grid;
  gap: 0.35rem;
  max-width: 760px;
  margin-bottom: 1.2rem;
}

.section-heading h2 {
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 1.1;
}

.skill-groups,
.projects-grid,
.traits-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.skill-group,
.traits-grid article {
  padding: 1rem;
}

.skill-group h3,
.project-card h3,
.timeline h3,
.traits-grid h3 {
  margin-bottom: 0.5rem;
  font-size: 1.08rem;
}

.tag-list,
.mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag-list span,
.mini-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0.35rem 0.62rem;
  font-size: 0.83rem;
  font-weight: 800;
}

.projects-grid {
  grid-template-columns: 1fr;
}

.project-card {
  display: grid;
  gap: 1.2rem;
  padding: 1.1rem;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card:hover {
  border-color: color-mix(in srgb, var(--accent), var(--line));
  box-shadow: 0 18px 44px rgba(15, 118, 110, 0.12);
  transform: translateY(-3px);
}

.project-card p:not(.project-type),
.timeline p,
.traits-grid p {
  color: var(--muted);
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
}

.project-card a {
  border: 1px solid var(--line);
  padding: 0 0.9rem;
  font-weight: 800;
}

.project-card a:hover {
  border-color: transparent;
  background: var(--text);
  color: var(--surface);
}

.timeline {
  display: grid;
  gap: 0.85rem;
  list-style: none;
  counter-reset: timeline;
}

.timeline li {
  position: relative;
  padding: 1rem 1rem 1rem 3.3rem;
}

.timeline li::before {
  counter-increment: timeline;
  content: counter(timeline, decimal-leading-zero);
  position: absolute;
  left: 1rem;
  top: 1rem;
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  font-size: 0.72rem;
  font-weight: 900;
}

.timeline span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--warm);
  font-size: 0.82rem;
  font-weight: 900;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .profile-panel {
    position: static;
  }

  .profile-card {
    display: grid;
    grid-template-columns: minmax(8rem, 11rem) 1fr;
    gap: 1rem;
    align-items: center;
  }

  .profile-photo {
    margin: 0;
  }

  .quick-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 1rem, var(--max-width));
    padding-top: 0.5rem;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .profile-photo {
    width: 10rem;
  }

  .topbar,
  .card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-metrics,
  .skill-groups,
  .traits-grid {
    grid-template-columns: 1fr;
  }

  .intro-section h2 {
    font-size: clamp(2rem, 13vw, 3.2rem);
  }

  .quick-actions,
  .language-switch {
    width: 100%;
  }

  .button,
  .language-switch a,
  .theme-toggle,
  .project-card a {
    width: 100%;
  }
}

@media print {
  body {
    background: #fff;
  }

  body::before,
  .topbar,
  .quick-actions,
  .skip-link {
    display: none;
  }

  .page-shell {
    display: block;
    width: 100%;
    padding: 0;
  }

  .profile-panel {
    position: static;
  }

  .profile-card,
  .panel-section,
  .intro-section,
  .content-section {
    box-shadow: none;
    break-inside: avoid;
    margin-bottom: 0.8rem;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
