/* ============================================================
   Operace Krkonoše — design tokens & base
   ============================================================ */
:root {
  --forest: #1b3b22;
  --forest-deep: #0f2416;
  --forest-mid: #2a5233;
  --cream: #fdfbf7;
  --cream-muted: #ebe6dc;
  --gold: #d4a24a;
  --gold-bright: #e8b85c;
  --ember: #c45c26;
  --mist: rgba(253, 251, 247, 0.08);
  --ink: #142018;
  --danger-ghost: rgba(253, 251, 247, 0.55);

  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, sans-serif;

  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-soft: 0 18px 50px rgba(15, 36, 22, 0.28);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body[data-stage="0"] {
  overflow: hidden;
  height: 100svh;
}

img {
  max-width: 100%;
  display: block;
}

button,
a {
  font-family: inherit;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.55rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
    border-color 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn--primary {
  background: var(--gold);
  color: var(--forest-deep);
  box-shadow: 0 8px 28px rgba(212, 162, 74, 0.35);
}

.btn--primary:hover {
  background: var(--gold-bright);
  transform: translateY(-2px);
}

.btn--accent {
  background: var(--ember);
  color: var(--cream);
  box-shadow: 0 10px 30px rgba(196, 92, 38, 0.35);
}

.btn--accent:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  color: var(--cream);
  border-color: rgba(253, 251, 247, 0.35);
}

.btn--ghost:hover {
  border-color: var(--cream);
  background: rgba(253, 251, 247, 0.08);
}

.btn--lg {
  padding: 1.1rem 1.9rem;
  font-size: 1.05rem;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  max-width: min(92vw, 420px);
  padding: 1rem 1.25rem;
  background: var(--forest-deep);
  color: var(--cream);
  border: 1px solid rgba(212, 162, 74, 0.45);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  font-size: 0.95rem;
  opacity: 0;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease);
  pointer-events: none;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 4.5rem 1.25rem 5rem;
  color: var(--cream);
  overflow: hidden;
  isolation: isolate;
}

.hero__sky {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, #3a6b45 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 30%, rgba(212, 162, 74, 0.18) 0%, transparent 50%),
    linear-gradient(180deg, #152a1a 0%, var(--forest) 45%, var(--forest-deep) 100%);
  animation: skyPulse 12s ease-in-out infinite alternate;
}

@keyframes skyPulse {
  from { filter: saturate(1) brightness(1); }
  to { filter: saturate(1.08) brightness(1.04); }
}

.hero__mountains {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  z-index: -2;
  pointer-events: none;
}

.hero__ridge {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

.hero__ridge path {
  fill: currentColor;
}

.hero__ridge--far {
  color: #16321c;
  height: 100%;
  animation: ridgeDrift 28s ease-in-out infinite alternate;
}

.hero__ridge--mid {
  color: #1f4228;
  height: 85%;
  opacity: 0.95;
  animation: ridgeDrift 22s ease-in-out infinite alternate-reverse;
}

.hero__ridge--near {
  color: #0c1c11;
  height: 55%;
}

@keyframes ridgeDrift {
  from { transform: translateX(-1.5%); }
  to { transform: translateX(1.5%); }
}

.hero__mist {
  position: absolute;
  inset: auto 0 0;
  height: 35%;
  z-index: -1;
  background: linear-gradient(180deg, transparent, rgba(15, 36, 22, 0.75));
  pointer-events: none;
}

.hero__content {
  position: relative;
  width: min(100%, 720px);
  text-align: center;
  animation: heroIn 1s var(--ease) both;
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(212, 162, 74, 0.25);
}

.hero__hello {
  margin: 0 0 0.85rem;
  font-family: var(--font-body);
  font-size: clamp(1.15rem, 2.8vw, 1.35rem);
  font-weight: 500;
  font-style: italic;
  color: rgba(253, 251, 247, 0.88);
  letter-spacing: 0.01em;
}

.hero__title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.6vw, 2.45rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero__sub {
  margin: 0 auto 2rem;
  max-width: 34rem;
  font-size: clamp(1rem, 2.4vw, 1.12rem);
  color: rgba(253, 251, 247, 0.82);
}

/* Countdown */
.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 auto 2.25rem;
  flex-wrap: wrap;
}

.countdown__unit {
  min-width: 4.4rem;
  padding: 0.85rem 0.65rem 0.7rem;
  background: rgba(15, 36, 22, 0.55);
  border: 1px solid rgba(253, 251, 247, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.countdown__value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(253, 251, 247, 0.55);
}

.countdown__sep {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  padding-bottom: 1rem;
}

.hero__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  min-height: 3.4rem;
  overflow: visible;
}

.runaway {
  position: relative;
  z-index: 5;
  transition: transform 0.2s var(--ease);
  touch-action: none;
  user-select: none;
  will-change: transform;
}

.runaway.is-fleeing {
  z-index: 20;
}

.runaway.is-caught {
  opacity: 0.85;
  cursor: default;
  border-color: var(--gold);
  color: var(--gold);
}

.runaway:disabled {
  cursor: default;
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 5rem 1.25rem;
}

.section__inner {
  width: min(100%, 960px);
  margin: 0 auto;
}

.section__eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
}

