:root {
  color-scheme: light dark;

  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1b1d21;
  --muted: #5d636e;
  --border: #e3e3df;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --accent-soft: #e6effd;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.06);

  --radius: 14px;
  --max: 1080px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --text: #e8eaee;
    --muted: #9aa2af;
    --border: #262b35;
    --accent: #6ea8ff;
    --accent-text: #0f1115;
    --accent-soft: #1a2638;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
}

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

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
}

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand span {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav a,
.lang a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav a:hover,
.lang a:hover {
  color: var(--text);
}

.lang {
  display: flex;
  gap: 4px;
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.lang a,
.lang span {
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.lang span {
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 720px) {
  .nav {
    display: none;
  }

  .lang {
    margin-left: auto;
    border-left: 0;
    padding-left: 0;
  }
}

/* Sections */

section {
  padding-block: clamp(56px, 9vw, 96px);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4rem);
  letter-spacing: -0.03em;
}

.tagline {
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  color: var(--muted);
  margin: 12px 0 24px;
}

.hero p.intro {
  max-width: 60ch;
  margin: 0 0 32px;
}

.hero-photo {
  width: clamp(180px, 26vw, 300px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: var(--shadow);
}

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

.button {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

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

.button:hover {
  filter: brightness(1.08);
}

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

  .hero-photo {
    order: -1;
  }
}

/* Projects */

.projects {
  display: grid;
  gap: 24px;
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: center;
  padding: clamp(16px, 3vw, 28px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.project-media {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bg);
}

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

.project-media:hover img {
  transform: scale(1.03);
}

.project-media .count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.65);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

.project h3 {
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

.project .client {
  margin: 4px 0 0;
  font-weight: 600;
}

.project .summary {
  margin: 8px 0 16px;
  color: var(--muted);
}

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

.tags li {
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.85rem;
}

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

/* Services & skills */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
}

.skill-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.skill-groups h3 {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.skill-groups .tags li {
  background: var(--surface);
  border: 1px solid var(--border);
}

/* About */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px 48px;
  margin: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.facts dd {
  margin: 4px 0 0;
}

.facts ul {
  margin: 0;
  padding-left: 1.1em;
}

/* Contact */

.contact {
  text-align: center;
}

.contact .mail {
  display: inline-block;
  margin-top: 8px;
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.contact .mail:hover {
  text-decoration: underline;
}

.site-footer {
  padding-block: 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Gallery */

.gallery {
  width: min(1200px, 100vw - 32px);
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: #0b0c0f;
  color: #fff;
}

.gallery::backdrop {
  background: rgb(0 0 0 / 0.75);
}

.gallery-stage {
  position: relative;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  height: min(70vh, 720px);
  padding: 48px 56px 16px;
}

.gallery-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery button {
  border: 0;
  background: rgb(255 255 255 / 0.1);
  color: #fff;
  cursor: pointer;
  border-radius: 999px;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  line-height: 1;
}

.gallery button:hover {
  background: rgb(255 255 255 / 0.2);
}

.gallery .close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.gallery .prev,
.gallery .next {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
}

.gallery .prev {
  left: 8px;
}

.gallery .next {
  right: 8px;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  padding: 8px 16px 16px;
  overflow-x: auto;
  justify-content: safe center;
}

.gallery-thumbs button {
  flex: none;
  width: 96px;
  height: 60px;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  opacity: 0.5;
  outline-offset: 2px;
}

.gallery-thumbs button[aria-current="true"] {
  opacity: 1;
  outline: 2px solid #fff;
}

.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

  .project-media img {
    transition: none;
  }
}
