/* ==========================================================================
   Dragon Horse — design tokens
   ========================================================================== */
:root {
  --burgund-dark: #430303;
  --burgund: #91454E;
  --malina: #AE747D;
  --roz: #DEBDC2;
  --roz-pudrowy: #F7D8DC;
  --bez-kremowy: #FCE9DF;
  --neutral-jasny: #F8F2F3;
  --neutral-bez: #E8DDD7;

  --font-display: "Gambetta", "Iowan Old Style", Georgia, serif;
  --font-body: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container-w: 1160px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --space-7: 9rem;

  --radius-card: 1.5rem;
  --radius-pill: 999px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.2s;
  --dur-med: 0.5s;
  --dur-slow: 0.9s;
}

/* ==========================================================================
   Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--burgund-dark);
  background: var(--bez-kremowy);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
h1, h2, h3, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

::selection { background: var(--malina); color: var(--bez-kremowy); }

:focus-visible {
  outline: 3px solid var(--burgund);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -60px;
  background: var(--bez-kremowy);
  color: var(--burgund-dark);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  z-index: 1000;
  transition: top var(--dur-fast) var(--ease);
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.container {
  width: min(100% - 2.5rem, var(--container-w));
  margin-inline: auto;
}

/* ==========================================================================
   Typography scale
   ========================================================================== */
h1, .h1 {
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.02;
  font-size: clamp(2.75rem, 6vw + 1rem, 5.25rem);
}
h2, .h2 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  font-size: clamp(2rem, 3.2vw + 1rem, 3rem);
  color: var(--burgund);
}
h3, .h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  font-size: clamp(1.375rem, 1.4vw + 1rem, 1.75rem);
  color: var(--burgund-dark);
}
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--burgund-dark);
  margin-bottom: 0.5rem;
}
p { font-size: 1.0625rem; line-height: 1.65; }
.lede { font-size: 1.25rem; line-height: 1.55; }

.italic-display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-family: var(--font-body);
  text-align: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn--large { padding: 1.05rem 2.5rem; font-size: 1.0625rem; }
.btn--small { padding: 0.65rem 1.5rem; font-size: 0.9375rem; }

.btn--primary {
  background: var(--burgund);
  color: var(--bez-kremowy);
}
.btn--primary:hover, .btn--primary:focus-visible {
  background: var(--malina);
  color: var(--burgund-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -12px rgba(67, 3, 3, 0.45);
}
.btn--outline {
  background: transparent;
  color: var(--burgund-dark);
  border-color: var(--burgund-dark);
}
.btn--outline:hover, .btn--outline:focus-visible {
  background: var(--burgund-dark);
  color: var(--bez-kremowy);
  transform: translateY(-2px);
}

.coming-soon {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: rgba(252, 233, 223, 0.75);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-block: 1.25rem;
  background: transparent;
  transition: background-color var(--dur-med) var(--ease), padding-block var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease);
}
.site-header.is-scrolled {
  background: rgba(248, 242, 243, 0.92);
  backdrop-filter: blur(10px);
  padding-block: 0.75rem;
  box-shadow: 0 1px 0 rgba(67, 3, 3, 0.08);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--bez-kremowy);
  white-space: nowrap;
  min-width: 0;
  transition: color var(--dur-med) var(--ease);
}
.site-header.is-scrolled .brand { color: var(--burgund-dark); }
.brand__icon { width: 34px; height: auto; aspect-ratio: 1750/850; color: inherit; fill: currentColor; flex-shrink: 0; }
.brand__word {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 2.4vw + 0.4rem, 1.1rem);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.site-nav {
  display: none;
  gap: 2rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--bez-kremowy);
  transition: color var(--dur-med) var(--ease);
}
.site-header.is-scrolled .site-nav { color: var(--burgund-dark); }
.site-nav a { position: relative; padding: 0.25rem 0; }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: currentColor;
  transition: right var(--dur-fast) var(--ease);
}
.site-nav a:hover::after, .site-nav a:focus-visible::after { right: 0; }
.site-header .btn--small {
  background: var(--bez-kremowy);
  color: var(--burgund-dark);
}
.site-header.is-scrolled .btn--small {
  background: var(--burgund-dark);
  color: var(--bez-kremowy);
}
.site-header .btn--small:hover { background: var(--malina); color: var(--burgund-dark); }

@media (min-width: 768px) {
  .site-nav { display: flex; }
}

