/* Нормализация базовых стилей */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: none; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

:root {
  --text: #1f2a3d;
  --card: #ffffff;
  --bg-pattern-light: url("light-bg.png");
  --bg-pattern-dark: url("dark-bg.png");
  --panel: rgba(255, 255, 255, 0.75);
  --panel-border: rgba(0, 0, 0, 0.04);
  --bubble-bg: rgba(255, 255, 255, 0.95);
  --bubble-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  --bubble-text: #1f2a3d;
}
:root[data-theme="dark"] .caption-block {
  background: rgba(12, 16, 24, 0.9);
  color: #f7faff;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] {
  --text: #e7edf7;
  --card: #111827;
  --panel: rgba(15, 18, 28, 0.8);
  --panel-border: rgba(255, 255, 255, 0.07);
  --bubble-bg: rgba(14, 18, 26, 0.95);
  --bubble-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  --bubble-text: #e7edf7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #e7edf7;
    --card: #111827;
  }
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Manrope", "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: #f7f8fa;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: 24px;
  transition: background 240ms ease, color 240ms ease;
}
body[data-mode="dark"] {
  background: #0b1018;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.35), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(200,210,225,0.22), transparent 40%),
    var(--bg-pattern-light);
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: 140% 140%, 180% 180%, 400px 392px;
  background-position: center;
  opacity: 1;
  transition: opacity 280ms ease;
}
body::after {
  background-image:
    radial-gradient(circle at 20% 20%, rgba(40,50,72,0.45), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(18,26,48,0.4), transparent 42%),
    var(--bg-pattern-dark);
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: 140% 140%, 180% 180%, 256px 256px;
  background-position: center;
  opacity: 0;
}
body[data-mode="dark"]::before { opacity: 0; }
body[data-mode="dark"]::after { opacity: 1; }
.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 36px;
  padding: 4px;
  border: 1px solid rgba(31, 42, 61, 0.35);
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}
.theme-toggle:hover {
  border-color: rgba(31, 42, 61, 0.6);
}
.theme-toggle:focus-visible {
  outline: 3px solid #2f7efb;
  outline-offset: 4px;
}
.toggle-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.04);
  transition: background 200ms ease;
}
.theme-toggle[data-mode="dark"] .toggle-track {
  background: rgba(255, 255, 255, 0.08);
}
.toggle-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.65;
  transition: opacity 200ms ease;
}
.theme-toggle[data-mode="light"] .icon-sun,
.theme-toggle[data-mode="dark"] .icon-moon {
  opacity: 1;
}
.toggle-knob {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  transition: transform 220ms ease, background 200ms ease, box-shadow 200ms ease;
  transform: translate(26px, -50%);
}
.theme-toggle[data-mode="dark"] .toggle-knob {
  transform: translate(0, -50%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.panel {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 32px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 2;
}
.people {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 24px;
  justify-items: center;
  align-items: stretch;
}
.person {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  justify-items: center;
  align-items: stretch;
  text-align: center;
  width: 100%;
  max-width: 420px;
  height: 100%;
}
.photo {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 24px;
  box-shadow:
    0 22px 68px rgba(10, 24, 46, 0.34),
    0 10px 30px rgba(0, 0, 0, 0.14);
  background: var(--card);
  transition: box-shadow 220ms ease, filter 220ms ease, transform 220ms ease;
  text-decoration: none;
  display: block;
  transform: translateY(0) scale(1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  pointer-events: none;
  transition: opacity 220ms ease;
  opacity: 0;
}
.photo.active {
  box-shadow:
    0 36px 98px rgba(10, 24, 46, 0.38),
    0 16px 38px rgba(0, 0, 0, 0.16);
  filter: saturate(1.05);
  transform: scale(1.02);
  z-index: 3;
}
.photo.active::after { opacity: 0; }
.photo.faded {
  filter: blur(3px) brightness(0.7);
  transform: translateY(0);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}
.diggy.faded {
  filter: blur(3px) brightness(0.7);
}
.caption-block {
  position: relative;
  z-index: 4;
  color: var(--text);
  text-align: center;
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.caption-block .name {
  font-family: "Montserrat", "Space Grotesk", "Manrope", sans-serif;
  font-weight: 700;
  letter-spacing: 0.015em;
  font-size: 23px;
  line-height: 1.2;
}
.caption-block .role {
  font-family: "Space Grotesk", "Manrope", "Montserrat", "Segoe UI", Tahoma, sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  opacity: 0.9;
}
.caption-block .note {
  font-family: "Space Grotesk", "Manrope", "Montserrat", "Segoe UI", Tahoma, sans-serif;
  font-weight: 500;
  font-size: 13.5px;
  line-height: 1.45;
  opacity: 0.9;
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
}
.photo:focus-visible {
  outline: 3px solid #2f7efb;
  outline-offset: 6px;
}
@media (max-width: 1080px) {
  .panel { padding: 22px; }
  .people { grid-template-columns: repeat(2, minmax(260px, 1fr)); }
}
@media (max-width: 900px) {
  body {
    display: block;
    padding-bottom: 0;
  }
  .panel { padding: 20px; }
  .people { grid-template-columns: 1fr; }
  .diggy-wrap {
    position: sticky;
    bottom: 12px;
    right: 12px;
    left: auto;
    width: auto;
    display: flex;
    justify-content: flex-end;
    padding: 0;
    margin-top: 36px;
    margin-left: auto;
    z-index: 2;
  }
}
@media (max-width: 600px) {
  body { padding: 18px; }
  .theme-toggle { top: 14px; right: 14px; }
}
@media (max-width: 420px) {
  body { padding: 16px; }
  .caption-block { padding: 12px; }
}
.dim-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(10, 16, 28, 0.26);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 260ms ease, background 260ms ease;
  pointer-events: none;
}
body.dimmed .dim-overlay {
  opacity: 1;
}
.page-fade {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}
.page-fade.is-fading {
  opacity: 1;
  pointer-events: auto;
}
.diggy-wrap {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 16;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.diggy-wrap.hidden {
  opacity: 0;
  pointer-events: none;
}
.diggy {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.25));
  pointer-events: auto;
  cursor: pointer;
  display: block;
}
@media (max-width: 900px) {
  .diggy { width: 130px; }
}
@media (max-width: 600px) {
  .diggy { width: 110px; }
}
.diggy-bubble {
  position: absolute;
  right: calc(100% + 16px);
  bottom: calc(100% - 24px);
  min-width: 220px;
  max-width: 320px;
  background: var(--bubble-bg);
  color: var(--bubble-text);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--bubble-shadow);
  border: none;
  font-size: 14px;
  line-height: 1.5;
  transform: translateY(6px);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: auto;
  white-space: normal;
}
.diggy-wrap.show .diggy-bubble {
  opacity: 1;
  transform: translateY(0);
}
:root[data-theme="dark"] .diggy-bubble {
  background: rgba(14, 18, 26, 0.95);
  color: #e7edf7;
  border: none;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}
body.page-is-fading .hero,
body.page-is-fading .panel,
body.page-is-fading .diggy-wrap,
body.page-is-fading .theme-toggle {
  filter: blur(2px);
  opacity: 0;
  transition: opacity 220ms ease, filter 220ms ease;
}
.hero {
  margin: 0 0 18px;
  text-align: center;
  z-index: 3;
  position: relative;
  display: grid;
  gap: 8px;
  align-items: center;
  justify-items: center;
}
.tagline {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(31, 42, 61, 0.78);
  background: rgba(255, 255, 255, 0.55);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
}
:root[data-theme="dark"] .tagline {
  color: rgba(231, 237, 247, 0.8);
  background: rgba(16, 20, 30, 0.65);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
.title {
  margin: 0;
  font-family: "Montserrat", "Space Grotesk", "Manrope", sans-serif;
  font-weight: 700;
  font-size: clamp(40px, 4vw + 20px, 72px);
  letter-spacing: 0.05em;
  color: #b17845;
  background: linear-gradient(115deg, #c58c5c, #8c5a2b, #d8b08c);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 220% 220%;
  background-position: center;
  display: inline-block;
  opacity: 1;
  filter: none;
  text-shadow:
    0 12px 26px rgba(0, 0, 0, 0.2),
    0 4px 10px rgba(0, 0, 0, 0.16);
}
:root[data-theme="dark"] .title {
  color: #d9b489;
  background: linear-gradient(115deg, #e8c3a0, #b07a4a, #f5d7b2);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 26px rgba(255, 224, 180, 0.46),
    0 0 58px rgba(255, 224, 180, 0.32);
}

