/* =====================================================================
   stage2-premium.css — Etap 2 + FIX hero clip (nr3, 2026-07-28)
   ===================================================================== */

:root {
  --social-rail-width: 76px;
  --hero-safe-inline: max(20px, env(safe-area-inset-left, 0px));
  /* RESEARCH-APPLY: restrained gold / steel palette */
  --gold-accent: #c9a45c;
  --gold-soft: rgba(201, 164, 92, 0.12);
  --gold-glow: rgba(201, 164, 92, 0.35);
  --steel-accent: #a8b8c8;
  --steel-soft: rgba(140, 170, 200, 0.1);
  --steel-glow: rgba(120, 160, 200, 0.35);
  --space-section: clamp(4rem, 8vw, 7rem);
  --space-block: clamp(1.25rem, 3vw, 2rem);
  --ease-cinematic: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- FIX-HERO: dock / overflow / clip regression --- */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

.hero {
  overflow: visible;
}

.hero__bg,
.hero__stars,
.hero__fog,
.hero__embers,
.hero__dust {
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .hero--cinematic .hero__visual,
  .hero--cinematic .hero__copy {
    transform: none;
  }
}

.hero .container,
.hero > .container,
.hero .container.hero__grid {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding-inline: max(20px, env(safe-area-inset-right, 0px));
  padding-left: max(var(--hero-safe-inline), 20px);
}

@media (min-width: 781px) {
  main#main {
    padding-left: var(--social-rail-width);
  }

  .hero .container,
  .hero > .container,
  .hero .container.hero__grid {
    padding-left: max(28px, calc(var(--social-rail-width) + 12px));
  }
}

@media (max-width: 768px) {
  .social-rail {
    display: none !important;
  }

  main#main {
    padding-left: 0;
  }

  .hero .container,
  .hero > .container,
  .hero .container.hero__grid {
    padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  }

  .hero__grid {
    grid-template-columns: 1fr !important;
    gap: clamp(20px, 5vw, 32px) !important;
  }

  .hero__visual {
    order: -1;
    margin-bottom: 0.5rem;
  }

  .hero__visual .hero__logo-wrap,
  .hero__logo-wrap {
    max-width: min(260px, 72vw) !important;
    margin-inline: auto !important;
  }

  .hero__game-logo {
    max-width: min(280px, 78vw);
    margin-inline: auto;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(1.65rem, 6.8vw, 2.35rem);
    line-height: 1.14;
  }

  .hero__copy {
    text-align: center;
    width: 100%;
    min-width: 0;
  }

  .hero__copy .eyebrow {
    display: block;
    letter-spacing: 0.18em;
    font-size: clamp(0.68rem, 2.8vw, 0.8rem);
  }

  .hero--cinematic,
  .hero--game,
  .hero--gamepage,
  .hero {
    text-align: center;
  }

  .hero--cinematic .btn-row,
  .hero--game .btn-row,
  .hero .btn-row {
    justify-content: center;
  }

  .hero__studio-row {
    justify-content: center;
  }
}

.hero .lead {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
  max-width: 42rem;
}

.hero__copy {
  min-width: 0;
  overflow: visible;
}

.hero h1 {
  overflow-wrap: break-word;
  word-break: normal;
}

/* --- HERO-PREMIUM: viewport, depth, typography --- */
.hero,
.hero--cinematic,
.hero--game,
.hero--gamepage {
  min-height: min(100vh, 920px);
  min-height: min(100svh, 920px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  padding-top: clamp(5rem, 10vw, 7.5rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
}

@media (max-width: 768px) {
  .hero,
  .hero--cinematic,
  .hero--game {
    min-height: 90vh;
    min-height: 90svh;
    padding-top: clamp(4.5rem, 12vw, 5.5rem);
    padding-bottom: clamp(2.5rem, 8vw, 4rem);
  }
}

.hero__bg {
  transform: translateZ(0);
}

.hero--cinematic .hero__bg::after,
.hero--game .hero__bg::after,
.hero--gamepage .hero__bg::after,
.hero .hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 55% at 50% 38%, rgba(201, 164, 92, 0.1), transparent 68%),
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(0, 0, 0, 0.55), transparent 55%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, transparent 38%, rgba(0, 0, 0, 0.48) 100%);
}

.site-studio .hero--cinematic .hero__bg::after,
.site-studio .hero .hero__bg::after {
  background:
    radial-gradient(ellipse 85% 55% at 50% 38%, rgba(140, 170, 200, 0.12), transparent 68%),
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(0, 0, 0, 0.55), transparent 55%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, transparent 38%, rgba(0, 0, 0, 0.48) 100%);
}

