/**
 * Home page — hero and three portal cards
 */

.proto-hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6rem);
  overflow: hidden;
}

.proto-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(59, 95, 127, 0.07), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 75%, rgba(201, 169, 98, 0.06), transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(91, 75, 138, 0.05), transparent 45%);
  pointer-events: none;
}

.proto-hero__inner {
  position: relative;
  display: grid;
  gap: var(--space-6);
  align-items: center;
  max-width: 52rem;
  margin-inline: auto;
  padding-inline: var(--section-padding-x);
}

@media (min-width: 768px) {
  .proto-hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 21rem);
    gap: clamp(1rem, 2vw, 1.75rem);
    align-items: center;
  }
}

.proto-hero__content {
  text-align: center;
}

@media (min-width: 768px) {
  .proto-hero__content {
    text-align: left;
  }
}

.proto-hero__portrait {
  margin-inline: auto;
  max-width: 18rem;
}

@media (min-width: 768px) {
  .proto-hero__portrait {
    margin-inline: 0;
    max-width: 21rem;
    justify-self: start;
  }
}

.proto-hero__portrait img {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 12%;
}

.proto-hero__caption {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  text-align: center;
  line-height: 1.45;
}

.proto-hero__caption-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.proto-hero__caption-role {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
}

.proto-hero__label {
  display: inline-block;
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  letter-spacing: var(--letter-spacing-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.proto-hero__title {
  margin-bottom: var(--space-4);
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: var(--font-weight-heading);
  letter-spacing: var(--letter-spacing-heading);
  line-height: 1.1;
  color: var(--color-text-primary);
}

.proto-hero__tagline {
  margin-bottom: var(--space-6);
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: var(--font-weight-heading);
  color: var(--color-accent);
  letter-spacing: 0.04em;
}

.proto-hero__lead {
  max-width: 38rem;
  margin-inline: auto;
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

@media (min-width: 768px) {
  .proto-hero__lead {
    margin-inline: 0;
  }
}

.proto-worlds {
  padding-block: var(--section-padding-y);
  background: linear-gradient(180deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
}

.proto-worlds__header {
  max-width: 36rem;
  margin-inline: auto;
  margin-bottom: var(--space-12);
  padding-inline: var(--section-padding-x);
  text-align: center;
}

.proto-worlds__title {
  margin-bottom: var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  color: var(--color-text-primary);
}

.proto-worlds__intro {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

.proto-worlds__grid {
  display: grid;
  gap: var(--space-8);
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--section-padding-x);
}

@media (min-width: 900px) {
  .proto-worlds__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }
}

.proto-portal {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: var(--space-8) var(--space-6) var(--space-6);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--portal-border, var(--color-border));
  background: var(--portal-bg, var(--color-bg-elevated));
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  overflow: hidden;
}

.proto-portal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4.5rem;
  height: 3px;
  border-radius: 0 0 var(--radius-full) var(--radius-full);
  background: var(--portal-accent, var(--color-accent));
  opacity: 0.85;
}

.proto-portal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--portal-glow, transparent);
  pointer-events: none;
  opacity: 0.6;
}

.proto-portal:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--portal-border-hover, var(--color-border-strong));
}

.proto-portal__frame {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.proto-portal__visual {
  position: relative;
  aspect-ratio: 4 / 3;
  margin-bottom: var(--space-6);
  border-radius: var(--radius-xl);
  border: 1px dashed var(--portal-visual-border, var(--color-border-strong));
  background: var(--portal-visual-bg, var(--color-bg-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.proto-portal__visual-inner {
  position: relative;
  width: 55%;
  height: 62%;
  border: 2px solid var(--portal-accent, var(--color-accent));
  border-radius: 999px 999px 8px 8px;
  opacity: 0.35;
}

.proto-portal__visual-inner::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 2px;
  background: var(--portal-accent, var(--color-accent));
  opacity: 0.5;
}

.proto-portal__visual-note {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  right: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.4;
}

.proto-portal__title {
  margin-bottom: var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
}

.proto-portal__text {
  flex: 1;
  margin-bottom: var(--space-6);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

.proto-portal__action {
  margin-top: auto;
}

.proto-portal--yazykoteka {
  --portal-accent: #3b5f7f;
  --portal-border: rgba(59, 95, 127, 0.2);
  --portal-border-hover: rgba(59, 95, 127, 0.4);
  --portal-bg: linear-gradient(165deg, #fafcfe 0%, #eef4f8 100%);
  --portal-glow: radial-gradient(circle at 80% 10%, rgba(59, 95, 127, 0.08), transparent 50%);
  --portal-visual-bg: rgba(240, 244, 248, 0.8);
  --portal-visual-border: rgba(59, 95, 127, 0.25);
}

.proto-portal--music {
  --portal-accent: #9a7b4f;
  --portal-border: rgba(154, 123, 79, 0.22);
  --portal-border-hover: rgba(154, 123, 79, 0.42);
  --portal-bg: linear-gradient(165deg, #faf8f5 0%, #f3ece3 100%);
  --portal-glow: radial-gradient(circle at 20% 90%, rgba(201, 169, 98, 0.12), transparent 55%);
  --portal-visual-bg: rgba(243, 236, 227, 0.9);
  --portal-visual-border: rgba(154, 123, 79, 0.3);
}

.proto-portal--stories {
  --portal-accent: #5c4d6a;
  --portal-border: rgba(92, 77, 106, 0.2);
  --portal-border-hover: rgba(92, 77, 106, 0.38);
  --portal-bg: linear-gradient(165deg, #faf9f7 0%, #edeae4 100%);
  --portal-glow: radial-gradient(circle at 70% 20%, rgba(92, 77, 106, 0.07), transparent 50%);
  --portal-visual-bg: rgba(237, 234, 228, 0.85);
  --portal-visual-border: rgba(92, 77, 106, 0.28);
}

.proto-portal--yazykoteka .proto-portal__action .lr-btn {
  background-color: #3b5f7f;
  color: #fff;
}

.proto-portal--music .proto-portal__action .lr-btn {
  background-color: #7a6240;
  color: #fff;
}

.proto-portal--music .proto-portal__action .lr-btn:hover {
  background-color: #5c4a2f;
}

.proto-portal--stories .proto-portal__action .lr-btn {
  background-color: #5c4d6a;
  color: #fff;
}

.proto-portal--stories .proto-portal__action .lr-btn:hover {
  background-color: #453a50;
}
