/* Traffic landing experience: section rhythm, themed backgrounds and compact world route. */
.traffic-landing {
  --traffic-mechanic-bg: #f2eee4;
  --traffic-worlds-bg: #fff8ec;
  --traffic-gallery-bg: #eeeafa;
  --traffic-parents-bg: #edf5e5;
  --traffic-card-bg: rgba(255, 250, 244, 0.88);
  --traffic-card-border: rgba(26, 26, 26, 0.11);
  --traffic-pattern: rgba(26, 26, 26, 0.065);
  --traffic-road: rgba(26, 26, 26, 0.20);
}

.traffic-landing .traffic-section {
  isolation: isolate;
  overflow: hidden;
}

.traffic-landing .traffic-section > .traffic-container {
  position: relative;
  z-index: 2;
}

.traffic-landing .traffic-mechanic,
.traffic-landing .traffic-worlds,
.traffic-landing .traffic-gallery,
.traffic-landing .traffic-parents,
.traffic-landing .traffic-final {
  padding-block: clamp(78px, 8vw, 108px);
}

.traffic-landing .traffic-mechanic { background: var(--traffic-mechanic-bg); }
.traffic-landing .traffic-worlds { background: var(--traffic-worlds-bg); }
.traffic-landing .traffic-gallery { background: var(--traffic-gallery-bg); }
.traffic-landing .traffic-parents { background: var(--traffic-parents-bg); }

