/* ==========================================================================
   Wawagon — All-in-One Scrollable Landing Page
   Logo red: #D23341
   ========================================================================== */

:root {
  --brand-red: #D23341;
  --brand-red-deep: #A61F2D;
  --ink-primary: #261014;
  --ink-secondary: #52282F;
  --ink-muted: rgba(74, 34, 41, 0.76);
  --surface-hairline: rgba(210, 51, 65, 0.14);
  --white: #FFFFFF;
  --white-hairline: rgba(255, 255, 255, 0.18);
  --banner-height: 76px;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink-primary);
  /* Soft near-white to logo-red (#D23341) diagonal linear gradient from top-left to bottom-right */
  background: linear-gradient(
    135deg,
    #FFFFFF 0%,
    #FFF3F4 24%,
    #FAD4D8 52%,
    #EE9BA4 78%,
    #DC5B68 100%
  );
  background-attachment: scroll;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body.drawer-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Top Banner (Full Solid Logo Red #D23341)
   -------------------------------------------------------------------------- */

.banner {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: var(--banner-height);
  background-color: var(--brand-red);
  border-bottom: 1px solid var(--white-hairline);
  transition: box-shadow 0.25s var(--ease-out);
}

.banner.is-scrolled {
  box-shadow: 0 10px 28px rgba(72, 8, 16, 0.26);
}

.banner__inner {
  width: 100%;
  height: 100%;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.banner__left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.banner__center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.banner__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

/* Inversed Logo (Pure White Wagon on Solid Red Banner) */
.banner__logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 12px;
  text-decoration: none;
  transition: transform 0.22s var(--ease-out), opacity 0.2s ease;
}

.banner__logo-link:hover {
  transform: scale(1.04);
}

.banner__logo-link:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

.banner__logo {
  display: block;
  height: 44px;
  width: auto;
  user-select: none;
}

/* Hamburger Button */
.hamburger {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease-out);
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
}

.hamburger:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.hamburger__line {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background-color: var(--white);
  transition: transform 0.26s var(--ease-out), opacity 0.2s ease;
}

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] .hamburger__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Language Dropdown (FR / EN with Flags + Down Arrow) */
.lang-dropdown {
  position: relative;
}

.lang-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 13px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lang-dropdown__trigger:hover,
.lang-dropdown__trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.48);
}

.lang-dropdown__trigger:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.lang-dropdown__current-flag {
  display: inline-flex;
  align-items: center;
}

.lang-dropdown__arrow {
  width: 16px;
  height: 16px;
  opacity: 0.92;
  transition: transform 0.22s var(--ease-out);
}

.lang-dropdown__trigger[aria-expanded="true"] .lang-dropdown__arrow {
  transform: rotate(180deg);
}

.lang-dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  min-width: 164px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 14px;
  background: var(--white);
  border: 1px solid rgba(210, 51, 65, 0.16);
  box-shadow: 0 16px 36px rgba(68, 10, 18, 0.24);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.2s var(--ease-out);
}

.lang-dropdown__menu.is-open {
  opacity: 1;
  transform: translateY(0);
}

.lang-dropdown__option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-dropdown__option:hover {
  background: rgba(210, 51, 65, 0.08);
}

.lang-dropdown__option.is-active {
  background: rgba(210, 51, 65, 0.12);
  color: var(--brand-red);
}

.lang-dropdown__option:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: -2px;
}

.lang-dropdown__label {
  flex: 1;
}

.lang-dropdown__tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  opacity: 0.65;
}

.flag-icon {
  width: 20px;
  height: 14px;
  border-radius: 2.5px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
}

/* --------------------------------------------------------------------------
   Slide-Out Navigation Drawer
   -------------------------------------------------------------------------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(34, 4, 8, 0.52);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.26s ease;
}

.drawer-backdrop.is-visible {
  opacity: 1;
}

.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  width: min(310px, 84vw);
  padding: 20px 24px 32px;
  background: linear-gradient(160deg, var(--brand-red) 0%, #8E1725 100%);
  border-right: 1px solid var(--white-hairline);
  box-shadow: none;
  visibility: hidden;
  transform: translateX(-100%);
  transition: transform 0.32s var(--ease-out), box-shadow 0.32s ease, visibility 0.32s ease;
  display: flex;
  flex-direction: column;
}

.drawer.is-open {
  visibility: visible;
  transform: translateX(0);
  box-shadow: 16px 0 44px rgba(34, 4, 8, 0.4);
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--white-hairline);
}

.drawer__logo {
  height: 34px;
  width: auto;
}

.drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.drawer__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.drawer__close svg {
  width: 20px;
  height: 20px;
}

.drawer__links {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer__link {
  display: block;
  padding: 14px 16px;
  border-radius: 12px;
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s var(--ease-out);
}

.drawer__link:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   Main Scrollable Content
   -------------------------------------------------------------------------- */

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  scroll-margin-top: var(--banner-height);
}

