/* ==================================================================
   JISETF — home page

   Sections in page order. Everything shared with other pages lives in
   base.css; nothing here is needed by any other page.
   ================================================================== */

/* ---------- hero ------------------------------------------------ */
.hero { padding: clamp(40px, 6vw, 92px) var(--gutter) clamp(28px, 4vw, 52px); }

.hero__grid {
    width: min(var(--wrap), 100%);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
}

.hero__copy { display: flex; flex-direction: column; gap: 18px; }

.hero__title {
    font-size: var(--text-3xl);
    font-weight: 900;
    /* loose enough that the marker band under "العالمية" clears the line above */
    line-height: 1.16;
    text-wrap: balance;
}
/* A marker sweep behind the word, rather than a change of colour: the
   band is drawn slightly off-square and off-level, so it reads as
   something struck through the line by hand. */
.hero__title em {
    font-style: normal;
    color: var(--ink);
    position: relative;
    white-space: nowrap;
    /* inline-block so the band can be measured against the line box rather
       than against the font's full ascent-to-descent slab, which for Cairo
       is half again as tall as the letters themselves */
    display: inline-block;
}
.hero__title em::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0.2em -0.09em 0.1em -0.07em;
    background: var(--gold);
    border-radius: 4px 26px 6px 22px;
    transform: rotate(-1.2deg);
    /* drawn on, from the side the line is read from */
    transform-origin: right center;
    animation: mark-draw 0.62s var(--ease) 0.25s both;
}

@keyframes mark-draw {
    from { transform: rotate(-1.2deg) scaleX(0); }
    to   { transform: rotate(-1.2deg) scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
    .hero__title em::before { animation: none; }
}

.hero__lede {
    font-size: var(--text-lg);
    line-height: 1.6;
    max-width: var(--measure);
}
.hero__note { color: var(--slate); max-width: var(--measure); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }

.hero__media { position: relative; }
.hero__photo { width: 100%; height: auto; }

/* ---- the three marks --------------------------------------------
   Taken from the identity's own set rather than drawn as plain
   squares, and each given the motion its subject would have: the cog
   turns, the atom's shell drifts around its nucleus, the star pulses.
   All three are slow and small — presence, not a performance. */
.marks {
    position: absolute;
    /* hung off the corner rather than laid over the picture */
    inset-block-end: clamp(-34px, -2vw, -20px);
    inset-inline-start: clamp(-18px, -1vw, -6px);
    display: flex;
    align-items: flex-end;
    gap: clamp(10px, 1.2vw, 18px);
}
.mark-chip {
    display: grid;
    place-items: center;
    width: clamp(46px, 4.4vw, 62px);
    height: clamp(46px, 4.4vw, 62px);
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 6px 20px rgba(21, 87, 137, 0.14);
}
.mark-chip svg {
    width: 54%;
    height: auto;
    /* the spin and the bob live on the drawing, so the disc stays put */
    transform-origin: 50% 50%;
}
.mark-chip--cog   { color: var(--blue); }
.mark-chip--orbit { color: var(--green); }
.mark-chip--star  { color: var(--gold); }

.mark-chip--cog   svg { animation: mark-turn 14s linear infinite; }
.mark-chip--orbit svg { animation: mark-drift 5.5s ease-in-out infinite; }
.mark-chip--star  svg { animation: mark-pulse 3.6s ease-in-out infinite; }

@keyframes mark-turn {
    to { transform: rotate(360deg); }
}
@keyframes mark-drift {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-4px) rotate(-12deg); }
}
@keyframes mark-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.14) rotate(18deg); }
}

/* they arrive one after another once the hero has settled */
.js .marks .mark-chip {
    opacity: 0;
    transform: translateY(14px) scale(0.7);
    animation: mark-land 0.55s var(--ease) forwards;
}
.js .marks .mark-chip:nth-child(1) { animation-delay: 0.45s; }
.js .marks .mark-chip:nth-child(2) { animation-delay: 0.58s; }
.js .marks .mark-chip:nth-child(3) { animation-delay: 0.71s; }