/* ==========================================================================
   Phone mockup (signature element)
   ========================================================================== */
.phone {
  --phone-w: 300px;
  width: var(--phone-w);
  perspective: 1400px;
}
.phone__frame {
  position: relative;
  aspect-ratio: 9 / 19.5;
  border-radius: 2.75rem;
  background: linear-gradient(160deg, #2a1414, var(--burgund-dark) 55%);
  padding: 0.5rem;
  box-shadow:
    0 40px 80px -30px rgba(43, 2, 2, 0.55),
    0 10px 30px -12px rgba(43, 2, 2, 0.4),
    inset 0 0 0 2px rgba(252, 233, 223, 0.08);
  transform-style: preserve-3d;
  will-change: transform;
}
.phone__notch {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  translate: -50% 0;
  width: 30%;
  height: 1.15rem;
  background: #2a1414;
  border-radius: 0 0 0.9rem 0.9rem;
  z-index: 3;
}
.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 2.2rem;
  overflow: hidden;
  background: var(--neutral-jasny);
}
.phone__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transform: translateY(14px) scale(1.02);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.phone__img.is-active {
  opacity: 1;
  transform: translateY(0) scale(1);
}
/* Hero phone */
.phone--hero {
  margin-inline: auto;
  transform: perspective(1400px) rotateY(-14deg) rotateX(4deg);
}

/* Scrolly desktop phone: hidden on mobile */
.scrolly-phone-col { display: none; }
.phone-mobile-slot { display: flex; justify-content: center; margin: 0 auto var(--space-4); }

@media (min-width: 768px) {
  .scrolly-phone-col { display: block; }
  .phone-mobile-slot { display: none; }
}

/* ==========================================================================
   Section rhythm
   ========================================================================== */
section { padding-block: var(--space-6); }

.hero {
  background: var(--burgund-dark);
  color: var(--bez-kremowy);
  padding-top: clamp(6rem, 10vh, 8rem);
  padding-bottom: var(--space-6);
  overflow: hidden;
}
.hero__inner {
  display: grid;
  gap: var(--space-5);
  align-items: center;
}
.hero__title { color: var(--bez-kremowy); }
.hero__subheadline {
  max-width: 40ch;
  margin-top: 2rem;
  color: rgba(252, 233, 223, 0.88);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--dur-slow) var(--ease) 0.2s, transform var(--dur-slow) var(--ease) 0.2s;
}
.hero__subheadline.reveal-in { opacity: 1; transform: translateY(0); }
.hero__cta { margin-top: 2.25rem; }
.hero__visual { display: flex; justify-content: center; }

@media (min-width: 1024px) {
  .hero__inner { grid-template-columns: 1.15fr 0.85fr; text-align: left; }
}
@media (max-width: 1023px) {
  .hero__inner { text-align: center; }
  .hero__subheadline { margin-inline: auto; }
  .hero__cta { display: flex; flex-direction: column; align-items: center; }
  .hero__visual { order: -1; margin-top: 0; margin-bottom: var(--space-4); }
  .phone { --phone-w: 240px; }
}

.problem {
  background: var(--bez-kremowy);
}
.problem__inner { text-align: center; margin-inline: auto; }
.problem h2 { margin-bottom: var(--space-3); max-width: 32ch; margin-inline: auto; }
.problem__lead { color: var(--burgund-dark); margin-top: 1rem; max-width: 62ch; margin-inline: auto; }
.problem__lead + .problem__lead { margin-top: 1.25rem; }

.for-whom { background: var(--bez-kremowy); }
.for-whom__inner { text-align: center; margin-inline: auto; }
.for-whom h2 { margin-bottom: var(--space-3); max-width: 32ch; margin-inline: auto; }
.for-whom__inner p { max-width: 62ch; margin-inline: auto; }

/* ==========================================================================
   Scrollytelling: Jak to dziala + Trzy tryby
   ========================================================================== */
.scrolly {
  background: var(--neutral-jasny);
  padding-block: 0;
  padding-bottom: var(--space-6);
  position: relative;
}
@media (min-width: 768px) {
  .scrolly { padding-bottom: 0; }
}
.scrolly-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--neutral-jasny);
  pointer-events: none;
}
.scrolly-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-5);
}
.scrolly-text { min-width: 0; }

.scrolly-heading {
  position: relative;
  z-index: 1;
  text-align: center;
  padding-block: var(--space-6) var(--space-3);
}
.scrolly-heading .eyebrow { margin-bottom: 0.5rem; }
.scrolly-heading h2 { margin-inline: auto; max-width: 20ch; }