.section--description {
  min-height: calc(82vh - var(--banner-height));
  padding-top: 72px;
  padding-bottom: 72px;
}

.section--download {
  min-height: 62vh;
  padding-top: 72px;
  padding-bottom: 96px;
  border-top: 1px solid var(--surface-hairline);
}

.container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  margin: 0 0 28px;
  font-size: clamp(2.05rem, 4.8vw, 3.65rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.028em;
  color: var(--ink-primary);
  text-wrap: balance;
}

.hero-description {
  margin: 0 auto 48px;
  max-width: 600px;
  font-size: clamp(1.08rem, 2.1vw, 1.3rem);
  font-weight: 400;
  line-height: 1.72;
  color: var(--ink-secondary);
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(210, 51, 65, 0.28);
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-red-deep);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(210, 51, 65, 0.1);
  backdrop-filter: blur(8px);
  transition: background-color 0.22s ease, transform 0.22s var(--ease-out), border-color 0.22s ease, box-shadow 0.22s ease;
}

.scroll-cue:hover {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(210, 51, 65, 0.5);
  box-shadow: 0 10px 24px rgba(210, 51, 65, 0.16);
  transform: translateY(2px);
}

.scroll-cue svg {
  width: 17px;
  height: 17px;
  animation: gentleBounce 2.2s ease-in-out infinite;
}

@keyframes gentleBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

/* Download Section */
.download-title {
  margin: 0 0 16px;
  font-size: clamp(1.95rem, 4.4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
  text-wrap: balance;
}

.download-subtitle {
  margin: 0 auto 44px;
  max-width: 480px;
  font-size: clamp(1.02rem, 1.8vw, 1.18rem);
  line-height: 1.65;
  color: var(--ink-secondary);
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 224px;
  height: 66px;
  padding: 0 24px;
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  background: #140C0E;
  color: var(--white);
  text-decoration: none;
  text-align: left;
  box-shadow: 0 14px 32px rgba(138, 24, 37, 0.22);
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out), border-color 0.22s ease, background-color 0.22s ease;
}

.store-btn:hover {
  transform: translateY(-3px);
  background: #231418;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 20px 40px rgba(138, 24, 37, 0.3);
}

.store-btn:active {
  transform: translateY(-1px);
}

.store-btn:focus-visible {
  outline: 2px solid var(--brand-red-deep);
  outline-offset: 4px;
}

.store-btn__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.store-btn__icon--apple {
  transform: translateY(-1px);
}

.store-btn__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-btn__small {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.8);
}

.store-btn__large {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--white);
}

/* Footer */
.footer {
  padding: 24px 24px 86px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
  border-top: 1px solid var(--surface-hairline);
}

.footer p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Bottom Scroll-Driven Wagon Train
   -------------------------------------------------------------------------- */

.train-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: 70px;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  padding-bottom: 10px;
  opacity: 0;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(255, 255, 255, 0.42) 62%,
    rgba(255, 255, 255, 0) 100%
  );
}

.train-track {
  display: flex;
  align-items: flex-end;
  flex-shrink: 0;
  will-change: transform;
}

.train-wagon {
  display: block;
  width: 62px;
  height: auto;
  flex-shrink: 0;
  user-select: none;
  filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.5));
}

.train-junction {
  display: block;
  width: 14px;
  height: 5px;
  margin-bottom: 19px;
  flex-shrink: 0;
  background-color: var(--brand-red);
  filter: drop-shadow(0 1px 3px rgba(255, 255, 255, 0.45));
}

/* Toast Notification */
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 300;
  transform: translateX(-50%) translateY(16px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(15, 13, 14, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
  pointer-events: none;
}

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

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
  :root {
    --banner-height: 66px;
  }

  .banner__inner {
    padding: 0 16px;
    gap: 8px;
  }

  .banner__logo {
    height: 34px;
  }

  .hamburger {
    width: 40px;
    height: 40px;
  }

  .lang-dropdown__trigger {
    height: 40px;
    padding: 0 10px 0 11px;
    gap: 6px;
    font-size: 12px;
  }

  .flag-icon {
    width: 18px;
    height: 12px;
  }

  .section {
    padding: 56px 20px;
  }

  .section--description {
    min-height: calc(78vh - var(--banner-height));
  }

  .section--download {
    min-height: 56vh;
    padding-bottom: 72px;
  }

  .footer {
    padding-bottom: 74px;
  }

  .train-bar {
    height: 58px;
    padding-bottom: 8px;
  }

  .train-wagon {
    width: 48px;
  }

  .train-junction {
    width: 10px;
    height: 4px;
    margin-bottom: 15px;
  }

  .store-buttons {
    flex-direction: column;
    width: 100%;
  }

  .store-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

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

  .scroll-cue svg {
    animation: none;
  }
}
