:root {
  color-scheme: dark;
  --bg: #0b0b0f;
  --panel: #111117;
  --panel-soft: rgba(255, 255, 255, 0.03);
  --line: #23232b;
  --text: #f5f5f5;
  --muted: #9f9fa9;
  --shadow: rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    'Liberation Mono',
    'Courier New',
    monospace;
}

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.page {
  width: min(100% - 2rem, 960px);
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.topbar {
  position: sticky;
  top: 0.75rem;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 0.9rem;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 15, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
  letter-spacing: 0.08em;
  transform: translateY(0.04em);
}

.lang-switch {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 1.2rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.lang-switch::before {
  content: '';
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 3rem;
  height: calc(100% - 0.4rem);
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.08);
  transform: translateX(0);
  transition:
    transform 320ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 220ms ease;
  z-index: 0;
}

html[data-current-lang='en'] .lang-switch::before {
  transform: translateX(3.35rem);
}

body.is-switching .lang-switch::before {
  box-shadow: 0 14px 36px rgba(255, 255, 255, 0.12);
}

.lang-switch a {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  border-radius: 999px;
  padding: 0.45rem 0;
  color: var(--muted);
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: color 120ms ease;
}

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

.lang-switch a[aria-current='page'] {
  color: var(--bg);
}

.lang-switch a:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding-top: 2rem;
}

.photo-wrap {
  width: 100%;
}

.photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px var(--shadow);
}

.content {
  min-width: 0;
}

.name {
  margin: 0;
  font-size: clamp(2.25rem, 8vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.bio {
  margin: 1rem 0 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.8;
}

.bio [data-i18n] {
  white-space: pre-wrap;
}

.bio-subline {
  margin-top: 0.2rem;
  color: #85858f;
}

@media (min-width: 780px) {
  .bio {
    max-width: none;
    white-space: nowrap;
  }

  .bio [data-i18n] {
    white-space: pre;
  }
}

[data-i18n] {
  transition:
    opacity 160ms ease,
    filter 160ms ease,
    text-shadow 160ms ease;
}

[data-i18n].scrambling {
  opacity: 0.88;
  filter: brightness(1.08);
  text-shadow: 0 0 0.6em rgba(255, 255, 255, 0.08);
}

.sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.section {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
}

.section.full {
  grid-column: 1 / -1;
}

.section h2 {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.list a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.1rem 0;
  text-decoration: none;
}

.list a:hover span {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.list small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.contact-link {
  font-size: 1.05rem;
}

@media (prefers-reduced-motion: reduce) {
  .lang-switch::before,
  [data-i18n] {
    transition: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    top: 0.5rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.3rem 0 0.55rem;
  }

  .brand {
    padding-left: 1rem;
  }

  .lang-switch {
    margin-right: 1rem;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .photo-wrap {
    max-width: 144px;
  }

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

  .section.full {
    grid-column: auto;
  }
}
