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

:root {
  --bg-deep: #0a0d14;
  --bg-surface: rgba(14, 18, 30, 0.78);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf2;
  --text-muted: #9aa3b8;
  --accent: #005a9a;
  --accent-orange: #943801;
  --accent-purple: #5a3d78;
  --accent-glow: rgba(0, 90, 154, 0.4);
  --orb-1: #003d6b;
  --orb-2: #5a2800;
  --orb-3: #3a2858;
  --radius: 1.25rem;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, Georgia, "Times New Roman", Times, serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

/* Animated background */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    ellipse 60% 55% at 50% 40%,
    rgba(10, 13, 20, 0.82) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.bg__orb {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  offset-path: rect(0 100% 100% 0);
  offset-anchor: center;
  offset-rotate: 0deg;
  will-change: offset-distance, opacity;
}

.bg__orb--1 {
  width: min(40vw, 380px);
  height: min(40vw, 380px);
  background: var(--orb-1);
  animation:
    edge-orbit 240s linear infinite,
    orb-pulse 7s ease-in-out infinite;
}

.bg__orb--2 {
  width: min(36vw, 340px);
  height: min(36vw, 340px);
  background: var(--orb-2);
  animation:
    edge-orbit 300s linear -100s infinite,
    orb-pulse 8.5s ease-in-out -1.5s infinite;
}

.bg__orb--3 {
  width: min(34vw, 320px);
  height: min(34vw, 320px);
  background: var(--orb-3);
  animation:
    edge-orbit 200s linear -130s infinite,
    orb-pulse 6.5s ease-in-out -3s infinite;
}

.bg__grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 20%, transparent 75%);
  animation: grid-pulse 8s ease-in-out infinite;
}

@keyframes edge-orbit {
  to {
    offset-distance: 100%;
  }
}

@keyframes orb-pulse {
  0%, 100% {
    opacity: 0.42;
  }
  50% {
    opacity: 0.62;
  }
}

@keyframes grid-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.85; }
}

@supports not (offset-path: rect(0 100% 100% 0)) {
  .bg__orb {
    offset-path: none;
    animation: orb-pulse 7s ease-in-out infinite;
  }

  .bg__orb--1 {
    top: -12%;
    left: -8%;
  }

  .bg__orb--2 {
    top: auto;
    bottom: -10%;
    right: -8%;
    left: auto;
  }

  .bg__orb--3 {
    top: 20%;
    bottom: auto;
    right: auto;
    left: -6%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg__orb,
  .bg__grid {
    animation: none;
  }

  .bg__orb {
    offset-distance: 0%;
  }

  .bg__orb--1 {
    offset-distance: 0%;
  }

  .bg__orb--2 {
    offset-distance: 33%;
  }

  .bg__orb--3 {
    offset-distance: 66%;
  }
}

.page {
  position: relative;
  z-index: 2;
  isolation: isolate;
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 2.5rem;
}

.lang-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.lang-switch__btn {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.85rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

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

.lang-switch__btn.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-orange), var(--accent-purple));
  color: var(--bg-deep);
}

/* Hero */
.hero {
  display: grid;
  gap: 1.75rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

@media (min-width: 540px) {
  .hero {
    grid-template-columns: auto 1fr;
    gap: 2rem;
  }
}

.hero__photo-wrap {
  --photo-size: min(220px, 70vw);
  position: relative;
  width: var(--photo-size);
  height: var(--photo-size);
  margin: 0 auto;
  flex-shrink: 0;
}

@media (min-width: 540px) {
  .hero__photo-wrap {
    --photo-size: 200px;
    margin: 0;
  }
}

.hero__photo-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-orange), var(--accent-purple));
  animation: ring-spin 12s linear infinite;
  z-index: 0;
}

@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__photo-wrap::before {
    animation: none;
  }
}

.hero__photo-frame {
  position: absolute;
  inset: 6px;
  z-index: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--bg-deep);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.hero__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero__text {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero__name {
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 6vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero__role {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
}

.hero__location {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero__location a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent-glow);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.hero__location a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

@media (min-width: 540px) {
  .hero__text {
    text-align: left;
  }
}

/* Panels */
.content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel {
  padding: 1.5rem 1.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.panel__title {
  margin: 0 0 1.25rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Timeline */
.timeline-block + .timeline-block {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.timeline-block__head {
  margin-bottom: 0.85rem;
}

.timeline-block__label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-purple);
  margin-bottom: 0.2rem;
}

.timeline-block__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding-left: 1.35rem;
  margin-bottom: 0.65rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.timeline li:last-child {
  margin-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-orange));
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Contact */
.panel--contact .contact__lead {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.contact__email-code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--text);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  padding: 0.15em 0.45em;
}

.contact__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.contact__links a:hover {
  color: var(--accent);
}

.contact__sep {
  margin: 0 0.5rem;
  color: var(--border);
}
