/* Landing (front-page.php). Builds on the tokens in style.css. */

.lp-section {
  padding-block: 96px 0;
}

.lp-head {
  margin-bottom: 34px;
}

.lp-head h2 {
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.08;
  margin: 0;
}

.lp-head--row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ hero */
.lp-hero {
  position: relative;
  overflow: hidden;
  padding-block: 56px 72px;
}

.lp-hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 32px;
  align-items: center;
}

.lp-hero__copy {
  position: relative;
  z-index: 2;
}

/* headline: the second line rides on the four livery rails, drawn in from the right */
.lp-hero__title {
  margin: 0;
  font-size: clamp(54px, 8.4vw, 116px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.lp-hero__l1 {
  display: block;
  font-size: 0.58em;
  font-weight: 800;
  color: var(--ink-2);
}

.lp-hero__rail {
  position: relative;
  display: inline-block;
  padding-bottom: 0.2em;
}

.lp-hero__rail::after {
  content: '';
  position: absolute;
  inset-inline: -0.06em -0.3em;
  bottom: 0;
  height: 0.17em;
  background: var(--stripes);
  transform-origin: right center;
  animation: lp-rail 1.1s 0.15s cubic-bezier(0.65, 0, 0.35, 1) both;
}

.lp-hero__dot {
  color: var(--red);
}

@keyframes lp-rail {
  from {
    transform: scaleX(0);
  }
}

/* departure board under the headline: a split-flap row that cycles destinations */
.lp-depart {
  margin-top: 26px;
  max-width: 540px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-md);
  padding: 10px 14px 12px;
  box-shadow: -8px 8px 0 var(--yellow);
}

.lp-depart__head,
.lp-depart__row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 14px;
}

.lp-depart__head {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--yellow);
  letter-spacing: 0.02em;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(243, 238, 228, 0.25);
}

.lp-depart__row {
  padding-top: 10px;
  perspective: 400px;
}

.lp-depart__line {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--lc, var(--red));
  border: 3px solid var(--paper);
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  transition: background-color 0.3s;
}

.lp-depart__dest {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.lp-depart__dest b {
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 900;
  white-space: nowrap;
  color: #fff;
}

.lp-depart__dest small {
  font-size: 14px;
  font-weight: 700;
  color: rgba(243, 238, 228, 0.6);
  white-space: nowrap;
}

.lp-depart__eta {
  font-size: 15px;
  font-weight: 800;
  color: var(--yellow);
  white-space: nowrap;
}

.lp-depart.is-flipping .lp-depart__dest,
.lp-depart.is-flipping .lp-depart__eta {
  animation: lp-flip 0.5s cubic-bezier(0.3, 0, 0.2, 1);
}

@keyframes lp-flip {
  0% {
    transform: rotateX(0);
    opacity: 1;
  }
  45% {
    transform: rotateX(-90deg);
    opacity: 0.2;
  }
  55% {
    transform: rotateX(90deg);
    opacity: 0.2;
  }
  100% {
    transform: rotateX(0);
    opacity: 1;
  }
}

.lp-depart__eta::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 7px;
  border-radius: 50%;
  background: var(--yellow);
  animation: lp-blink 1.2s steps(2, start) infinite;
}

@keyframes lp-blink {
  to {
    visibility: hidden;
  }
}

.lp-hero__kicker {
  margin: 14px 0 0;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 900;
  line-height: 1.3;
}

.lp-hero__sub {
  margin: 14px 0 0;
  max-width: 34em;
  font-size: 18px;
  color: var(--ink-2);
}

.lp-hero__art {
  position: relative;
  align-self: stretch;
  min-height: 460px;
}

.lp-sweep {
  position: absolute;
  inset-block: 0;
  inset-inline-end: calc((100vw - min(100vw - 40px, var(--wrap))) / -2);
  width: calc(100% + (100vw - min(100vw - 40px, var(--wrap))) / 2);
  height: 100%;
}