.hero h1 {
  font-size: clamp(1.85rem, 4.8vw, 3.35rem);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

.hero .lead {
  font-size: clamp(1.05rem, 2.2vw, 1.22rem);
  line-height: 1.6;
  color: var(--text);
}

.hero .reveal {
  transition-duration: 0.75s;
  transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (max-width: 768px) {
  .hero .lead {
    font-size: clamp(1rem, 4.1vw, 1.12rem);
    line-height: 1.55;
    margin-inline: auto;
  }

  .hero .btn-row {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 22rem;
    margin-inline: auto;
  }

  .hero .btn-row .btn {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    text-align: center;
  }

  .hero__meta {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
  }
}

/* --- REVEAL: stagger fadeInUp --- */
.reveal {
  transition: opacity 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transition-delay: var(--stagger, 0ms);
  transform: translateY(28px);
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* --- KARTY: glass + lift desktop --- */
.card,
.contact-card {
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    border-color 0.3s ease;
}

@media (hover: hover) {
  .card:hover,
  .contact-card:hover {
    transform: translateY(-8px);
    border-color: rgba(201, 164, 92, 0.35);
    box-shadow:
      0 18px 40px -18px rgba(0, 0, 0, 0.65),
      0 0 28px -6px rgba(201, 164, 92, 0.35);
  }

  .site-studio .card:hover,
  .site-studio .contact-card:hover {
    border-color: rgba(140, 170, 200, 0.4);
    box-shadow:
      0 18px 40px -18px rgba(0, 0, 0, 0.65),
      0 0 28px -6px rgba(120, 160, 200, 0.35);
  }
}

/* --- NAV: blur scroll, underline, burger morph --- */
.nav {
  transition: background 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    border-color 0.35s ease,
    backdrop-filter 0.35s ease;
}

.nav.scrolled {
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.nav__links a {
  position: relative;
}

.nav__links a:not(.active)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0.7;
}

.nav__links a:not(.active):hover::after {
  transform: scaleX(1);
}

.nav.open .nav__burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav.open .nav__burger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav.open .nav__burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__burger span {
  transition: transform 0.28s ease, opacity 0.2s ease;
}

@media (max-width: 768px) {
  .nav__cta--desktop {
    display: none !important;
  }

  .nav.open .nav__links .nav__cta-mobile {
    display: flex;
  }
}

/* --- DETALE: gallery zoom, back-to-top, footer social --- */
.to-top {
  border: 1px solid rgba(201, 164, 92, 0.35);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.7);
}

.to-top:hover {
  box-shadow: 0 0 20px -2px rgba(201, 164, 92, 0.45);
}

.frame__poster img,
.post__thumb img {
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (hover: hover) {
  .frame:hover .frame__poster img,
  .post:hover .post__thumb img {
    transform: scale(1.05);
  }
}

.footer a.social-link:hover,
.footer .social-tile:hover {
  filter: drop-shadow(0 0 8px rgba(201, 164, 92, 0.45));
}

.site-studio .footer a.social-link:hover,
.site-studio .footer .social-tile:hover {
  filter: drop-shadow(0 0 8px rgba(120, 160, 200, 0.45));
}

/* Touch: no sticky hover lift */
@media (hover: none) {
  .card:hover,
  .contact-card:hover {
    transform: none;
    box-shadow: none;
  }

  .frame:hover .frame__poster img,
  .post:hover .post__thumb img {
    transform: none;
  }
}

.container {
  max-width: 100%;
  box-sizing: border-box;
}

/* --- MOBILE-QA: 320–768 no clip / no overflow-x --- */
@media (max-width: 480px) {
  .hero h1 {
    font-size: clamp(1.5rem, 7.5vw, 2rem);
  }

  .hero__meta {
    font-size: 0.82rem;
  }

  .hero__meta b {
    font-size: 1.15rem;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .card:hover,
  .contact-card:hover {
    transform: none;
  }

  .frame:hover .frame__poster img,
  .post:hover .post__thumb img {
    transform: none;
  }

  .nav__links a:not(.active)::after {
    transition: none;
  }

  .nav.open .nav__burger span {
    transform: none !important;
    opacity: 1 !important;
  }
}

/* --- RESEARCH-APPLY: typography rhythm + cinematic spacing --- */
.section {
  padding-block: var(--space-section);
}

.section--tight {
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

.eyebrow {
  letter-spacing: 0.2em;
  font-size: clamp(0.68rem, 1.6vw, 0.78rem);
}

.hero .eyebrow {
  color: var(--steel-accent);
}

.site-game .hero .eyebrow {
  color: var(--gold-accent);
}

h1, h2, h3 {
  text-wrap: balance;
}

/* --- WIZUALIA: glass depth, glow, frame polish --- */
.frame--cinematic,
.frame {
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    0 24px 64px -28px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.frame__glow {
  background: radial-gradient(ellipse 70% 50% at 50% 80%, var(--steel-soft), transparent 70%);
}

.btn--primary {
  box-shadow: 0 4px 20px -6px var(--steel-glow);
}

@media (prefers-reduced-motion: no-preference) and (min-width: 769px) {
  .hero__visual {
    will-change: transform;
  }

  .hero__logo-wrap {
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.45));
  }
}

/* --- A11Y: focus visible + skip-link polish --- */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--steel-accent);
  outline-offset: 3px;
}

.skip-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* --- MOBILE: touch targets ≥48px --- */
@media (max-width: 768px) {
  .btn,
  .btn--lg,
  .btn--primary,
  .btn--ghost,
  .nav__burger,
  .lang__btn,
  .to-top,
  .social-rail .social-link {
    min-height: 48px;
    min-width: 48px;
  }

  .btn-row .btn {
    padding-block: 14px;
  }

  .nav__links a {
    min-height: 48px;
    display: flex;
    align-items: center;
  }
}
