:root {
  --portal-bg: #0e0d0c;
  --portal-text: #f4f0ea;
  --portal-muted: rgba(244, 240, 234, 0.55);
  --portal-accent: #c4a882;
  --portal-yin: #1a1816;
  --portal-yang: #f4f0ea;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Montserrat', system-ui, sans-serif;
}

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

html, body {
  height: 100%;
}

body.portal {
  font-family: var(--font-sans);
  color: var(--portal-text);
  background: var(--portal-bg);
  overflow: hidden;
  min-height: 100%;
}

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

.portal-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 45%, #1c1916 0%, #0e0d0c 70%);
}

.portal-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: orb-drift 18s ease-in-out infinite;
}

.portal-orb--1 {
  width: 42vw;
  height: 42vw;
  top: -10%;
  left: -8%;
  background: #3d342c;
  animation-delay: 0s;
}

.portal-orb--2 {
  width: 36vw;
  height: 36vw;
  right: -10%;
  bottom: -5%;
  background: #2a3340;
  animation-delay: -6s;
  animation-duration: 22s;
}

.portal-orb--3 {
  width: 28vw;
  height: 28vw;
  left: 40%;
  top: 55%;
  background: #4a3f32;
  opacity: 0.3;
  animation-delay: -12s;
  animation-duration: 26s;
}

@keyframes orb-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(4%, -3%) scale(1.05); }
  66% { transform: translate(-3%, 4%) scale(0.96); }
}

.portal-main {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  text-align: center;
}

.portal-name {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  opacity: 0;
  animation: fade-up 1s ease 0.15s forwards;
}

.portal-hint {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--portal-muted);
  margin-bottom: 40px;
  opacity: 0;
  animation: fade-up 1s ease 0.35s forwards;
}

.portal-sub {
  margin-top: 36px;
  font-size: 0.8rem;
  color: var(--portal-muted);
  letter-spacing: 0.06em;
  opacity: 0;
  animation: fade-up 1s ease 0.9s forwards;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.taiji {
  position: relative;
  width: min(72vw, 380px);
  opacity: 0;
  animation: fade-up 1.1s ease 0.5s forwards, taiji-breathe 6s ease-in-out 1.6s infinite;
}

@keyframes taiji-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.taiji-svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.45));
  overflow: visible;
}

.taiji-ring {
  stroke: rgba(244, 240, 234, 0.12);
  stroke-width: 2;
}

.taiji-half {
  cursor: pointer;
  transition: opacity 0.35s ease;
  outline: none;
}

.taiji-half path,
.taiji-half circle {
  transition: fill 0.35s ease, filter 0.35s ease;
}

/* Белую сторону чуть высветляем; чёрную заливку не меняем */
.taiji-yang:hover path {
  fill: #ffffff;
}

/* Тень по контуру капли (path), а не у всей группы — иначе у чёрной светится только белая точка */
.taiji-yin:hover path,
.taiji-yang:hover path,
.taiji-yin:focus-within path,
.taiji-yang:focus-within path {
  filter: drop-shadow(0 0 22px rgba(166, 168, 70, 0.75))
          drop-shadow(0 0 22px rgba(196, 168, 130, 0.4));
}

.taiji:has(.taiji-yin:hover) .taiji-yang,
.taiji:has(.taiji-yin:focus-within) .taiji-yang {
}

.taiji:has(.taiji-yang:hover) .taiji-yin,
.taiji:has(.taiji-yang:focus-within) .taiji-yin {
  opacity: 0.45;
}

.taiji-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  gap: 16px;
  pointer-events: none;
}

.taiji-label {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.taiji-label--yin {
  align-items: flex-start;
  text-align: left;
}

.taiji-label--yang {
  align-items: flex-end;
  text-align: right;
}

.taiji-label-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--portal-muted);
}

.taiji-label-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
}

.taiji:has(.taiji-yin:hover) .taiji-label--yang,
.taiji:has(.taiji-yang:hover) .taiji-label--yin {
  opacity: 0.35;
}

.taiji:has(.taiji-yin:hover) .taiji-label--yin,
.taiji:has(.taiji-yang:hover) .taiji-label--yang {
  transform: translateY(-2px);
}

.taiji-label:hover .taiji-label-title {
  color: var(--portal-accent);
}

@media (max-width: 520px) {
  .taiji {
    width: min(78vw, 300px);
  }

  .portal-sub {
    display: none;
  }

  .taiji-label-title {
    font-size: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-orb,
  .taiji,
  .portal-name,
  .portal-hint,
  .portal-sub {
    animation: none;
    opacity: 1;
  }
}
