:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #171717;
  --muted: #63605b;
  --line: #ded9cf;
  --accent: #1f4f46;
  --accent-soft: #e3ece8;
  --shadow: 0 20px 50px rgba(31, 79, 70, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

section[id] {
  scroll-margin-top: 110px;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--text);
  color: #ffffff;
  font-weight: 700;
  transform: translateY(-160%);
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px;
  background: rgba(247, 245, 240, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
}

.nav {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover,
.project-card a:hover,
.contact-links a:hover {
  color: var(--accent);
}

.language-switch {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.language-button {
  min-width: 42px;
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.language-button.is-active {
  background: var(--accent);
  color: #ffffff;
}

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 88px 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 56px;
  min-height: calc(100vh - 86px);
}

.eyebrow,
.section-label,
.project-type {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 22px;
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.hero-text,
.split p,
.contact p {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.13rem;
}

.actions,
.contact-links,
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.project-card a,
.contact-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  font-weight: 700;
}

.button {
  padding: 12px 18px;
}

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

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

.avatar {
  width: clamp(132px, 18vw, 184px);
  height: clamp(132px, 18vw, 184px);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.split {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  border-top: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 30px;
}

.skill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-grid span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 15px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  min-height: 290px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--surface);
}

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

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.project-stack li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.project-card a {
  width: fit-content;
  min-height: 0;
  color: var(--accent);
}

.project-card.muted {
  background: var(--accent-soft);
}

.contact {
  border-top: 1px solid var(--line);
  padding-bottom: 110px;
}

.contact-links a {
  border: 1px solid var(--line);
  padding: 10px 15px;
  background: var(--surface);
}

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.error-content h1 {
  margin-bottom: 18px;
}

.error-content p {
  max-width: 560px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 1.1rem;
}

@media (max-width: 820px) {
  .site-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 34px;
    min-height: auto;
    padding-top: 56px;
  }

  .avatar {
    order: -1;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 14px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 520px) {
  .site-header,
  .section {
    padding-left: 18px;
    padding-right: 18px;
  }

  .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  h1 {
    font-size: 3.2rem;
  }

  .button,
  .contact-links a {
    width: 100%;
  }
}