.section__title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--forest);
}

.section__lead {
  margin: 0 0 2.5rem;
  max-width: 36rem;
  color: rgba(20, 32, 24, 0.72);
  font-size: 1.05rem;
}

.reveal-section {
  background:
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(212, 162, 74, 0.12), transparent 55%),
    var(--cream);
}

.contract-section {
  background:
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(27, 59, 34, 0.08), transparent 50%),
    var(--cream);
}

/* ============================================================
   Perk pack (interactive bonuses)
   ============================================================ */
.perk-progress {
  margin: 0 0 1.35rem;
}

.perk-progress__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(27, 59, 34, 0.1);
  overflow: hidden;
}

.perk-progress__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest), var(--gold));
  transition: width 0.45s var(--ease);
}

.perk-progress__label {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--forest);
}

.perk-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.perk {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: start;
  width: 100%;
  padding: 1rem 1.05rem;
  border: 2px solid var(--cream-muted);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease),
    background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.perk:hover {
  border-color: rgba(27, 59, 34, 0.35);
  transform: translateY(-2px);
}

.perk:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.perk.is-on {
  border-color: var(--forest);
  background: #f3f7f3;
  box-shadow: 0 10px 28px rgba(27, 59, 34, 0.1);
  animation: perkPop 0.4s var(--ease);
}

@keyframes perkPop {
  0% { transform: scale(0.98); }
  55% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

.perk__icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  background: var(--forest);
  font-size: 1.25rem;
}

.perk__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.perk__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--forest);
}

.perk__desc {
  font-size: 0.92rem;
  color: rgba(20, 32, 24, 0.68);
  line-height: 1.4;
}

.perk__reaction {
  margin-top: 0.45rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(212, 162, 74, 0.18);
  color: var(--forest);
  font-size: 0.86rem;
  font-weight: 650;
  animation: badgePop 0.35s var(--ease);
}

.perk__reaction[hidden] {
  display: none;
}

.perk__status {
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 0.35rem;
  border: 2px solid rgba(27, 59, 34, 0.28);
  border-radius: 50%;
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
}

.perk.is-on .perk__status {
  background: var(--forest);
  border-color: var(--forest);
  transform: scale(1.05);
}

.perk.is-on .perk__status::after {
  content: "";
  display: block;
  width: 0.35rem;
  height: 0.65rem;
  margin: 0.12rem auto 0;
  border: solid var(--gold);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.perk-complete {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, var(--forest), var(--forest-mid));
  color: var(--cream);
  border-radius: 10px;
  font-weight: 700;
  animation: badgePop 0.45s var(--ease);
}

.perk-complete[hidden] {
  display: none;
}

.reveal-cta {
  text-align: center;
  margin-bottom: 2rem;
}

.reveal-cta .btn.is-ready {
  animation: ctaPulse 1.4s ease-in-out infinite;
}

@keyframes ctaPulse {
  0%, 100% { transform: translateY(0); box-shadow: 0 10px 30px rgba(196, 92, 38, 0.35); }
  50% { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(196, 92, 38, 0.5); }
}

/* Hotel reveal */
.hotel {
  overflow: hidden;
}

