/**
 * Home — «Три портала студии»
 * Production: index.html · Prototype: _prototype/home-three-portals.html
 */

:root {
  --hp-ivory: #faf8f5;
  --hp-paper: #f6f1e8;
  --hp-ink: #2a3344;
  --hp-muted: #5a6c7d;

  /* Языкотека */
  --hp-lang-navy: #2c4a66;
  --hp-lang-gold: #c4a574;
  --hp-lang-bg: linear-gradient(165deg, #fdfbf7 0%, #eef3f7 55%, #e8eef4 100%);
  --hp-lang-border: rgba(44, 74, 102, 0.18);

  /* Музыка */
  --hp-music-gold: #b8956a;
  --hp-music-ink: #1e3550;
  --hp-music-warm: #f3ebe0;
  --hp-music-bg: linear-gradient(165deg, #faf6ef 0%, #f5ebe0 50%, #ebe4d8 100%);
  --hp-music-border: rgba(154, 123, 85, 0.22);

  /* Истории */
  --hp-story-ivory: #f7f4ef;
  --hp-story-bronze: #9a7b55;
  --hp-story-plum: #5c4d6a;
  --hp-story-bg: linear-gradient(165deg, #faf9f6 0%, #f0ebe4 55%, #e8e4ec 100%);
  --hp-story-border: rgba(92, 77, 106, 0.18);
}

.proto-banner--hp {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  text-align: center;
  color: #fff;
  background: #2c4a66;
  border-bottom: 1px solid rgba(196, 165, 116, 0.35);
}

.proto-banner--hp code {
  background: rgba(255, 255, 255, 0.12);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ——— Section ——— */

.hp-portals {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  background: linear-gradient(180deg, var(--hp-ivory) 0%, #eef3f7 100%);
}

.hp-portals__inner {
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--section-padding-x);
}

.hp-portals__header {
  max-width: 38rem;
  margin-inline: auto;
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-16));
  text-align: center;
}

.hp-portals__title {
  margin: 0 0 var(--space-5);
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: var(--letter-spacing-heading);
  color: var(--hp-ink);
}

.hp-portals__intro {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--hp-muted);
}

.hp-portals__intro em {
  font-style: normal;
  color: var(--hp-ink);
}

.hp-portals__grid {
  display: grid;
  gap: clamp(var(--space-6), 3vw, var(--space-10));
  align-items: stretch;
}

@media (min-width: 900px) {
  .hp-portals__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ——— Portal card ——— */

.hp-portal {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--hp-portal-border);
  background: var(--hp-portal-bg);
  box-shadow: 0 4px 24px rgba(42, 51, 68, 0.06);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.hp-portal:hover,
.hp-portal:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(42, 51, 68, 0.1);
  border-color: var(--hp-portal-border-hover);
}

.hp-portal--yazykoteka {
  --hp-portal-bg: var(--hp-lang-bg);
  --hp-portal-border: var(--hp-lang-border);
  --hp-portal-border-hover: rgba(44, 74, 102, 0.32);
  --hp-portal-accent: var(--hp-lang-navy);
  --hp-portal-btn: #2c4a66;
  --hp-portal-btn-hover: #1e3550;
}

.hp-portal--music {
  --hp-portal-bg: var(--hp-music-bg);
  --hp-portal-border: var(--hp-music-border);
  --hp-portal-border-hover: rgba(154, 123, 85, 0.38);
  --hp-portal-accent: var(--hp-music-gold);
  --hp-portal-btn: #7a6240;
  --hp-portal-btn-hover: #5c4a2f;
}

.hp-portal--stories {
  --hp-portal-bg: var(--hp-story-bg);
  --hp-portal-border: var(--hp-story-border);
  --hp-portal-border-hover: rgba(92, 77, 106, 0.32);
  --hp-portal-accent: var(--hp-story-bronze);
  --hp-portal-btn: #5c4d6a;
  --hp-portal-btn-hover: #453a50;
}

/* Arch / visual zone (~48% card height) */

.hp-portal__arch {
  flex: 0 0 auto;
  padding: var(--space-6) var(--space-6) 0;
}

.hp-portal__arch-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 4;
  max-height: 14.5rem;
  margin-inline: auto;
  border: 1.5px solid var(--hp-portal-accent);
  border-bottom: none;
  border-radius: 50% 50% var(--radius-lg) var(--radius-lg) / 42% 42% var(--radius-lg) var(--radius-lg);
  background: rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -8px 24px rgba(42, 51, 68, 0.04);
  overflow: hidden;
}

