:root {
  --green-bg: #0d311b;
  --green-deep: #006937;
  --green-mid: #006937;
  --green-light: #6abf4b;
  --blue-light: #0082ca;
  --blue-dark: #012856;
  --white: #ffffff;
  --radius: 22px;
  --gap: 18px;
  --maxw: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

#loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #ffffff;
  display: grid;
  place-items: center;
  transition: opacity .7s ease, visibility .7s ease;
}
#loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.loader__outline,
.loader__fill {
  position: absolute;
  width: 42vmin;
  height: 42vmin;
  -webkit-mask: url('assets/saudia80y.svg') center/contain no-repeat;
          mask: url('assets/saudia80y.svg') center/contain no-repeat;
}
.loader__outline {
  background: var(--green-deep);
  opacity: 0.15;
  animation: loaderOutlinePulse 2.6s ease-in-out infinite;
}
.loader__fill {
  background: linear-gradient(
    to top,
    var(--green-deep) 0%,
    var(--green-deep) 50%,
    transparent 50%,
    transparent 100%
  );
  background-size: 100% 220%;
  background-position: 0 110%;
  animation: loaderFillEmpty 2.6s cubic-bezier(.5,.05,.5,.95) infinite;
}

@keyframes loaderFillEmpty {
  0%   { background-position: 0 110%; }
  45%  { background-position: 0 0%;   }
  55%  { background-position: 0 0%;   }
  100% { background-position: 0 110%; }
}
@keyframes loaderOutlinePulse {
  0%, 100% { opacity: 0.12; }
  50%      { opacity: 0.28; }
}

html { scroll-behavior: smooth; }

html, body {
  background: var(--green-bg);
  color: var(--white);
  font-family: 'Saudia Sans', system-ui, sans-serif;
  font-weight: 300;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
}

.top-strip {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex-shrink: 0;
}
.top-strip span { width: 100%; height: 10px; display: block; }
.s-light      { background: var(--green-light); }
.s-dark       { background: var(--green-deep); }
.top-strip .s-white { background: var(--white); height: 4px; }
.s-blue-dark  { background: var(--blue-dark); }
.s-blue-light { background: var(--blue-light); }

.sky__header {
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  padding: 0 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}
.sky__logo-main { width: 280px; height: auto; }

@media (max-width: 640px) {
  .sky__header { top: 16px; padding: 0 18px; }
  .sky__logo-main { width: 180px; }
}

.page {
  max-width: var(--maxw);
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Sky hero: clouds, plane, years timeline */
.sky-wrap {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
}
.sky {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 560px;
  overflow: hidden;
  background: #73aed9;
  flex-shrink: 0;
  perspective: 1200px;
}
.sky::before {
  content: '';
  position: absolute;
  inset: -8%;
  background: url('assets/bg.png') center/cover no-repeat;
  z-index: 0;
  transform:
    translate3d(calc(var(--bgx, 0) * 1px), calc(var(--bgy, 0) * 1px), 0)
    rotateY(calc(var(--rx, 0) * 1deg))
    rotateX(calc(var(--ry, 0) * 1deg));
  transform-origin: 50% 50%;
  transition: transform 1.6s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
  pointer-events: none;
}

.sky__clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  transition: transform 1.2s cubic-bezier(.2,.7,.3,1);
  will-change: transform;
}
.sky__clouds--back  {
  z-index: 1;
  transform:
    rotateY(calc(var(--rx, 0) * 0.5deg))
    rotateX(calc(var(--ry, 0) * 0.5deg));
  transform-origin: 50% 50%;
}
.sky__clouds--front {
  z-index: 4;
  transform:
    rotateY(calc(var(--rx, 0) * 0.8deg))
    rotateX(calc(var(--ry, 0) * 0.8deg));
  transform-origin: 50% 50%;
}

.cloud {
  position: absolute;
  height: auto;
  will-change: transform;
  left: 0;
}

/* Back clouds: smaller, softer, drift slower — feel distant */
.c-back {
  width: 38%;
  opacity: 0.75;
  filter: blur(1px);
}
.c-a { top: 18%;  animation: cloudFly 55s linear infinite;          animation-delay: -5s; }
.c-b { top: 42%;  animation: cloudFly 70s linear infinite;          animation-delay: -32s; transform: scale(0.7); opacity: 0.6; }
.c-c { top: 8%;   animation: cloudFly 80s linear infinite;          animation-delay: -55s; transform: scale(0.55); opacity: 0.55; filter: blur(2px); }
.c-d { top: 58%;  animation: cloudFly 62s linear infinite;          animation-delay: -18s; transform: scale(0.8); opacity: 0.7; }