.slide + .slide { margin-top: var(--space-4); }

.step-block {
  padding: var(--space-6) var(--space-3);
  max-width: 34rem;
  text-align: center;
  margin-inline: auto;
  transition: opacity var(--dur-med) var(--ease);
}
.step-block__num {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--burgund-dark);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.step-block h3 { margin-bottom: 0.6rem; }
.step-block p { color: var(--burgund-dark); }

.mode-card {
  background: var(--roz-pudrowy);
  border-radius: var(--radius-card);
  margin-inline: auto;
  max-width: 46ch;
  padding: var(--space-5);
  text-align: center;
}
.mode-card.is-active { box-shadow: 0 20px 40px -24px rgba(67,3,3,0.35); }

@media (min-width: 768px) {
  .slide {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .slide + .slide { margin-top: 0; }
  .step-block:not(.is-active) { opacity: 0.32; }
  .mode-card:not(.is-active) { opacity: 0.32; }
}

.offline-note {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: var(--space-5) var(--space-3) 0;
  color: var(--burgund-dark);
  font-weight: 600;
  font-size: 0.95rem;
}
.offline-note__icon { width: 22px; height: 22px; flex-shrink: 0; color: var(--burgund); }

.scrolly-phone-col {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100svh;
  align-self: start;
  justify-content: center;
  align-items: center;
}
.phone--scrolly { --phone-w: 230px; }
@media (min-height: 760px) {
  .phone--scrolly { --phone-w: 260px; }
}

@media (min-width: 768px) {
  .scrolly-grid { grid-template-columns: 1.05fr 0.95fr; }
  .scrolly-phone-col { display: flex; }
}

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq { background: var(--roz-pudrowy); text-align: center; }
.faq h2 { margin-bottom: var(--space-4); }
.faq__list { display: flex; flex-direction: column; gap: 0.75rem; max-width: 72ch; margin-inline: auto; text-align: left; }
.faq-item {
  background: var(--neutral-jasny);
  border-radius: 1.1rem;
  padding: 0.25rem 1.5rem;
  border: 1px solid rgba(67, 3, 3, 0.08);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
  font-weight: 700;
  font-size: 1.0625rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item__chevron { width: 20px; height: 20px; flex-shrink: 0; color: var(--burgund); transition: transform var(--dur-fast) var(--ease); }
.faq-item[open] .faq-item__chevron { transform: rotate(180deg); }
.faq-item p { padding-bottom: 1.5rem; color: var(--burgund-dark); max-width: 60ch; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--burgund-dark);
  color: var(--bez-kremowy);
  padding-block: var(--space-5);
}
.site-footer__inner {
  display: grid;
  gap: var(--space-3);
  text-align: center;
  justify-items: center;
}
.site-footer__brand { display: flex; align-items: center; gap: 0.6rem; }
.footer-word { font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 0.02em; }
.site-footer__business { font-size: 0.9375rem; color: rgba(252, 233, 223, 0.75); line-height: 1.7; }
.site-footer__business a { color: var(--roz-pudrowy); }
.site-footer__business a:hover { color: var(--bez-kremowy); text-decoration: underline; }
.site-footer__copy { font-size: 0.8125rem; color: rgba(252, 233, 223, 0.6); }

@media (min-width: 768px) {
  .site-footer__inner { justify-items: start; text-align: left; }
}

/* ==========================================================================
   Reveal (fade-up on view)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; animation: none; }
  .hero__tagline { opacity: 1; transform: none; animation: none; }
  .phone--hero { transform: none; }
  .phone__frame { transform: none !important; }
  .phone__img { transition: opacity 0.3s linear; transform: none; }
  .scrolly-phone-col { position: static; height: auto; }
  .slide { min-height: 0 !important; }
  .step-block:not(.is-active), .mode-card:not(.is-active) { opacity: 1 !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
    scroll-behavior: auto !important;
  }
}

/* Breakpoint niceties */
@media (max-width: 479px) {
  .container { width: min(100% - 2rem, var(--container-w)); }
  section { padding-block: var(--space-5); }
  .btn--large { padding: 0.9rem 1.75rem; width: 100%; }
  .hero__cta { width: 100%; }
  .site-header .btn--small { padding: 0.6rem 1.1rem; font-size: 0.875rem; }
}
