/* Generated by src/build.js (rtlcss) from css/components/home-hero.css — LTR version, do not edit: edit css/components/home-hero.css and rebuild */
/* ==========================================================================
   home-hero.css — home page hero: title, two jump buttons, ring decoration
   and the 7-book carousel (positions driven by data-pos, see home-hero.js).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wrapper — shares one background with the sticky header: it is pulled up
   under the header bar and pads its content back down.
   -------------------------------------------------------------------------- */
.hero-wrap {
  position: relative;
  margin-top: -88px;
  padding-top: 88px;
  background: linear-gradient(-180deg, var(--color-cream-200) 0%, var(--color-sky-50) 100%);
}

.hero {
  position: relative;
  overflow-x: clip;
}

/* Soft calligraphy ornament at the section's edge */
.hero__ornament {
  position: absolute;
  bottom: -40px;
  right: -90px;
  width: 460px;
  height: auto;
  opacity: 0.06;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 30%, transparent 100%);
}

.hero__grid {
  position: relative;
  max-width: calc(var(--cw, 1180px) - 60px);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 16px;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Text column
   -------------------------------------------------------------------------- */
.hero__text {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero__title {
  margin: 0;
  font-family: 'Almarai', 'Cairo', sans-serif;
  font-weight: 800;
  font-size: clamp(38px, 4.8vw, 64px);
  line-height: 1.25;
  color: var(--color-navy-700);
}

.hero__title-accent {
  color: var(--color-blue-500);
}

.hero__lead {
  margin: 0;
  font-size: 21px;
  line-height: 1.9;
  color: var(--color-ink-600);
}

/* --------------------------------------------------------------------------
   Text motion (off for reduced motion)
   - On load: the title's first line, its second line, the lead, then each
     button rise into place one after the other, with the site's entrance
     curve (as js/core/reveal.js), while the books fan out.
   - On scroll: js/components/home-hero.js sets --hero-p, 0 at the top → 1
     once most of the hero has scrolled away. The text fades a little and its
     parts drift up in the same order — line, line, lead, buttons — and come
     back that way when scrolling up. ("translate" for the drift, "transform"
     for the entrance: the two never fight.)
   -------------------------------------------------------------------------- */
.hero__line {
  display: block; /* one block per title line, so each can move on its own */
}

.hero__line,
.hero__lead,
.hero__btn {
  animation: hero-text-in .8s cubic-bezier(.22, .61, .36, 1) backwards;
}

.hero__line + .hero__line {
  animation-delay: .1s;
}

.hero__lead {
  animation-delay: .2s;
}

.hero__btn {
  animation-delay: .32s;
}

.hero__btn + .hero__btn {
  animation-delay: .4s;
}

@keyframes hero-text-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

.hero__text {
  --hero-p: 0;
  opacity: calc(1 - var(--hero-p) * .5);
}

.hero__line {
  translate: 0 calc(clamp(0, var(--hero-p) / .76, 1) * -48px);
}

.hero__line + .hero__line {
  translate: 0 calc(clamp(0, (var(--hero-p) - .08) / .76, 1) * -48px);
}

.hero__lead {
  translate: 0 calc(clamp(0, (var(--hero-p) - .16) / .76, 1) * -48px);
}

.hero__btns {
  translate: 0 calc(clamp(0, (var(--hero-p) - .24) / .76, 1) * -48px);
}

@media (prefers-reduced-motion: reduce) {
  .hero__line,
  .hero__lead,
  .hero__btn {
    animation: none;
  }

  .hero__line,
  .hero__lead,
  .hero__btns {
    translate: none;
  }

  .hero__text {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Jump buttons (smooth-scroll to the materials / guidance sections)
   -------------------------------------------------------------------------- */
.hero__btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero__btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  height: 52px;
  box-sizing: border-box;
  padding: 0 24px;
  border-radius: 999px;
  border: 2px solid var(--color-blue-500);
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.hero__btn svg {
  display: inline-block;
  flex: none;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .2s ease, transform .25s ease;
}

/* Primary (filled) */
.hero__btn--primary {
  padding: 0 28px;
  background: var(--color-blue-500);
  color: var(--color-white);
  box-shadow: 0 14px 30px -14px rgba(59, 117, 150, 0.8);
}

.hero__btn--primary:hover {
  background: var(--color-cream-300);
  color: var(--color-navy-700);
  border-color: var(--color-blue-300);
}

/* Outline */
.hero__btn--outline {
  background: transparent;
  color: var(--color-blue-500);
}

.hero__btn--outline:hover {
  background: var(--color-blue-500);
  color: var(--color-white);
}

/* --------------------------------------------------------------------------
   Visual column: rings + book stage
   -------------------------------------------------------------------------- */
.hero__vis {
  position: relative;
  height: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero__ring {
  position: absolute;
  border-radius: 50%;
}

.hero__ring--a {
  width: 518px;
  height: 518px;
  border: 1px dashed rgba(59, 117, 150, 0.2);
  animation: hero-ring-in 1.2s ease backwards, hero-ring-spin 90s linear infinite;
}

.hero__ring--b {
  width: 394px;
  height: 394px;
  border: 1px dashed rgba(59, 117, 150, 0.26);
  animation: hero-ring-in 1.2s ease backwards, hero-ring-spin 70s linear infinite reverse;
}

.hero__ring--c {
  width: 288px;
  height: 288px;
  background: radial-gradient(circle, rgba(59, 117, 150, 0.22), rgba(59, 117, 150, 0) 70%);
}

.hero__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --------------------------------------------------------------------------
   Book carousel — every book sits at the centre; data-pos moves it
   -------------------------------------------------------------------------- */
.hero__books {
  position: relative;
  width: 516px;
  max-width: 100%;
  height: 295px;
}

.hero__book {
  position: absolute;
  right: 50%;
  bottom: 0;
  width: 208px;
  margin-right: -104px;
  transform-origin: 50% 100%;
  transition: transform .9s cubic-bezier(.22, .8, .24, 1), opacity .6s ease, filter .9s ease;
  /* entrance: books fan out from the centre on load */
  animation: hero-book-in .8s cubic-bezier(.22, .8, .24, 1) backwards;
}

.hero__book--in-r {
  animation-name: hero-book-in-r;
  animation-delay: .06s;
}

.hero__book--in-l {
  animation-name: hero-book-in-l;
  animation-delay: .06s;
}

.hero__book img {
  display: block;
  width: 208px;
  height: auto;
  border-radius: 6px 3px 3px 6px;
  box-shadow: 0 26px 50px -22px rgba(26, 43, 69, 0.6), 0 0 0 1px rgba(26, 43, 69, 0.06);
}

/* Positions by distance from the current slide */
.hero__book[data-pos="0"] {
  transform: translateX(0) scale(1);
  z-index: 5;
  filter: none;
  opacity: 1;
}

.hero__book[data-pos="1"],
.hero__book[data-pos="-1"] {
  z-index: 4;
  filter: brightness(0.97);
  opacity: 1;
}

.hero__book[data-pos="1"]  { transform: translateX(-154px) scale(0.775); }
.hero__book[data-pos="-1"] { transform: translateX(154px) scale(0.775); }

.hero__book[data-pos="2"],
.hero__book[data-pos="-2"] {
  z-index: 1;
  filter: brightness(0.95);
  opacity: 0;
}

.hero__book[data-pos="2"]  { transform: translateX(-180px) scale(0.6); }
.hero__book[data-pos="-2"] { transform: translateX(180px) scale(0.6); }

.hero__book[data-pos="3"],
.hero__book[data-pos="-3"] {
  z-index: 0;
  filter: none;
  opacity: 0;
}

.hero__book[data-pos="3"]  { transform: translateX(-72px) scale(0.5); }
.hero__book[data-pos="-3"] { transform: translateX(72px) scale(0.5); }

/* Shelf under the books */
.hero__shelf {
  display: block;
  width: 442px;
  max-width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(-180deg, var(--color-white) 0%, var(--color-mist-200) 100%);
  border: 1px solid var(--color-line);
  box-shadow: 0 16px 28px -14px rgba(26, 43, 69, 0.35);
}

.hero__shelf-shadow {
  display: block;
  width: 384px;
  max-width: 100%;
  height: 26px;
  margin-top: 4px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(26, 43, 69, 0.16), rgba(26, 43, 69, 0) 70%);
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes hero-ring-in {
  from { opacity: 0; }
}

@keyframes hero-ring-spin {
  to { transform: rotate(-360deg); }
}

@keyframes hero-book-in {
  from { opacity: 0; transform: translateX(0) translateY(10px) scale(.92); }
}

@keyframes hero-book-in-r {
  from { opacity: 0; transform: translateX(-116px) translateY(10px) scale(.74); }
}

@keyframes hero-book-in-l {
  from { opacity: 0; transform: translateX(116px) translateY(10px) scale(.74); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__ring--a,
  .hero__ring--b,
  .hero__book {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 903px) {
  .hero__grid {
    padding-top: 44px;
    gap: 0;
  }

  .hero__text {
    align-items: center;
    text-align: center;
    gap: 18px;
  }

  .hero__btns {
    justify-content: center;
  }

  /* stacked under the text: a little room between the buttons (and the
     main button's shadow) and the outer ring, which fills this box's height */
  .hero__vis {
    height: 420px;
    margin-top: 24px;
  }

  .hero__stage {
    transform: scale(.8);
  }

  .hero__ring--a {
    width: 420px;
    height: 420px;
  }

  .hero__ring--b {
    width: 320px;
    height: 320px;
  }

  .hero__ring--c {
    width: 240px;
    height: 240px;
  }
}

@media (max-width: 560px) {
  .hero__grid {
    padding-top: 28px;
  }

  .hero__lead {
    font-size: 18px;
  }

  .hero__vis {
    height: 300px;
  }

  .hero__stage {
    transform: scale(.6);
  }

  .hero__ring--a {
    width: 300px;
    height: 300px;
  }

  .hero__ring--b {
    width: 230px;
    height: 230px;
  }

  .hero__ring--c {
    width: 170px;
    height: 170px;
  }
}

/* Phones: both buttons share one row */
@media (max-width: 480px) {
  .hero__btns {
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
  }

  .hero__btn,
  .hero__btn--primary {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    height: 48px;
    padding: 0 10px;
    gap: 6px;
    font-size: 14.5px;
    white-space: nowrap;
  }
}

@media (max-width: 360px) {
  .hero__btns {
    gap: 6px;
  }

  .hero__btn,
  .hero__btn--primary {
    font-size: 12px;
    height: 44px;
    padding: 0 8px;
    gap: 4px;
  }

  .hero__btn svg {
    width: 14px;
    height: 14px;
  }
}
