:root {
  color-scheme: dark;
  --charcoal: #11100f;
  --ink: #191816;
  --oak: #c29b62;
  --sand: #f8f7f5;
  --muted: #c9c4bd;
  --line: rgb(255 255 255 / 0.2);
  --ease-cinematic: cubic-bezier(0.76, 0, 0.24, 1);
  font-family: "Outfit", "Inter", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--charcoal);
}

body {
  color: var(--sand);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--oak);
  outline-offset: -5px;
}

.skip-link {
  position: fixed;
  z-index: 400;
  top: 12px;
  left: 12px;
  translate: 0 -160%;
  padding: 12px 16px;
  background: var(--sand);
  color: var(--charcoal);
  font-weight: 700;
  text-decoration: none;
  transition: translate 160ms ease;
}

.skip-link:focus {
  translate: 0;
}

.intro {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--charcoal);
  pointer-events: none;
}

.intro__atmosphere {
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at 50% 48%, rgb(194 155 98 / 0.2), transparent 22%),
    conic-gradient(from 90deg at 50% 50%, transparent, rgb(194 155 98 / 0.08), transparent 24%);
  opacity: 0;
  transform: scale(0.58) rotate(-16deg);
}

html[data-phase="intro"] .intro__atmosphere {
  animation: atmosphere 1.92s 120ms var(--ease-cinematic) both;
}