.hotel[hidden] {
  display: none;
}

.hotel.is-shown {
  animation: hotelReveal 0.9s var(--ease) both;
}

@keyframes hotelReveal {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    max-height: 1200px;
    transform: translateY(0);
  }
}

.hotel__card {
  padding: 1.75rem 1.35rem 1.5rem;
  background: var(--forest);
  color: var(--cream);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-soft);
}

.hotel__badge {
  margin: 0 0 0.75rem;
  display: inline-block;
  padding: 0.3rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--forest-deep);
  background: var(--gold);
  border-radius: 999px;
}

.hotel__name {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
}

.hotel__place {
  margin: 0 0 1.35rem;
  opacity: 0.75;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery__item {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--forest-deep);
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.gallery__item:hover img {
  transform: scale(1.05);
}

.hotel__next {
  margin-top: 1.5rem;
  text-align: center;
}

.hotel__next .btn--primary {
  background: var(--gold);
  color: var(--forest-deep);
}

@keyframes badgePop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ============================================================
   Contract + signature
   ============================================================ */
.contract {
  position: relative;
  padding: 1.75rem 1.35rem 1.5rem;
  background: #fff;
  border: 1px solid var(--cream-muted);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(27, 59, 34, 0.08);
  overflow: hidden;
}

.contract__terms {
  margin: 0 0 1.75rem;
  padding-left: 1.25rem;
  color: var(--ink);
}

.contract__terms li {
  margin-bottom: 0.85rem;
  padding-left: 0.35rem;
}

.contract__terms li::marker {
  color: var(--ember);
  font-weight: 700;
}

.contract__stamp {
  position: absolute;
  top: 1.25rem;
  right: 1rem;
  width: 7.5rem;
  height: 7.5rem;
  display: grid;
  place-content: center;
  gap: 0.15rem;
  border: 4px solid var(--ember);
  border-radius: 50%;
  color: var(--ember);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-18deg) scale(0.4);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.contract__stamp span {
  display: block;
  line-height: 1.15;
}

.contract.is-signed .contract__stamp {
  animation: stampIn 0.55s var(--ease) forwards;
}

.contract__stamp[hidden] {
  display: none;
}

.contract.is-signed .contract__stamp[hidden] {
  display: grid;
}

@keyframes stampIn {
  0% {
    opacity: 0;
    transform: rotate(-18deg) scale(1.4);
  }
  60% {
    opacity: 1;
    transform: rotate(-18deg) scale(0.95);
  }
  100% {
    opacity: 0.92;
    transform: rotate(-18deg) scale(1);
  }
}

.signature__label {
  margin: 0 0 0.65rem;
  font-weight: 700;
  color: var(--forest);
}

.signature__pad-wrap {
  position: relative;
  margin-bottom: 1.1rem;
}

#signature-pad {
  display: block;
  width: 100%;
  height: 180px;
  background:
    repeating-linear-gradient(
      transparent,
      transparent 27px,
      rgba(27, 59, 34, 0.06) 28px
    ),
    #faf8f3;
  border: 2px dashed rgba(27, 59, 34, 0.28);
  border-radius: 12px;
  touch-action: none;
  cursor: crosshair;
}

.signature__clear {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  padding: 0.35rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: rgba(27, 59, 34, 0.08);
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.signature__clear:hover {
  background: rgba(27, 59, 34, 0.14);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  padding: 2rem 1.25rem 2.5rem;
  text-align: center;
  background: var(--forest-deep);
  color: rgba(253, 251, 247, 0.55);
  font-size: 0.88rem;
}

.footer p {
  margin: 0;
}

/* ============================================================
   Finale overlay
   ============================================================ */
.finale {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, #2a5233 0%, transparent 60%),
    var(--forest-deep);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease);
}

.finale[hidden] {
  display: none;
}

.finale.is-open {
  display: grid;
  opacity: 1;
  pointer-events: auto;
}

.finale__text {
  margin: 0;
  max-width: 16ch;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9vw, 5rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-align: center;
  color: var(--cream);
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  animation: finaleIn 0.7s var(--ease) both;
}

@keyframes finaleIn {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(18px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