@keyframes mark-land {
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .mark-chip svg { animation: none; }
    .js .marks .mark-chip { opacity: 1; transform: none; animation: none; }
}

/* Two claims, not one list: who runs it with us on one side, what it
   qualifies you for on the other, with a rule between them. */
.partners {
    width: min(var(--wrap), 100%);
    margin: clamp(34px, 5vw, 62px) auto 0;
    padding-top: 26px;
    border-top: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(24px, 4vw, 56px);
    flex-wrap: wrap;
}
.partners__group {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 26px);
    flex-wrap: wrap;
}
.partners__group--affil {
    padding-inline-start: clamp(20px, 3vw, 44px);
    border-inline-start: 1px solid var(--hairline);
}
.partners__list { display: flex; align-items: center; gap: clamp(20px, 4vw, 52px); flex-wrap: wrap; }
/* a round seal reads smaller than a horizontal wordmark at the same
   height, so the row is set a little taller than a wordmark needs */
.partners__list img { height: clamp(54px, 5.8vw, 74px); width: auto; }
.partners__isef { height: clamp(60px, 6.2vw, 82px); width: auto; }

@media (max-width: 760px) {
    /* stacked, the rule between them turns and runs across */
    .partners__group--affil {
        padding-inline-start: 0;
        border-inline-start: 0;
        padding-top: 20px;
        border-top: 1px solid var(--hairline);
        width: 100%;
    }
}

/* ---------- about ----------------------------------------------- */
.about__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
    gap: clamp(30px, 5vw, 76px);
    align-items: center;
}
.about__copy { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.about__copy p {
    max-width: var(--measure);
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--text-md);
}
.about__copy .btn { margin-top: 8px; }
.about__media { aspect-ratio: 1 / 1; background: transparent; }

.mark { color: var(--gold); font-weight: 700; white-space: nowrap; }

/* ---------- who can enter --------------------------------------- */
.who__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
}
.who__title {
    font-size: var(--text-3xl);
    font-weight: 900;
    /* two lines of Arabic display type: tight enough to read as one block,
       loose enough that the ascenders clear the line above */
    line-height: 1.22;
}
.who__body { display: flex; flex-direction: column; gap: 26px; align-items: flex-start; }
.who__lede { font-size: var(--text-lg); line-height: 1.55; max-width: 34ch; }

/* the three qualifying facts, as one ruled object */
.facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    width: 100%;
    background: rgba(255, 255, 255, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.28);
}
.fact { background: var(--green); padding: 18px 20px; }
.fact dt {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.78);
}
.fact dd {
    margin-top: 4px;
    font-size: var(--text-xl);
    font-weight: 800;
    line-height: 1.15;
}
/* A value that is words rather than a figure sets two sizes down, so it
   stays on one line in a cell built for a number. Written against the
   element as well as the class, or the rule above out-specifies it. */
.fact dd.fact__long {
    /* tracks the cell rather than the page: the three cells are thirds of a
       column that narrows fast between 900 and 1280 */
    font-size: clamp(14px, 1.6vw, 20px);
    line-height: 1.3;
}
.fact__sub {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.5;
    opacity: 0.85;
}

/* ---------- why JISETF ------------------------------------------ */
.why__head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: clamp(30px, 4vw, 54px);
}
.why__sub { font-size: var(--text-lg); color: rgba(49, 49, 49, 0.8); max-width: 44ch; }