/* Future: replace .hp-portal__art with <img class="hp-portal__illustration"> */
.hp-portal__illustration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  pointer-events: none;
}

.hp-portal__art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ——— Языкотека art ——— */

.hp-portal__art--language {
  background:
    radial-gradient(ellipse 70% 55% at 50% 85%, rgba(196, 165, 116, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(238, 243, 247, 0.5) 0%, rgba(250, 246, 239, 0.2) 100%);
}

.hp-portal__art--language::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12%;
  width: 58%;
  height: 38%;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, #f7f2ea 0%, #f7f2ea 48%, #e8e2d8 48%, #f0ebe3 100%);
  border: 1px solid rgba(44, 74, 102, 0.2);
  border-radius: 2px 6px 6px 2px;
  box-shadow: 0 4px 16px rgba(44, 74, 102, 0.08);
}

.hp-portal__art--language::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 42%;
  height: 52%;
  transform: translateX(-50%);
  border: 1.5px solid rgba(196, 165, 116, 0.45);
  border-bottom: none;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  opacity: 0.7;
}

.hp-portal__lang-glow {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 30%;
  height: 20%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(255, 252, 245, 0.9), transparent 70%);
}

.hp-portal__lang-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 165, 116, 0.5), transparent);
  opacity: 0.6;
}

.hp-portal__lang-line--1 { top: 22%; left: 15%; width: 35%; transform: rotate(-8deg); }
.hp-portal__lang-line--2 { top: 32%; right: 12%; width: 30%; transform: rotate(6deg); }
.hp-portal__lang-line--3 { top: 42%; left: 20%; width: 28%; }

.hp-portal__lang-letter {
  position: absolute;
  font-family: var(--font-heading);
  color: var(--hp-lang-navy);
  opacity: 0.07;
  line-height: 1;
  user-select: none;
}

.hp-portal__lang-letter--a { top: 14%; right: 18%; font-size: 2.5rem; }
.hp-portal__lang-letter--b { top: 28%; left: 14%; font-size: 1.75rem; opacity: 0.05; }

/* ——— Музыка art ——— */

.hp-portal__art--music {
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(184, 149, 106, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(30, 53, 80, 0.04) 0%, rgba(243, 235, 224, 0.3) 100%);
}

.hp-portal__art--music::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--hp-music-gold), transparent);
  opacity: 0.5;
}

.hp-portal__music-wave {
  position: absolute;
  left: 0;
  right: 0;
  height: 40%;
  bottom: 18%;
  opacity: 0.35;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 30 Q25 10 50 30 T100 30 T150 30 T200 30' fill='none' stroke='%231e3550' stroke-width='1.5'/%3E%3Cpath d='M0 38 Q30 22 60 38 T120 38 T180 38' fill='none' stroke='%23b8956a' stroke-width='1' opacity='0.7'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.hp-portal__music-mic {
  position: absolute;
  left: 50%;
  bottom: 28%;
  width: 1.25rem;
  height: 2.75rem;
  transform: translateX(-50%);
  border: 1.5px solid var(--hp-music-ink);
  border-radius: 999px 999px 4px 4px;
  opacity: 0.35;
}

.hp-portal__music-mic::after {
  content: "";
  position: absolute;
  bottom: -0.65rem;
  left: 50%;
  width: 2px;
  height: 0.65rem;
  transform: translateX(-50%);
  background: var(--hp-music-ink);
  opacity: 0.4;
}

.hp-portal__music-vinyl {
  position: absolute;
  right: 18%;
  bottom: 20%;
  width: 2.5rem;
  height: 2.5rem;
  border: 1.5px solid rgba(30, 53, 80, 0.25);
  border-radius: 50%;
  opacity: 0.4;
}