.lp-sweep path {
  stroke-dasharray: 1700;
  stroke-dashoffset: 1700;
  animation: lp-draw 1.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.lp-sweep path:nth-child(2) {
  animation-delay: 0.12s;
}

.lp-sweep path:nth-child(3) {
  animation-delay: 0.24s;
}

.lp-sweep path:nth-child(4) {
  animation-delay: 0.36s;
}

@keyframes lp-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.lp-hero__roundel {
  position: absolute;
  top: 4%;
  inset-inline-start: 0;
  width: clamp(150px, 18vw, 230px);
  animation: lp-roll 1.2s 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.lp-roundel {
  width: 100%;
  height: auto;
  color: var(--ink);
}

@keyframes lp-roll {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
}

/* trip planner */
.planner {
  position: relative;
  margin-top: 30px;
  max-width: 540px;
  padding: 20px 20px 18px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: -8px 8px 0 var(--ink);
}

.planner__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.planner__row + .planner__swap + .planner__row {
  border-top: 1.5px solid var(--rule);
}

.planner__dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid var(--ink);
  background: var(--yellow);
}

.planner__dot--to {
  background: var(--red);
}

.planner__field {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-block: 8px;
}

.planner__field span {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--muted);
}

.planner__field input {
  border: 0;
  outline: 0;
  background: transparent;
  padding: 2px 0 4px;
  font-size: 19px;
  font-weight: 800;
  min-width: 0;
}

.planner__field input::placeholder {
  color: #b0aa9e;
  font-weight: 600;
}

.planner__swap {
  position: absolute;
  inset-inline-end: 20px;
  top: 52px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
}

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

.planner__swap:hover {
  background: var(--yellow);
}

.planner__go {
  width: 100%;
  margin-top: 14px;
  min-height: 54px;
  font-size: 17px;
}

.planner__alt {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  text-align: center;
  text-decoration: none;
}

.planner__alt:hover {
  text-decoration: underline;
}

.planner__error {
  margin: 10px 0 0;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--red) 12%, var(--surface));
  border-inline-start: 4px solid var(--red);
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 960px) {
  .lp-hero {
    padding-top: 28px;
  }

  .lp-hero__grid {
    grid-template-columns: 1fr;
  }

  .lp-hero__art {
    position: relative;
    min-height: 0;
    height: 300px;
    margin-inline-end: -20px;
    margin-top: -40px;
  }

  .lp-sweep {
    inset-inline-end: 0;
    width: 100%;
  }

  .lp-hero__roundel {
    display: none;
  }
}

@media (max-width: 560px) {
  .lp-hero__art {
    height: 250px;
  }

  .planner {
    box-shadow: -5px 5px 0 var(--ink);
  }

  .lp-depart {
    box-shadow: -5px 5px 0 var(--yellow);
  }

  .lp-depart__head,
  .lp-depart__row {
    grid-template-columns: 40px 1fr auto;
    gap: 10px;
  }

  .lp-depart__line {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .lp-depart__dest small {
    display: none;
  }
}

/* --------------------------------------------------------------- numbers */
.lp-numbers {
  background: var(--ink);
  color: var(--paper);
}

.lp-numbers__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.lp-numbers__grid > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 30px 0;
  padding-inline-start: 24px;
  border-inline-start: 1px solid rgba(243, 238, 228, 0.16);
}

.lp-numbers__grid > div:first-child {
  border-inline-start: 0;
  padding-inline-start: 0;
}

.lp-numbers b {
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 900;
  line-height: 1;
  color: var(--yellow);
}

.lp-numbers__grid > div:nth-child(2) b {
  color: #fff;
}

.lp-numbers__grid > div:nth-child(3) b {
  color: #7fd3a6;
}

.lp-numbers__grid > div:nth-child(4) b {
  color: #f58b78;
}

.lp-numbers span {
  font-weight: 700;
  font-size: 15px;
  color: rgba(243, 238, 228, 0.8);
}

@media (max-width: 760px) {
  .lp-numbers__grid {
    grid-template-columns: 1fr 1fr;
  }

  .lp-numbers__grid > div {
    flex-direction: column;
    gap: 4px;
    padding: 22px 0;
    padding-inline-start: 18px;
  }

  .lp-numbers__grid > div:nth-child(3) {
    border-inline-start: 0;
    padding-inline-start: 0;
  }
}

/* ------------------------------------------------------------------- how */
.lp-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  counter-reset: s;
  position: relative;
}