/* six reasons, so three columns fill two rows exactly */
.reasons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 1.6vw, 22px);
}
.reason {
    background: var(--white);
    padding: clamp(24px, 2.4vw, 34px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: var(--card-radius) 0 var(--card-radius) 0;
}
/* alternating the rounded corners keeps the tile motif reading as a field
   rather than as six identical cards */
.reason:nth-child(even) { border-radius: 0 var(--card-radius) 0 var(--card-radius); }
/* the icons are a quiet watermark on each card, not a second headline */
.reason img { width: 46px; height: 46px; object-fit: contain; opacity: 0.2; }
.reason h3 { font-size: var(--text-md); font-weight: 800; color: #001f3d; }
.reason p { font-size: var(--text-sm); line-height: 1.72; color: rgba(0, 0, 51, 0.78); }

/* ---------- where it can take you ------------------------------- */
.global { position: relative; }
.global > .wrap { position: relative; }
.global__head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: clamp(30px, 4vw, 54px);
}
.global__sub { color: var(--slate); font-size: var(--text-md); max-width: 58ch; }

/* ---- the map -----------------------------------------------------
   The same dotted world the old page carried, rebuilt from 612 KB of
   bezier circles into 72 KB of round line caps, with a pin on every
   fair. Pointing at a pin lights its card and the other way round. */
.atlas { margin-bottom: clamp(26px, 3.4vw, 44px); }

.atlas__map {
    position: relative;
    width: 100%;
    aspect-ratio: 1321 / 585;
}
.atlas__world {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.45;
}

.pin {
    position: absolute;
    /* the dot marks the place; the box grows upward and centred from it */
    left: var(--x);
    top: var(--y);
    transform: translate(-50%, -100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: 0;
}
.pin__dot {
    position: relative;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
    transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
/* two staggered rings, so the pins read as live signal rather than print */
.pin__dot::before,
.pin__dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    opacity: 0;
    animation: pin-pulse 2.4s ease-out infinite;
}
.pin__dot::after { animation-delay: 1.2s; }

@keyframes pin-pulse {
    0%   { transform: scale(1);   opacity: 0.55; }
    70%  { transform: scale(4.5); opacity: 0; }
    100% { transform: scale(1);   opacity: 0; }
}

.pin__label {
    max-width: 40vw;
    padding: 5px 11px;
    background: var(--white);
    border: 1px solid rgba(21, 87, 137, 0.14);
    border-radius: 3px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    color: var(--blue);
    /* held back until the pin or its card is pointed at */
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
    pointer-events: none;
}

.pin--home .pin__dot { background: var(--gold); }
.pin--home .pin__label {
    opacity: 1;
    transform: none;
    background: var(--gold);
    border-color: var(--gold);
    color: var(--ink);
}

/* the one being pointed at rides above its neighbours' labels */
.pin:hover,
.pin:focus-visible,
.pin.is-active { z-index: 3; }
.pin:hover .pin__label,
.pin:focus-visible .pin__label,
.pin.is-active .pin__label { opacity: 1; transform: none; }
.pin:hover .pin__dot,
.pin:focus-visible .pin__dot,
.pin.is-active .pin__dot { background: var(--blue); transform: scale(1.35); }

/* Eleven fairs, and the one they all lead to takes two places — so
   twelve cells, which fill four columns in three rows exactly, and
   three columns in four rows exactly. */
.fairs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(12px, 1.4vw, 18px);
}
.fair--lead { grid-column: span 2; }
.fair {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--white);
    border: 1px solid rgba(21, 87, 137, 0.12);
}
.fair img { width: 46px; height: 46px; object-fit: contain; flex: none; }
.fair__text { display: flex; flex-direction: column; min-width: 0; }
.fair__name { font-weight: 700; font-size: 14.5px; line-height: 1.4; }
.fair__place { font-size: 13px; color: var(--slate); }
/* the fair this whole programme qualifies you for */
.fair--lead { background: var(--blue); border-color: var(--blue); }
.fair--lead .fair__name { color: var(--white); font-size: var(--text-md); }
.fair--lead .fair__place { color: rgba(255, 255, 255, 0.76); }
.fair--lead img { background: var(--white); padding: 6px; }