/* Front clouds: bigger, sharper, move faster — feel like you're flying through */
.c-front {
  width: 55%;
  opacity: 0.92;
}
.c-e { top: 55%;  animation: cloudFly 22s linear infinite;          animation-delay: -4s; transform: scale(1.1); }
.c-f { top: 72%;  animation: cloudFly 18s linear infinite;          animation-delay: -12s; transform: scale(1.3); opacity: 0.95; }
.c-g { top: 30%;  animation: cloudFly 28s linear infinite;          animation-delay: -20s; transform: scale(0.9); opacity: 0.8; }

@keyframes cloudFly {
  0%   { transform: translateX(110vw) scale(var(--s, 1)); }
  100% { transform: translateX(-120%) scale(var(--s, 1)); }
}

/* Per-cloud scale preserved through CSS variable so transform can hold translate */
.c-b { --s: 0.7; }
.c-c { --s: 0.55; }
.c-d { --s: 0.8; }
.c-e { --s: 1.1; }
.c-f { --s: 1.3; }
.c-g { --s: 0.9; }
.c-a { --s: 1; }

.sky__plane {
  position: absolute;
  top: 62%;
  left: 50%;
  width: 60%;
  max-width: 720px;
  transform: translate(-50%, -50%);
  transition: opacity .35s ease, transform .35s ease;
  z-index: 3;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.18));
}
.sky__plane img {
  width: 100%;
  height: auto;
  display: block;
  animation: planeFly 8s ease-in-out infinite;
  transform-origin: 50% 60%;
}
.sky__plane.is-swap { opacity: 0; transform: translate(-50%, -50%) translateX(40px); }

.sky__trail {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.puff {
  position: absolute;
  width: 60px;
  height: 60px;
  margin-left: -30px;
  margin-top: -30px;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.08) 45%, rgba(255,255,255,0) 72%);
  border-radius: 50%;
  filter: blur(4px);
  animation: puffOut 2.6s ease-out forwards;
  will-change: transform, opacity;
}
@keyframes puffOut {
  0%   { transform: scale(0.4) translateY(0);     opacity: 0; }
  15%  {                                          opacity: 0.22; }
  60%  {                                          opacity: 0.18; }
  100% { transform: scale(2.4) translateY(-18px); opacity: 0; }
}

.sky__transition {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 110%;
  width: 140%;
  z-index: 6;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sky__transition img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: cover;
  filter: drop-shadow(0 4px 20px rgba(255,255,255,0.6));
}
.sky__transition.is-sweep {
  animation: cloudSweep 1.3s cubic-bezier(.55,.1,.45,.9) forwards;
}
.sky__transition.is-reset { left: 110%; }

@keyframes cloudSweep {
  0%   { left: 110%; }
  100% { left: -150%; }
}

@keyframes planeFly {
  0%   { transform: translateY(0)    rotate(-0.6deg); }
  25%  { transform: translateY(-10px) rotate(0.5deg); }
  50%  { transform: translateY(3px)  rotate(0.9deg); }
  75%  { transform: translateY(-5px) rotate(-0.3deg); }
  100% { transform: translateY(0)    rotate(-0.6deg); }
}