.lp-steps::before {
  content: '';
  position: absolute;
  inset-inline: 30px;
  top: 28px;
  height: 14px;
  background: var(--stripes);
}

.lp-steps li {
  counter-increment: s;
  position: relative;
  padding-top: 84px;
  padding-inline-end: 28px;
}

.lp-steps li::before {
  content: counter(s, persian);
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--paper);
  border: 8px solid var(--ink);
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 900;
}

.lp-steps b {
  display: block;
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 6px;
}

.lp-steps span {
  color: var(--ink-2);
}

@media (max-width: 760px) {
  .lp-steps {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .lp-steps::before {
    inset-inline: auto;
    inset-inline-start: 28px;
    top: 30px;
    bottom: 30px;
    width: 14px;
    height: auto;
    background: linear-gradient(
      to left,
      var(--red) 0 22%,
      transparent 22% 26%,
      var(--green) 26% 48%,
      transparent 48% 52%,
      var(--yellow) 52% 74%,
      transparent 74% 78%,
      var(--blue) 78% 100%
    );
  }

  .lp-steps li {
    padding-top: 6px;
    padding-inline-start: 96px;
    min-height: 70px;
  }
}

/* ---------------------------------------------------------------- cities */
.lp-cities {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.lp-city {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  min-height: 170px;
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.lp-city:first-child {
  grid-column: span 2;
  grid-row: span 2;
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.lp-city:hover {
  color: inherit;
  border-color: var(--ink);
  transform: translate(3px, -3px);
  box-shadow: -6px 6px 0 var(--ink);
}

.lp-city__name {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 900;
  line-height: 1.05;
}

.lp-city:first-child .lp-city__name {
  font-size: clamp(54px, 8vw, 110px);
}

.lp-city__meta {
  margin-top: auto;
  font-weight: 800;
  font-size: 14.5px;
  opacity: 0.8;
}

.lp-city:first-child .lb {
  min-width: 40px;
  height: 40px;
  font-size: 19px;
  box-shadow: 0 0 0 3px var(--paper);
}

@media (max-width: 760px) {
  .lp-cities {
    grid-template-columns: 1fr 1fr;
  }

  .lp-city:first-child {
    grid-row: auto;
  }
}

/* ------------------------------------------------------------ line board */
.lp-board {
  margin-top: 96px;
  padding-block: 80px;
  background: var(--ink);
  color: var(--paper);
}

.lp-board .lp-head h2 {
  color: var(--paper);
}

.lp-board .eyebrow {
  color: rgba(243, 238, 228, 0.8);
}

.lp-rails {
  display: grid;
  gap: 4px;
}

.lp-rail {
  --lc: #fff;
  display: grid;
  grid-template-columns: 54px minmax(90px, 160px) 1fr minmax(90px, 160px) 90px;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  color: var(--paper);
  text-decoration: none;
  font-weight: 800;
}

.lp-rail:hover {
  background: rgba(243, 238, 228, 0.07);
  color: #fff;
}

.lp-rail .lb {
  box-shadow: 0 0 0 3px var(--ink);
}

.lp-rail__end:last-of-type {
  text-align: end;
}

.lp-rail__track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--lc);
}

.lp-rail__track::before,
.lp-rail__track::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--ink);
  border: 4px solid var(--paper);
}

.lp-rail__track::before {
  inset-inline-start: -4px;
}

.lp-rail__track::after {
  inset-inline-end: -4px;
}

.lp-rail__count {
  font-size: 13.5px;
  color: rgba(243, 238, 228, 0.6);
  text-align: end;
}

@media (max-width: 760px) {
  .lp-rail {
    grid-template-columns: 46px 1fr;
    grid-template-areas: 'b a' 'b t' 'b z';
    row-gap: 6px;
  }

  .lp-rail .lbs {
    grid-area: b;
  }

  .lp-rail__end:first-of-type {
    grid-area: a;
  }

  .lp-rail__track {
    grid-area: t;
  }

  .lp-rail__end:last-of-type {
    grid-area: z;
    text-align: start;
  }

  .lp-rail__count {
    display: none;
  }
}

/* ----------------------------------------------------------------- embed */
.lp-embed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.lp-embed > * {
  min-width: 0;
}