.fair { transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.fair.is-active {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px var(--blue);
}

/* ---------- the timeline ---------------------------------------- */
/* The rail runs down one side and leaves the far corner empty, so a
   single cog sits there at a tenth of its weight — texture, not an
   icon anyone is meant to read. */
.steps { position: relative; overflow: hidden; }
.steps > .wrap { position: relative; z-index: 1; }
.steps__cog {
    position: absolute;
    inset-block-end: clamp(-90px, -6vw, -40px);
    inset-inline-end: clamp(-70px, -4vw, -30px);
    width: clamp(220px, 30vw, 460px);
    height: auto;
    opacity: 0.1;
    /* the file is ink black; on the blue band it has to run white */
    filter: brightness(0) invert(1);
    pointer-events: none;
    /* one turn a minute — slow enough to notice only if you stay */
    animation: steps-cog-turn 60s linear infinite;
}

@keyframes steps-cog-turn {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .steps__cog { animation: none; }
}

.steps__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: clamp(34px, 5vw, 66px);
}
.steps__head .section-title { max-width: 16ch; }

.guide {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 24px;
    background: var(--gold);
    color: var(--ink);
    font-weight: 700;
}
.guide__cta {
    padding: 9px 16px;
    background: var(--white);
    text-align: center;
    font-size: var(--text-sm);
    transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}
.guide:hover .guide__cta { background: var(--ink); color: var(--white); }

.rail {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: clamp(26px, 3.4vw, 44px);
}
/* a track, and a fill that grows as you read */
.rail::before,
.rail::after {
    content: "";
    position: absolute;
    inset-inline-start: 27px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 2px;
}
.rail::before { background: rgba(255, 255, 255, 0.16); }
.rail::after {
    background: var(--gold);
    transform-origin: top;
    transform: scaleY(var(--drawn, 1));
}

.stage {
    position: relative;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: start;
    gap: clamp(14px, 2vw, 26px);
}
.stage__ord {
    position: relative;
    z-index: 2;
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: var(--text-sm);
    font-weight: 700;
    /* lit by default, so the section reads correctly before — and without —
       the scroll script; .is-driven below is what dims them back */
    background: var(--gold);
    border: 4px solid var(--white);
    color: var(--ink);
    transition: background-color 0.3s var(--ease),
                border-color 0.3s var(--ease),
                color 0.3s var(--ease);
}
.rail.is-driven .stage__ord {
    background: var(--blue-deep);
    border-color: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.5);
}
.rail.is-driven .stage.is-reached .stage__ord {
    background: var(--gold);
    border-color: var(--white);
    color: var(--ink);
}

.stage__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 4px;
    max-width: var(--measure);
}
.stage h3 { font-size: var(--text-lg); font-weight: 800; }
.stage p { color: rgba(255, 255, 255, 0.82); font-size: var(--text-md); }
.stage time { color: var(--gold); font-weight: 700; }
.stage--final h3 { color: var(--gold); }

/* ---------- narrower screens ------------------------------------ */
@media (max-width: 1180px) {
    .fairs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    /* still twelve cells, now four rows of three */
    .pin__label { font-size: 11.5px; padding: 4px 9px; }
    /* the three cells are at their narrowest just before they stack, so
       they give the padding back to the words */
    .fact { padding: 16px 13px; }
}

/* Below this the pins sit closer together than a fingertip can separate,
   so the map becomes scenery and the list does the work. */
@media (max-width: 760px) {
    .pin { pointer-events: none; }
    .pin__label { display: none; }
    .pin--home .pin__label { display: block; font-size: 10.5px; padding: 3px 7px; }
    .pin__dot { width: 6px; height: 6px; }
    /* a smaller map wants a smaller ring, or the pulses merge into one blur */
    .pin__dot::before,
    .pin__dot::after { animation-name: pin-pulse-sm; }
    .atlas__world { opacity: 0.35; }
}