.intro__signal {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.intro__signal span {
  position: absolute;
  width: min(80vw, 920px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(194 155 98 / 0.9), transparent);
  transform: scaleX(0);
}

html[data-phase="intro"] .intro__signal span {
  animation: signal 980ms var(--ease-cinematic) both;
}

.intro__signal span:nth-child(2) {
  rotate: 60deg;
}

.intro__signal span:nth-child(3) {
  rotate: -60deg;
}

html[data-phase="intro"] .intro__signal span:nth-child(2) {
  animation-delay: 110ms;
}

html[data-phase="intro"] .intro__signal span:nth-child(3) {
  animation-delay: 210ms;
}

.intro__brand {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: center;
  filter: blur(18px);
  opacity: 0;
  transform: scale(1.18);
}

html[data-phase="intro"] .intro__brand {
  animation: brand-arrival 1.42s 220ms var(--ease-cinematic) both;
}

.intro__word,
.intro__dot {
  font-size: clamp(70px, 13vw, 184px);
  line-height: 0.8;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.intro__dot {
  color: var(--oak);
  transform-origin: center;
}

html[data-phase="intro"] .intro__dot {
  animation: dot-pulse 560ms 900ms ease-out both;
}

.intro__claim {
  grid-column: 1 / -1;
  margin-top: clamp(28px, 5vw, 56px);
  color: var(--muted);
  font-size: clamp(10px, 1.1vw, 14px);
  font-weight: 650;
  letter-spacing: 0.28em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
}

html[data-phase="intro"] .intro__claim {
  animation: claim-arrival 650ms 1080ms ease-out both;
}

.curtain {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  pointer-events: none;
}

.curtain span {
  background: var(--charcoal);
  border-right: 1px solid rgb(255 255 255 / 0.04);
  transform: translateY(100%);
}

html[data-phase="reveal"] .curtain span {
  animation: curtain-rise 720ms var(--ease-cinematic) both;
}

html[data-phase="reveal"] .curtain span:nth-child(2) {
  animation-delay: 80ms;
}

html[data-phase="reveal"] .curtain span:nth-child(3) {
  animation-delay: 160ms;
}

html[data-phase="ready"] .intro,
html.no-js .intro {
  display: none;
}

.gateway-header {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: max(22px, env(safe-area-inset-top)) clamp(20px, 3vw, 48px) 20px;
  opacity: 0;
  transform: translateY(-18px);
  transition: opacity 600ms 120ms ease, transform 700ms 120ms var(--ease-cinematic);
  pointer-events: none;
}

html[data-phase="ready"] .gateway-header,
html.no-js .gateway-header {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.brand {
  color: var(--sand);
  font-size: 25px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand span {
  color: var(--oak);
}

.gateway-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(17 16 15 / 0.44);
  color: var(--sand);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.control:hover,
.control[aria-pressed="true"] {
  border-color: var(--oak);
  background: var(--oak);
  color: var(--charcoal);
}

.control__icon {
  display: inline-block;
  margin-right: 7px;
}

.gateway {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  height: 100dvh;
  min-height: 580px;
  opacity: 0;
  pointer-events: none;
}

html[data-phase="ready"] .gateway,
html.no-js .gateway {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  overflow: hidden;
  padding: clamp(28px, 4.2vw, 72px);
  border-right: 1px solid var(--line);
  background: var(--ink) var(--panel-image) center / cover no-repeat;
  color: var(--sand);
  text-decoration: none;
  clip-path: inset(0 0 100% 0);
  transition: filter 500ms ease;
}

.panel--maph {
  --panel-image: url("maph-materialy.webp");
}

.panel--eshop {
  --panel-image: url("maph-eshop.webp");
}

.panel--interiery {
  --panel-image: url("maph-interiery.webp");
}

html[data-phase="ready"] .panel,
html.no-js .panel {
  animation: panel-reveal 820ms var(--ease-cinematic) both;
}

html[data-phase="ready"] .panel:nth-child(2) {
  animation-delay: 80ms;
}

html[data-phase="ready"] .panel:nth-child(3) {
  animation-delay: 160ms;
}

.panel::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -4%;
  background: inherit;
  transform: scale(1.04);
  transition: transform 900ms var(--ease-cinematic), filter 600ms ease;
}

.panel__veil {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(8 8 8 / 0.34) 0%, rgb(8 8 8 / 0.12) 38%, rgb(8 8 8 / 0.88) 100%),
    linear-gradient(90deg, rgb(8 8 8 / 0.24), transparent 70%);
  transition: background 500ms ease;
}

.panel__number {
  position: absolute;
  top: clamp(100px, 14vh, 160px);
  right: clamp(22px, 3.5vw, 56px);
  color: rgb(255 255 255 / 0.58);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.panel__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 430px;
  transform: translateY(8px);
  transition: transform 500ms var(--ease-cinematic);
}

.panel__eyebrow {
  margin-bottom: 16px;
  color: #e2bd85;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.panel__title {
  font-size: clamp(27px, 3.2vw, 52px);
  line-height: 0.98;
  font-weight: 560;
  letter-spacing: -0.045em;
}

.panel__description {
  max-width: 34ch;
  margin-top: 18px;
  color: rgb(248 247 245 / 0.76);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.55;
}

.panel__action {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgb(255 255 255 / 0.56);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel__action span {
  color: var(--oak);
  font-size: 16px;
  transition: transform 240ms ease;
}

.panel:hover::before,
.panel:focus-visible::before {
  filter: saturate(1.06) contrast(1.04);
  transform: scale(1.1);
}

.panel:hover .panel__content,
.panel:focus-visible .panel__content {
  transform: none;
}

.panel:hover .panel__action span,
.panel:focus-visible .panel__action span {
  transform: translate(3px, -3px);
}

.sound-note {
  position: fixed;
  z-index: 90;
  right: clamp(20px, 3vw, 48px);
  bottom: max(18px, env(safe-area-inset-bottom));
  max-width: 300px;
  margin: 0;
  color: rgb(248 247 245 / 0.58);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-size: 10px;
  line-height: 1.45;
  text-align: right;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 400ms 700ms ease, transform 400ms 700ms ease;
  pointer-events: none;
}

html[data-phase="ready"] .sound-note {
  opacity: 1;
  transform: none;
}

@keyframes atmosphere {
  0% { opacity: 0; transform: scale(0.58) rotate(-16deg); }
  45% { opacity: 1; }
  100% { opacity: 0.45; transform: scale(1.08) rotate(0); }
}

@keyframes signal {
  0% { opacity: 0; transform: scaleX(0); }
  44% { opacity: 1; }
  100% { opacity: 0; transform: scaleX(1); }
}

@keyframes brand-arrival {
  0% { filter: blur(18px); opacity: 0; transform: scale(1.18); }
  62% { filter: blur(0); opacity: 1; }
  100% { filter: blur(0); opacity: 1; transform: scale(1); }
}

@keyframes dot-pulse {
  0% { opacity: 0; transform: scale(5); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes claim-arrival {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes curtain-rise {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes panel-reveal {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}

@media (max-width: 860px) {
  .gateway {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    min-height: 640px;
  }

  .curtain {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }

  .panel {
    align-items: center;
    padding: clamp(22px, 6vw, 44px);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background-position: center 42%;
  }

  .panel__number {
    top: auto;
    right: clamp(20px, 6vw, 44px);
    bottom: clamp(22px, 6vw, 44px);
  }

  .panel__content {
    transform: none;
  }

  .panel__eyebrow {
    margin-bottom: 8px;
    font-size: 9px;
  }

  .panel__title {
    font-size: clamp(25px, 7vw, 39px);
  }

  .panel__description,
  .panel__action,
  .sound-note {
    display: none;
  }

  .gateway-header {
    padding: max(16px, env(safe-area-inset-top)) 18px 14px;
  }

  #replay-control {
    display: none;
  }

  .control {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }

  .intro {
    display: none;
  }

  .gateway,
  .gateway-header,
  .sound-note {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .panel {
    clip-path: inset(0);
  }
}