.traffic-landing .traffic-hero {
  background:
    radial-gradient(circle at 8% 18%, rgba(105, 166, 35, 0.15), transparent 24%),
    radial-gradient(circle at 88% 76%, rgba(235, 118, 36, 0.14), transparent 26%),
    linear-gradient(135deg, #fffaf4, #f6f0e6 58%, #f2eadf);
}

.traffic-landing .traffic-hero::before {
  position: absolute;
  inset: 72px 0 0;
  background:
    repeating-linear-gradient(118deg, transparent 0 82px, rgba(26, 26, 26, 0.035) 83px 85px, transparent 86px 166px);
  content: "";
  mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
  pointer-events: none;
}

.traffic-landing .traffic-mechanic::after,
.traffic-landing .traffic-worlds::after,
.traffic-landing .traffic-gallery::after,
.traffic-landing .traffic-parents::after,
.traffic-landing .traffic-final::after {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 3;
  width: min(calc(100vw - 80px), 1120px);
  height: 9px;
  border-radius: 999px;
  background: url('../img/brand/tibumo-color-bar.png') center / 100% 100% no-repeat;
  box-shadow: 0 1px 3px rgba(26, 26, 26, 0.12);
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

.traffic-landing .traffic-worlds::after { background-image: url('../img/brand/tibumo-color-bar-universes.png'); }
.traffic-landing .traffic-gallery::after { background-image: url('../img/brand/tibumo-color-bar-showcase.png'); }
.traffic-landing .traffic-parents::after { background-image: url('../img/brand/tibumo-color-bar-safety.png'); }
.traffic-landing .traffic-final::after { background-image: url('../img/brand/tibumo-color-bar-games.png'); }

.traffic-landing .traffic-mechanic::before,
.traffic-landing .traffic-worlds::before,
.traffic-landing .traffic-gallery::before,
.traffic-landing .traffic-parents::before {
  position: absolute;
  inset: 28px 0;
  z-index: 0;
  content: "";
  pointer-events: none;
}

.traffic-landing .traffic-mechanic::before {
  background:
    radial-gradient(circle at 12% 24%, rgba(105, 166, 35, 0.20), transparent 22%),
    radial-gradient(circle at 88% 70%, rgba(235, 118, 36, 0.16), transparent 24%),
    repeating-linear-gradient(115deg, transparent 0 46px, var(--traffic-pattern) 47px 49px, transparent 50px 96px);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.traffic-landing .traffic-worlds::before {
  background:
    radial-gradient(circle at 13% 72%, rgba(105, 166, 35, 0.24), transparent 24%),
    radial-gradient(circle at 50% 18%, rgba(235, 118, 36, 0.20), transparent 22%),
    radial-gradient(circle at 88% 70%, rgba(131, 53, 206, 0.20), transparent 25%);
}

.traffic-landing .traffic-gallery::before {
  background:
    radial-gradient(circle at 76% 18%, rgba(131, 53, 206, 0.17), transparent 23%),
    linear-gradient(90deg, var(--traffic-pattern) 1px, transparent 1px),
    linear-gradient(var(--traffic-pattern) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
}

.traffic-landing .traffic-parents::before {
  background:
    radial-gradient(circle at 18% 22%, rgba(245, 190, 50, 0.20), transparent 23%),
    radial-gradient(circle at 82% 78%, rgba(68, 153, 249, 0.16), transparent 24%),
    repeating-linear-gradient(0deg, transparent 0 37px, var(--traffic-pattern) 38px 39px);
}

.traffic-landing .traffic-mechanic::before,
.traffic-landing .traffic-parents::before,
.traffic-landing .traffic-final::before {
  position: absolute;
  inset: 28px 0;
  z-index: 0;
  background-image: url('../img/traffic/traffic-doodle-light.webp');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  content: "";
  opacity: 0.32;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 10%, #000 90%, transparent 100%);
}

:root[data-theme="light"] .traffic-landing .traffic-mechanic::before,
:root[data-theme="light"] .traffic-landing .traffic-parents::before,
:root[data-theme="light"] .traffic-landing .traffic-final::before {
  background-image: url('../img/traffic/traffic-doodle-light.webp');
  opacity: 0.32;
}

.traffic-landing .traffic-section__head {
  margin-inline: auto;
  text-align: center;
}

.traffic-landing .traffic-section__head > p:last-child {
  margin-inline: auto;
}

.traffic-landing .traffic-kicker {
  display: table;
  margin: 0 auto 16px;
  padding: 7px 14px;
  border: 1px dashed rgba(131, 53, 206, 0.30);
  border-radius: 7px;
  background: rgba(255, 250, 244, 0.68);
  color: var(--tibumo-purple);
  transform: rotate(-1deg);
}

.traffic-landing .rainbow-title span { text-shadow: none; }
.traffic-landing .rainbow-title span:nth-child(5n+1) { color: var(--tibumo-blue); }
.traffic-landing .rainbow-title span:nth-child(5n+2) { color: var(--tibumo-green); }
.traffic-landing .rainbow-title span:nth-child(5n+3) { color: var(--tibumo-orange); }
.traffic-landing .rainbow-title span:nth-child(5n+4) { color: var(--tibumo-purple); }
.traffic-landing .rainbow-title span:nth-child(5n+5) { color: #d94f8c; }

.traffic-landing .traffic-steps {
  position: relative;
  gap: clamp(16px, 2vw, 26px);
}

.traffic-landing .traffic-steps::before {
  position: absolute;
  top: 42px;
  right: 11%;
  left: 11%;
  z-index: -1;
  border-top: 4px dashed var(--traffic-road);
  content: "";
}

.traffic-landing .traffic-steps article,
.traffic-landing .traffic-parent-grid article {
  border: 1px solid var(--traffic-card-border);
  border-top: 5px solid var(--tibumo-blue);
  border-radius: 18px 7px 18px 7px;
  background: var(--traffic-card-bg);
  box-shadow: 0 14px 32px rgba(26, 26, 26, 0.08);
  backdrop-filter: blur(8px);
}

.traffic-landing .traffic-steps article:nth-child(1) { transform: rotate(-0.7deg); }
.traffic-landing .traffic-steps article:nth-child(2) { transform: translateY(12px); }
.traffic-landing .traffic-steps article:nth-child(3) { transform: rotate(0.7deg); }

.traffic-worlds__hint {
  display: none;
  color: var(--traffic-muted);
  font-weight: 800;
}

.traffic-landing .traffic-world-grid {
  position: relative;
  gap: 18px;
}

.traffic-landing .traffic-world-grid::before {
  position: absolute;
  top: 44%;
  right: 4%;
  left: 4%;
  z-index: -1;
  border-top: 5px dashed var(--traffic-road);
  content: "";
}

.traffic-landing .traffic-world {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--traffic-card-border);
  border-top: 6px solid var(--tibumo-green);
  border-radius: 22px 8px 22px 8px;
  background: var(--traffic-card-bg);
  box-shadow: 0 18px 38px rgba(26, 26, 26, 0.11);
}

.traffic-landing .traffic-world--farm { transform: translateY(0); }
.traffic-landing .traffic-world--racing { transform: translateY(18px); }
.traffic-landing .traffic-world--space { transform: translateY(36px); }

.traffic-landing .traffic-world__visual {
  position: relative;
  overflow: hidden;
}

.traffic-landing .traffic-world__visual::after {
  position: absolute;
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(transparent, rgba(18, 19, 32, 0.42));
  content: "";
  pointer-events: none;
}

.traffic-landing .traffic-world img {
  height: auto;
  aspect-ratio: 16 / 9;
  object-position: center 42%;
  transition: transform 240ms ease;
}

.traffic-landing .traffic-world:hover img { transform: scale(1.025); }

.traffic-world__count {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 1;
  color: white;
  font-family: var(--brand-font);
  font-size: 36px;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.54);
}

.traffic-landing .traffic-world__body { padding: 18px 19px 20px; }
.traffic-landing .traffic-world h3 { color: var(--tibumo-green); }
.traffic-landing .traffic-world--racing h3 { color: var(--tibumo-orange); }
.traffic-landing .traffic-world--space h3 { color: var(--tibumo-purple); }
.traffic-landing .traffic-world p { font-size: 15px; line-height: 1.48; }
.traffic-landing .traffic-world ul { margin-top: 13px; }

.traffic-landing .traffic-gallery__shell {
  overflow: hidden;
  border: 1px solid var(--traffic-card-border);
  border-radius: 24px 8px 24px 8px;
  background: var(--traffic-card-bg);
  box-shadow: 0 20px 48px rgba(26, 26, 26, 0.14);
}

.traffic-landing .traffic-gallery__viewport { min-height: 0; }
.traffic-landing .traffic-gallery__devices {
  padding: clamp(22px, 3vw, 34px);
  background:
    radial-gradient(circle at 86% 12%, rgba(131, 53, 206, 0.32), transparent 26%),
    radial-gradient(circle at 12% 88%, rgba(68, 153, 249, 0.22), transparent 24%),
    #171821;
}
.traffic-landing .traffic-gallery__phone { width: min(100%, 270px); }
.traffic-landing .traffic-gallery figcaption { background: var(--traffic-card-bg); }
.traffic-landing .traffic-gallery__controls { padding-bottom: 18px; }

.traffic-landing .traffic-parent-grid { gap: 18px; }
.traffic-landing .traffic-parent-grid article { min-height: 176px; }

.traffic-landing .traffic-final {
  background:
    radial-gradient(circle at 12% 22%, rgba(245, 190, 50, 0.38), transparent 24%),
    radial-gradient(circle at 88% 76%, rgba(68, 153, 249, 0.28), transparent 25%),
    linear-gradient(135deg, rgba(235, 118, 36, 0.24), rgba(131, 53, 206, 0.20)),
    var(--tibumo-cream);
}

.traffic-landing .traffic-final__inner {
  max-width: 980px;
  border: 1px solid var(--traffic-card-border);
  border-radius: 28px 10px 28px 10px;
  background: var(--traffic-card-bg);
  box-shadow: 0 20px 50px rgba(26, 26, 26, 0.13);
  text-align: center;
}

.traffic-landing .traffic-final .traffic-stores { justify-content: center; }

:root[data-theme="dark"] .traffic-landing {
  --traffic-mechanic-bg: #1e2026;
  --traffic-worlds-bg: #191c21;
  --traffic-gallery-bg: #20202b;
  --traffic-parents-bg: #1b211d;
  --traffic-card-bg: rgba(249, 246, 241, 0.075);
  --traffic-card-border: rgba(249, 246, 241, 0.15);
  --traffic-pattern: rgba(249, 246, 241, 0.055);
  --traffic-road: rgba(249, 246, 241, 0.20);
}

:root[data-theme="dark"] .traffic-landing .traffic-kicker {
  border-color: rgba(245, 190, 50, 0.30);
  background: rgba(249, 246, 241, 0.08);
  color: var(--tibumo-yellow);
}

:root[data-theme="dark"] .traffic-landing .rainbow-title span:nth-child(5n+5) { color: var(--tibumo-yellow); }
:root[data-theme="dark"] .traffic-landing .traffic-hero {
  background:
    radial-gradient(circle at 8% 18%, rgba(105, 166, 35, 0.12), transparent 24%),
    radial-gradient(circle at 88% 76%, rgba(235, 118, 36, 0.12), transparent 26%),
    #1a1a1a;
}
:root[data-theme="dark"] .traffic-landing .traffic-final { background-color: var(--tibumo-black); }
:root[data-theme="dark"] .traffic-landing .traffic-final__inner { background: rgba(26, 26, 26, 0.78); }
:root[data-theme="dark"] .traffic-landing .traffic-mechanic::before,
:root[data-theme="dark"] .traffic-landing .traffic-parents::before,
:root[data-theme="dark"] .traffic-landing .traffic-final::before {
  background-image: url('../img/traffic/traffic-doodle-dark.webp');
  opacity: 0.56;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .traffic-landing {
    --traffic-mechanic-bg: #1e2026;
    --traffic-worlds-bg: #191c21;
    --traffic-gallery-bg: #20202b;
    --traffic-parents-bg: #1b211d;
    --traffic-card-bg: rgba(249, 246, 241, 0.075);
    --traffic-card-border: rgba(249, 246, 241, 0.15);
    --traffic-pattern: rgba(249, 246, 241, 0.055);
    --traffic-road: rgba(249, 246, 241, 0.20);
  }
  :root:not([data-theme="light"]) .traffic-landing .traffic-kicker {
    border-color: rgba(245, 190, 50, 0.30);
    background: rgba(249, 246, 241, 0.08);
    color: var(--tibumo-yellow);
  }
  :root:not([data-theme="light"]) .traffic-landing .rainbow-title span:nth-child(5n+5) { color: var(--tibumo-yellow); }
  :root:not([data-theme="light"]) .traffic-landing .traffic-hero {
    background:
      radial-gradient(circle at 8% 18%, rgba(105, 166, 35, 0.12), transparent 24%),
      radial-gradient(circle at 88% 76%, rgba(235, 118, 36, 0.12), transparent 26%),
      #1a1a1a;
  }
  :root:not([data-theme="light"]) .traffic-landing .traffic-final { background-color: var(--tibumo-black); }
  :root:not([data-theme="light"]) .traffic-landing .traffic-final__inner { background: rgba(26, 26, 26, 0.78); }
  :root:not([data-theme="light"]) .traffic-landing .traffic-mechanic::before,
  :root:not([data-theme="light"]) .traffic-landing .traffic-parents::before,
  :root:not([data-theme="light"]) .traffic-landing .traffic-final::before {
    background-image: url('../img/traffic/traffic-doodle-dark.webp');
    opacity: 0.56;
  }
}

@media (max-width: 980px) {
  .traffic-landing .traffic-worlds__hint { display: block; }
  .traffic-landing .traffic-world-grid {
    display: grid;
    grid-auto-columns: min(78vw, 560px);
    grid-auto-flow: column;
    grid-template-columns: none;
    margin-right: calc((100vw - min(1180px, calc(100vw - 40px))) / -2);
    padding: 4px max(24px, calc((100vw - 1180px) / 2)) 28px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-color: var(--tibumo-orange) transparent;
    scrollbar-width: thin;
  }
  .traffic-landing .traffic-world {
    display: block;
    scroll-snap-align: start;
    transform: none;
  }
  .traffic-landing .traffic-world-grid::before { display: none; }
}

@media (max-width: 700px) {
  .traffic-landing .traffic-mechanic,
  .traffic-landing .traffic-worlds,
  .traffic-landing .traffic-gallery,
  .traffic-landing .traffic-parents,
  .traffic-landing .traffic-final { padding-block: 70px; }
  .traffic-landing .traffic-mechanic::after,
  .traffic-landing .traffic-worlds::after,
  .traffic-landing .traffic-gallery::after,
  .traffic-landing .traffic-parents::after,
  .traffic-landing .traffic-final::after {
    width: calc(100vw - 32px);
    height: 7px;
  }
  .traffic-landing .traffic-section__head { margin-bottom: 30px; }
  .traffic-landing .traffic-steps { gap: 14px; }
  .traffic-landing .traffic-steps::before { display: none; }
  .traffic-landing .traffic-steps article { transform: none; }
  .traffic-landing .traffic-world-grid {
    grid-auto-columns: min(86vw, 420px);
    margin-right: -14px;
  }
  .traffic-landing .traffic-world img { aspect-ratio: 3 / 2; }
  .traffic-landing .traffic-gallery__devices { gap: 18px; }
  .traffic-landing .traffic-gallery__phone { width: min(58vw, 230px); }
  .traffic-landing .traffic-parent-grid article { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .traffic-landing .traffic-world img { transition: none; }
  .traffic-landing .traffic-world:hover img { transform: none; }
}