@keyframes pin-pulse-sm {
    0%   { transform: scale(1); opacity: 0.5; }
    70%  { transform: scale(2.8); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

@media (max-width: 900px) {
    .hero__grid,
    .about__grid,
    .who__grid { grid-template-columns: minmax(0, 1fr); }
    /* image first on a phone: it carries the message faster than the copy */
    .hero__media,
    .about__media { order: -1; }
    .reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* The rail runs down one side and leaves the far corner empty, so a
   single cog sits there at a tenth of its weight — texture, not an
   icon anyone is meant to read. */
.steps { position: relative; overflow: hidden; }
.steps > .wrap { position: relative; z-index: 1; }
.steps__cog {
    position: absolute;
    inset-block-end: clamp(-90px, -6vw, -40px);
    inset-inline-end: clamp(-70px, -4vw, -30px);
    width: clamp(220px, 30vw, 460px);
    height: auto;
    opacity: 0.1;
    /* the file is ink black; on the blue band it has to run white */
    filter: brightness(0) invert(1);
    pointer-events: none;
    /* one turn a minute — slow enough to notice only if you stay */
    animation: steps-cog-turn 60s linear infinite;
}

@keyframes steps-cog-turn {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .steps__cog { animation: none; }
}

.steps__head { align-items: flex-start; }
}

@media (max-width: 620px) {
    .reasons,
    .fairs { grid-template-columns: minmax(0, 1fr); }
    .fair--lead { grid-column: span 1; }
    .facts { grid-template-columns: minmax(0, 1fr); }
    .stage { grid-template-columns: 46px minmax(0, 1fr); }
    .stage__ord { width: 46px; height: 46px; border-width: 3px; }
    .rail::before,
    .rail::after { inset-inline-start: 21px; }
    .hero__actions .btn,
    .close__actions .btn { flex: 1 1 220px; }
}


/* ==================================================================
   "بالأرقام" — the record of the first edition
   ================================================================== */
.tally { background: var(--white); }

.tally__head {
    display: flex;
    flex-direction: column;
    /* the section title is set tight, so its descenders need the room */
    gap: 16px;
    margin-bottom: clamp(30px, 4vw, 52px);
}
.tally__sub { color: var(--slate); font-size: var(--text-md); max-width: 56ch; }

/* ---- the figures ------------------------------------------------
   Four cells ruled against one another, the same object the "who can
   enter" band uses — so the page reads this as a statement of fact
   rather than as four separate boasts. */
.tally__figures {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--hairline);
    border: 1px solid var(--hairline);
}
.tally__cell {
    /* the number is written second and read first */
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    gap: 4px;
    padding: clamp(22px, 2.6vw, 36px);
    background: var(--white);
}
.tally__cell dt {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--slate);
}
.tally__cell dd {
    font-size: var(--text-2xl);
    font-weight: 900;
    line-height: 1;
    color: var(--blue);
}
/* the last figure is the one the whole programme is for */
.tally__cell--payoff { background: var(--blue); }
.tally__cell--payoff dt { color: rgba(255, 255, 255, 0.78); }
.tally__cell--payoff dd { color: var(--gold); }

.tally__note {
    margin-top: 16px;
    font-size: var(--text-sm);
    color: var(--slate);
}

/* ---- three frames from the edition ------------------------------ */
.tally__shots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(12px, 1.4vw, 20px);
    margin-top: clamp(22px, 3vw, 38px);
}
.tally__frame {
    overflow: hidden;
    border-radius: var(--card-radius) 0 var(--card-radius) 0;
    aspect-ratio: 4 / 3;
    background: var(--paper);
}
.tally__shot:nth-child(even) .tally__frame {
    border-radius: 0 var(--card-radius) 0 var(--card-radius);
}
.tally__frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* the caption says what the frame is evidence of, so the three read as a
   record of the edition rather than as decoration */
.tally__cap {
    margin-top: 10px;
    font-size: var(--text-sm);
    line-height: 1.55;
    color: var(--slate);
}

/* ---- narrower screens ------------------------------------------- */
@media (max-width: 900px) {
    .tally__figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tally__shots { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
    .tally__figures { grid-template-columns: minmax(0, 1fr); }
}