.lp-embed__copy h2 {
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.1;
}

.lp-embed__copy p {
  color: var(--ink-2);
  max-width: 34em;
}

.lp-code {
  margin: 22px 0 0;
  padding: 18px 20px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #e9e2d4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  text-align: left;
  border-inline-end: 10px solid var(--yellow);
}

.lp-embed__demo .reylo-route {
  margin: 0;
}

@media (max-width: 900px) {
  .lp-embed {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------------- final */
.lp-final {
  margin-top: 110px;
  margin-bottom: -88px;
}

.lp-final__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 48px 48px 48px 220px;
  background: var(--yellow);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  overflow: hidden;
}

.lp-final h2 {
  font-size: clamp(36px, 6vw, 80px);
  line-height: 1.05;
  margin: 0 0 8px;
}

.lp-final p {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}

.lp-final__art {
  position: absolute;
  inset-inline-end: 24px;
  bottom: -12px;
  width: 170px;
}

.lp-final__art path:nth-child(3) {
  fill: var(--paper);
}

@media (max-width: 760px) {
  .lp-final__inner {
    padding: 34px 24px 140px;
  }
}

/* ---------------------------------------------------------------- reveal */
.js [data-reveal] > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js [data-reveal].is-in > * {
  opacity: 1;
  transform: none;
}

.js [data-reveal].is-in > *:nth-child(2) {
  transition-delay: 0.06s;
}

.js [data-reveal].is-in > *:nth-child(3) {
  transition-delay: 0.12s;
}

.js [data-reveal].is-in > *:nth-child(4) {
  transition-delay: 0.18s;
}

.js [data-reveal].is-in > *:nth-child(5) {
  transition-delay: 0.24s;
}

.js [data-reveal].is-in > *:nth-child(6) {
  transition-delay: 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] > * {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Internal landings & widget page (template-landing.php, template-widgets.php)
   ========================================================================== */
.lp-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.lp-hero__art--widget {
  min-height: 0;
  align-self: center;
}

.lp-hero__art--widget .reylo-route,
.lp-hero__art--widget .reylo-near {
  margin: 0;
}

.lp-widget-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.tiles--4 {
  grid-template-columns: repeat(4, 1fr);
}

.lp-faq {
  max-width: var(--prose);
  border-top: 1.5px solid var(--ink);
}

.lp-faq details {
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}

.lp-faq summary {
  cursor: pointer;
  font-weight: 900;
  font-size: 17px;
}

.lp-faq p {
  margin: 10px 0 0;
  line-height: 1.9;
  color: var(--ink-2);
}

/* widget page */
.wd-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.wd-type {
  position: relative;
  padding: 22px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: -5px 5px 0 var(--ink);
}

.wd-type__n {
  position: absolute;
  top: -14px;
  inset-inline-start: 18px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid var(--ink);
  font-weight: 900;
}

.wd-type h3 {
  margin: 6px 0 6px;
  font-size: 19px;
}

.wd-type p {
  margin: 0 0 12px;
  color: var(--ink-2);
  line-height: 1.8;
}

.wd-type .lp-code {
  font-size: 12.5px;
}

.wd-note {
  margin: 26px 0 8px;
  font-weight: 800;
}

.wd-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.wd-form {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-md);
}

.wd-modes {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.wd-modes legend {
  font-weight: 900;
  margin-bottom: 6px;
}

.wd-modes label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}

.wd-end {
  display: grid;
  gap: 10px;
}

.wd-end[hidden] {
  display: none;
}

.wd-form label {
  display: grid;
  gap: 4px;
  font-weight: 800;
  font-size: 14px;
}

.wd-form small {
  font-weight: 600;
  color: var(--muted);
}

.wd-form input[type='text'],
.wd-form textarea {
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
}

.wd-form textarea {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12.5px;
  direction: ltr;
  text-align: left;
}

.wd-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.wd-copied {
  margin-inline-start: 10px;
  font-weight: 800;
  color: var(--green-ink);
}

.wd-preview .eyebrow {
  display: inline-block;
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .wd-builder,
  .wd-types {
    grid-template-columns: 1fr;
  }

  .tiles--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .lp-hero__art--widget {
    height: auto;
    margin: 24px 0 0;
  }
}