.timeline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  padding: 0 5%;
  z-index: 8;
}
/* .timeline is positioned relative to .sky-wrap on desktop */
.timeline__line {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 18px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.timeline__line::before,
.timeline__line::after,
.timeline__line > span { display: block; width: 100%; }
.timeline__line {
  background:
    linear-gradient(
      var(--green-light) 0,        var(--green-light) 20%,
      var(--green-deep)  20%,      var(--green-deep)  40%,
      var(--white)       40%,      var(--white)       50%,
      var(--blue-dark)   50%,      var(--blue-dark)   70%,
      var(--blue-light)  70%,      var(--blue-light)  100%
    );
}
.timeline__years {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.year {
  appearance: none;
  border: 4px solid #fff;
  background: var(--green-deep);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
  position: relative;
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}
.year span { display: inline-block; line-height: 1; }

/* Cycle brand palette across the circles */
.timeline__years li:nth-child(5n+1) .year { background: var(--green-light); }
.timeline__years li:nth-child(5n+2) .year { background: var(--green-deep); }
.timeline__years li:nth-child(5n+3) .year { background: var(--blue-dark); }
.timeline__years li:nth-child(5n+4) .year { background: var(--blue-light); }
.timeline__years li:nth-child(5n+5) .year { background: var(--green-deep); }

.year:hover { transform: translateY(-4px) scale(1.08); }
.year.is-active {
  background: #fff !important;
  color: var(--blue-dark);
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

@media (max-width: 1024px) {
  .sky { height: 50vh; min-height: 360px; }
  .sky__plane { width: 70%; }
  .year { width: 48px; height: 48px; font-size: 11px; border-width: 3px; }
}

@media (max-width: 640px) {
  .sky { height: 85vh; min-height: 600px; }
  .sky__plane { width: 68%; top: 58%; left: 42%; max-width: none; }

  /* Vertical timeline: colored line flush to the right edge, circles hang left */
  .timeline {
    position: absolute;
    top: 90px;
    bottom: 30px;
    right: 0;
    left: auto;
    width: 52px;
    padding: 0;
    z-index: 8;
  }
  .timeline__line { display: none; }
  .timeline__years {
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    height: 100%;
    gap: 0;
  }
  .year {
    width: 44px;
    height: 44px;
    font-size: 10px;
    border-width: 3px;
    margin-right: -8px;
  }
  .year.is-active { transform: scale(1.18); }
}

.grid {
  display: grid;
  gap: var(--gap);
  min-height: 0;
}

.grid--five   { grid-template-columns: repeat(5, 1fr); }
.grid--bottom { grid-template-columns: repeat(4, 1fr); }
.grid--five .card__art { aspect-ratio: 2 / 3; }

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--white);
  min-height: 0;
}

.card__art {
  width: 100%;
  border-radius: var(--radius);
  background-color: transparent;
  background-image: var(--bg);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform .25s ease;
}

.card__art--wide {
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: contain;
}

.card:hover .card__art {
  transform: translateY(-4px);
}

.card.is-disabled {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.35;
}
.card.is-disabled .card__art {
  filter: grayscale(0.75) brightness(0.85);
}

.card__label {
  padding: 12px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  line-height: 1.25;
}

.card__label .ar {
  font-family: 'Saudia Sans', sans-serif;
  font-weight: 500;
  font-size: clamp(15px, 1.25vw, 19px);
  direction: rtl;
}

.card__label .en {
  font-family: 'Saudia Sans', sans-serif;
  font-weight: 500;
  font-size: clamp(12px, 1vw, 15px);
  opacity: .92;
}

.site-footer {
  margin-top: 28px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: var(--green-bg);
}
.footer-strip {
  display: flex;
  flex-direction: column;
  width: 100%;
  opacity: 0.55;
}
.footer-strip span { width: 100%; height: 5px; display: block; }
.footer-strip .s-light      { background: var(--green-light); }
.footer-strip .s-dark       { background: var(--green-deep); }
.footer-strip .s-white      { background: var(--white); height: 2px; }
.footer-strip .s-blue-dark  { background: var(--blue-dark); }
.footer-strip .s-blue-light { background: var(--blue-light); }
.site-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer__logo {
  width: 54px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.92;
}
.site-footer__copy {
  color: #fff;
  opacity: 0.75;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.social {
  list-style: none;
  display: flex;
  gap: 14px;
  align-items: center;
}
.social a {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  opacity: 0.78;
  transition: opacity .2s ease, transform .2s ease, background .2s ease;
  background: rgba(255,255,255,0.06);
}
.social a:hover { opacity: 1; transform: translateY(-2px); background: rgba(255,255,255,0.14); }
.social svg { width: 16px; height: 16px; fill: currentColor; }

/* Mobile-only scroll-down indicator */
.sky__scroll { display: none; }

@media (max-width: 640px) {
  .sky__scroll {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    color: var(--blue-dark);
    z-index: 9;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    animation: scrollBounce 1.8s ease-in-out infinite;
  }
  .sky__scroll svg { width: 22px; height: 22px; }
}
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}

@media (max-width: 640px) {
  .site-footer__inner {
    padding: 18px 16px;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
  }
  .site-footer__logo { width: 40px; }
  .site-footer__copy { font-size: 11px; order: 3; }
  .social { order: 2; flex-wrap: wrap; justify-content: center; gap: 10px; }
  .social a { width: 32px; height: 32px; }
  .social svg { width: 14px; height: 14px; }
}

/* Tales: video + bilingual title */
.tales {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
}
.tales__video {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  width: 100%;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.tales__video video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.tales__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: clamp(64px, 8vw, 96px);
  height: clamp(64px, 8vw, 96px);
  border-radius: 50%;
  border: 0;
  background: var(--green-light, #6abf4b);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transition: transform .15s ease, background .15s ease;
}
.tales__play svg { width: 42%; height: 42%; margin-left: 6%; }
.tales__play:hover { transform: scale(1.05); background: #7fd35e; }
.tales__video.is-playing .tales__play { display: none; }
.tales__title {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 0;
}
.tales__title img {
  display: block;
  width: auto;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

/* Tablet & smaller */
@media (max-width: 1024px) {
  .grid--five   { grid-template-columns: repeat(3, 1fr); }
  .grid--bottom { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 640px) {
  :root { --gap: 12px; --radius: 16px; }
  .grid--five   { grid-template-columns: repeat(2, 1fr); }
  .grid--five > :last-child { grid-column: 1 / -1; }
  .grid--five > :last-child .card__art { aspect-ratio: 16 / 7; }
  .grid--bottom { grid-template-columns: 1fr; }
  .card__art--wide { aspect-ratio: 3 / 2; }
  .page { padding: 18px 12px 24px; gap: 16px; }
  .card__label { padding: 8px 4px 0; }
  .card__label .ar { font-size: 15px; }
  .card__label .en { font-size: 12px; }
  .tales { gap: 12px; }
  .tales__title img { max-height: 160px; }
  .tales__play { width: 44px; height: 44px; }
}

/* Anthem chooser modal */
button.card {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: inherit;
  padding: 0;
}

body.anthem-open { overflow: hidden; }

.anthem-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 20px;
}
.anthem-modal[hidden] { display: none; }

.anthem-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 25, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .22s ease;
}
.anthem-modal.is-open .anthem-modal__backdrop { opacity: 1; }

.anthem-modal__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: linear-gradient(180deg, #0a4023 0%, #0d311b 100%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  color: var(--white);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: opacity .22s ease, transform .22s ease;
}
.anthem-modal.is-open .anthem-modal__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.anthem-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}
.anthem-modal__close:hover { background: rgba(255,255,255,0.18); }

.anthem-modal__title {
  font-family: 'Saudia Sans', sans-serif;
  font-weight: 500;
  font-size: 20px;
  text-align: center;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.anthem-modal__title .ar { font-size: 22px; }
.anthem-modal__title .en { font-size: 14px; opacity: 0.85; }

.anthem-option {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.anthem-option + .anthem-option { margin-top: 12px; }

.anthem-option__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.anthem-option__head .ar { font-size: 16px; font-weight: 500; }
.anthem-option__head .en { font-size: 12px; opacity: 0.8; }

.anthem-option audio {
  width: 100%;
  filter: invert(0.92) hue-rotate(180deg);
  border-radius: 8px;
}

.anthem-option__dl {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--green-light);
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .15s ease, background .2s ease;
}
.anthem-option__dl:hover { background: #7fd05f; transform: translateY(-1px); }
.anthem-option__dl .ar { font-family: 'Saudia Sans', sans-serif; }
.anthem-option__dl .en { opacity: 0.85; }

@media (max-width: 640px) {
  .anthem-modal__panel { padding: 22px 16px 18px; }
  .anthem-modal__title { font-size: 18px; }
}

/* Discover Booklets — small floating CTA */
.booklets-cta {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(13, 49, 27, 0.7);
  color: var(--white);
  text-decoration: none;
  border: 1px solid rgba(106, 191, 75, 0.4);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
  line-height: 1;
}
.booklets-cta:hover {
  background: rgba(106, 191, 75, 1);
  border-color: rgba(106, 191, 75, 1);
  color: var(--blue-dark);
}
.booklets-cta__icon { display: inline-flex; }
.booklets-cta__icon svg { width: 14px; height: 14px; }
.booklets-cta__label {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
  gap: 2px;
}
.booklets-cta__label .ar { font-size: 11px; font-weight: 500; }
.booklets-cta__label .en { font-size: 8px; opacity: 0.8; letter-spacing: 0.12em; text-transform: uppercase; }
@media (max-width: 640px) {
  .booklets-cta { top: 10px; right: 10px; padding: 5px 9px; gap: 4px; }
  .booklets-cta__icon svg { width: 12px; height: 12px; }
  .booklets-cta__label .ar { font-size: 10px; }
  .booklets-cta__label .en { display: none; }
}