.hp-portal__music-vinyl::after {
  content: "";
  position: absolute;
  inset: 35%;
  border-radius: 50%;
  background: rgba(184, 149, 106, 0.35);
}

.hp-portal__music-note {
  position: absolute;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--hp-music-gold);
  opacity: 0.45;
}

.hp-portal__music-note--1 { top: 24%; left: 22%; }
.hp-portal__music-note--2 { top: 18%; right: 28%; opacity: 0.3; }
.hp-portal__music-note--3 { top: 36%; right: 20%; width: 0.35rem; height: 0.35rem; }

/* ——— Истории art ——— */

.hp-portal__art--stories {
  background:
    radial-gradient(ellipse 65% 50% at 75% 25%, rgba(92, 77, 106, 0.1), transparent 55%),
    linear-gradient(180deg, rgba(247, 244, 239, 0.6) 0%, rgba(232, 228, 236, 0.25) 100%);
}

.hp-portal__art--stories::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: 52%;
  height: 42%;
  transform: translateX(-50%);
  background: #faf7f2;
  border: 1px solid rgba(154, 123, 85, 0.25);
  border-radius: 2px;
  box-shadow: 0 3px 12px rgba(42, 51, 68, 0.06);
}

.hp-portal__story-lines {
  position: absolute;
  left: 50%;
  bottom: 22%;
  width: 38%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hp-portal__story-lines span {
  display: block;
  height: 1px;
  background: rgba(42, 51, 68, 0.12);
}

.hp-portal__story-lines span:nth-child(3) { width: 70%; }
.hp-portal__story-lines span:nth-child(4) { width: 85%; }

.hp-portal__story-film {
  position: absolute;
  top: 20%;
  left: 50%;
  width: 55%;
  height: 1.25rem;
  transform: translateX(-50%);
  border-top: 1.5px solid rgba(154, 123, 85, 0.35);
  border-bottom: 1.5px solid rgba(154, 123, 85, 0.35);
  opacity: 0.5;
}

.hp-portal__story-film::before,
.hp-portal__story-film::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 1px;
  background: rgba(154, 123, 85, 0.3);
}

.hp-portal__story-film::before { left: 8%; box-shadow: 1.2rem 0 0 rgba(154, 123, 85, 0.25), 2.4rem 0 0 rgba(154, 123, 85, 0.25); }
.hp-portal__story-film::after { right: 8%; }

.hp-portal__story-window {
  position: absolute;
  top: 22%;
  right: 16%;
  width: 1.75rem;
  height: 2.25rem;
  border: 1px solid rgba(92, 77, 106, 0.25);
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, rgba(92, 77, 106, 0.12), rgba(196, 165, 116, 0.08));
  opacity: 0.55;
}

/* ——— Body ——— */

.hp-portal__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: var(--space-6);
  padding-top: var(--space-5);
  text-align: center;
  align-items: center;
}

.hp-portal__title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 2.5vw, 1.625rem);
  line-height: var(--leading-tight);
  color: var(--hp-ink);
}

.hp-portal__text {
  flex: 1 1 auto;
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--hp-muted);
}

.hp-portal__btn {
  align-self: center;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: #fff;
  text-decoration: none;
  background: var(--hp-portal-btn);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 10px rgba(30, 53, 80, 0.12);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hp-portal__btn:hover {
  color: #fff;
  text-decoration: none;
  background: var(--hp-portal-btn-hover);
  box-shadow: 0 4px 14px rgba(30, 53, 80, 0.18);
  transform: translateY(-1px);
}

.hp-portal__btn:focus-visible {
  outline: 2px solid var(--hp-portal-accent);
  outline-offset: 3px;
}

@media (max-width: 899px) {
  .hp-portal__arch-frame {
    max-height: 12.5rem;
  }
}

@media (max-width: 479px) {
  .hp-portal__arch {
    padding-inline: var(--space-5);
  }

  .hp-portal__body {
    padding-inline: var(--space-5);
  }
}
