/* Recap · index · the home page is ONE fixed composition that is scaled (home-fit.js) to always fit the screen, phone or desktop.
   Top: hero card · middle: subjects · bottom: latest activity (left) + revision plan (right) · last: encouragement. */
#start { overflow: hidden !important; }
#start > .content { position: relative; display: block; }
#vw-space { display: block; position: static; padding: 0; }
.home-wrap { --hw: 500px; position: absolute; left: 0; top: 0; width: var(--hw); transform-origin: 0 0; box-sizing: border-box; visibility: hidden; }
.home-wrap.fit { visibility: visible; }
.home-wrap .hm-sec { width: 100%; margin: 15px 0 0; }
.home-wrap .hs-head { margin: 0 2px 10px; }
.home-wrap .hm-h { font-size: 1.55rem; margin-bottom: 0; }

/* hero */
#home-wrap .pi.hs-hero { width: 100%; max-width: none; margin: 70px 0 0; padding: 20px 18px 20px; }
#home-wrap .hs-hero .pi-boy { width: 44%; right: 8%; }
#home-wrap .hs-h1 { font-size: 2.15rem; }
#home-wrap .hs-hi { font-size: 1.6rem; }
#home-wrap .hs-sub { font-size: .85rem; max-width: 26ch; }
#home-wrap .hs-cls { max-width: 100%; margin-top: 12px; }
#home-wrap .hs-motto { padding-top: 26px; } #home-wrap .hs-motto span { font-size: 1.3rem; } #home-wrap .hs-star { width: 32px; }
#home-wrap .hs-hero .me-edit { top: 10px; right: 10px; bottom: auto; left: auto; }

/* subjects: 3 × 2 */
#home-wrap .hm-grid { grid-template-columns: repeat(3, 1fr); gap: 34px 12px; padding-top: 34px; }
#home-wrap .hm-card img { height: 66px; margin-top: -34px; }
#home-wrap .hm-card .lbl { font-size: 1.1rem; }

/* activity + plan: always side by side, same fixed height so nothing jumps */
#home-wrap .hs-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; align-items: start; }
#home-wrap .hs-two .hm-sec { min-width: 0; }
#home-wrap .hs-two .hm-h { font-size: 1.25rem; } #home-wrap .hs-two .hm-h::after { display: none; }
#home-wrap .hs-more { font-size: .9rem; } #home-wrap .hs-more svg { width: 13px; height: 13px; }
#home-wrap .hs-card { height: 258px; padding: 2px 10px; overflow: hidden; rotate: 0deg; }
#home-wrap .hs-plan { display: flex; flex-direction: column; }
#home-wrap .hs-rows { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; } #home-wrap .hs-rows::-webkit-scrollbar { display: none; }
#home-wrap .hs-act { grid-template-columns: 38px minmax(0, 1fr) 14px; gap: 8px; padding: 8px 0; }
#home-wrap .hs-act .ic, #home-wrap .hs-row .ic { width: 38px; height: 38px; } #home-wrap .hs-act .ic img, #home-wrap .hs-row .ic img { height: 28px; }
#home-wrap .hs-act .n { font-size: .82rem; } #home-wrap .hs-act .k { font-size: .72rem; padding: 1px 6px 1px 4px; } #home-wrap .hs-act small { font-size: .66rem; }
#home-wrap .hs-act .m { flex-wrap: wrap; gap: 3px 6px; } #home-wrap .hs-act .chev { width: 14px; height: 14px; }
#home-wrap .hs-days { gap: 1px; padding: 8px 0 6px; } #home-wrap .hs-dt { font-size: .78rem; padding: 6px 0 7px; }
#home-wrap .hs-row { grid-template-columns: 38px minmax(0, 1fr) 26px; gap: 7px; padding: 7px 0; }
#home-wrap .hs-row .nm b { font-size: .95rem; } #home-wrap .hs-row .nm small { font-size: .68rem; white-space: normal; line-height: 1.15; }
#home-wrap .hs-ck { width: 26px; height: 26px; } #home-wrap .hs-ck svg { width: 14px; height: 14px; }
#home-wrap .hs-empty { padding: 14px 4px; } #home-wrap .hs-empty img { height: 44px; }
#home-wrap .hs-prog { padding: 7px 0 8px; } #home-wrap .hs-prog small { font-size: .78rem; }

/* encouragement */
#home-wrap .hs-cheer { margin-top: 32px; padding: 14px 16px 14px; }
#home-wrap .hs-cup { width: 58px; top: -30px; }
#home-wrap .hs-cheer-t { font-size: 1.45rem; } #home-wrap .hs-cheer-s { font-size: .82rem; } #home-wrap .hs-cheer-tag { margin-top: 8px; font-size: .95rem; }

/* ---------- wide screens (landscape): the same composition, wider and shorter ---------- */
.home-wrap.land { --hw: 1080px; }
.land .hm-sec { margin-top: 22px; }
#home-wrap.land .pi.hs-hero { margin-top: 92px; padding: 24px 40px 26px; }
#home-wrap.land .hs-hero .pi-boy { width: 26%; right: 6%; }
#home-wrap.land .hs-h1 { font-size: 2.9rem; } #home-wrap.land .hs-hi { font-size: 1.8rem; } #home-wrap.land .hs-sub { font-size: 1.05rem; max-width: 40ch; }
#home-wrap.land .hs-motto span { font-size: 1.9rem; } #home-wrap.land .hs-star { width: 44px; } #home-wrap.land .hs-cls b { font-size: 1.15rem; }
#home-wrap.land .hm-h { font-size: 1.9rem; } #home-wrap.land .hs-two .hm-h { font-size: 1.7rem; } #home-wrap.land .hs-more { font-size: 1.1rem; }
#home-wrap.land .hm-grid { grid-template-columns: repeat(6, 1fr); gap: 0 18px; padding-top: 48px; }
#home-wrap.land .hm-card img { height: 88px; margin-top: -48px; } #home-wrap.land .hm-card .lbl { font-size: 1.35rem; }
#home-wrap.land .hs-two { gap: 0 28px; }
#home-wrap.land .hs-card { height: 250px; padding: 4px 18px; }
#home-wrap.land .hs-act { grid-template-columns: 44px minmax(0, 1fr) 18px; gap: 12px; padding: 7px 0; }
#home-wrap.land .hs-act .ic, #home-wrap.land .hs-row .ic { width: 44px; height: 44px; } #home-wrap.land .hs-act .ic img, #home-wrap.land .hs-row .ic img { height: 32px; }
#home-wrap.land .hs-act .n { font-size: 1rem; } #home-wrap.land .hs-act .k { font-size: .85rem; } #home-wrap.land .hs-act small { font-size: .8rem; }
#home-wrap.land .hs-dt { font-size: 1.05rem; } #home-wrap.land .hs-row { grid-template-columns: 44px minmax(0, 1fr) 30px; gap: 12px; padding: 6px 0; }
#home-wrap.land .hs-row .nm b { font-size: 1.15rem; } #home-wrap.land .hs-row .nm small { font-size: .85rem; } #home-wrap.land .hs-ck { width: 30px; height: 30px; }
#home-wrap.land .hs-cheer { margin-top: 38px; padding: 14px 22px; } #home-wrap.land .hs-cheer-t { font-size: 1.8rem; } #home-wrap.land .hs-cheer-s { font-size: 1rem; }

/* portrait: the owl of the search button stands on the left of the banner, so the text sits to its right */
#home-wrap:not(.land) .hs-cheer { padding-left: 120px; }

/* Latest activity: scrolls inside its card when there are more rows than fit */
#home-wrap .hs-acts { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink) 30%, transparent) transparent; }
#home-wrap .hs-acts::-webkit-scrollbar { width: 4px; } #home-wrap .hs-acts::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 30%, transparent); border-radius: 4px; }

/* hide the scrollbar of the activity card (it still scrolls) */
#home-wrap .hs-acts { scrollbar-width: none; -ms-overflow-style: none; }
#home-wrap .hs-acts::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ---------- entrance: everything appears one piece after another (hero → subjects → activity / plan → banner) ---------- */
#vw-space > .home-wrap { animation: none !important; }       /* the generic "rise" must not touch the wrapper: it carries the scale transform */
@keyframes hf-in { from { opacity: 0; translate: 0 20px; scale: .93; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes hf-side { from { opacity: 0; translate: -18px 0; } to { opacity: 1; translate: 0 0; } }
#home-wrap.play .hs-hi, #home-wrap.play .hs-h1, #home-wrap.play .hs-sub, #home-wrap.play .hs-cls, #home-wrap.play .hs-motto,
#home-wrap.play .hs-hero .me-edit, #home-wrap.play .hs-head, #home-wrap.play .hm-card, #home-wrap.play .hs-card, #home-wrap.play .hs-cheer,
#home-wrap.play .hs-act { animation: hf-in .62s cubic-bezier(.22, 1, .36, 1) var(--d, 0s) both; }
#home-wrap.play .hs-hi { --d: .45s; animation-name: hf-side; } #home-wrap.play .hs-h1 { --d: .6s; } #home-wrap.play .hs-sub { --d: .78s; }
#home-wrap.play .hs-cls { --d: .95s; } #home-wrap.play .hs-motto { --d: 1.05s; } #home-wrap.play .hs-hero .me-edit { --d: 1.15s; }
#home-wrap.play .hm-subj .hs-head { --d: 1.2s; animation-name: hf-side; }
#home-wrap.play .hm-card { --d: calc(1.35s + var(--i, 0) * .09s); animation-timing-function: cubic-bezier(.3, 1.4, .5, 1); }
#home-wrap.play .hs-two > :nth-child(1) .hs-head { --d: 2s; animation-name: hf-side; } #home-wrap.play .hs-two > :nth-child(2) .hs-head { --d: 2.15s; animation-name: hf-side; }
#home-wrap.play .hs-two > :nth-child(1) .hs-card { --d: 2.05s; } #home-wrap.play .hs-two > :nth-child(2) .hs-card { --d: 2.2s; }
#home-wrap.play .hs-act:nth-child(1) { --d: 2.35s; } #home-wrap.play .hs-act:nth-child(2) { --d: 2.45s; } #home-wrap.play .hs-act:nth-child(3) { --d: 2.55s; }
#home-wrap.play .hs-act:nth-child(n+4) { --d: 2.65s; }
#home-wrap.play .hs-row { animation-delay: calc(2.5s + var(--i, 0) * 90ms); }
#home-wrap.play .hs-cheer { --d: 2.75s; }
@media (prefers-reduced-motion: reduce) { #home-wrap.play * { animation: none !important; } }

/* empty states ("No activity yet" / "Nothing planned today") sit in the vertical middle of their card */
#home-wrap .hs-acts:has(> .hs-empty), #home-wrap .hs-rows:has(> .hs-empty) { display: flex; flex-direction: column; align-items: center; justify-content: center; }
#home-wrap .hs-acts > .hs-empty, #home-wrap .hs-rows > .hs-empty { margin: 0; padding: 6px 4px; width: 100%; }

/* revision plan: the tick circle is replaced by the room (القسم) of each class, in a fixed right-hand column */
#home-wrap .hs-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
#home-wrap.land .hs-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
#home-wrap .hs-room { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 46px; max-width: 76px; padding: 4px 8px 4px 6px; border-radius: 999px; box-sizing: border-box;
  color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1.5px dashed color-mix(in srgb, var(--c) 55%, transparent); line-height: 1; }
#home-wrap .hs-room svg { flex: none; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#home-wrap .hs-room b { font: 700 .74rem/1 var(--font-body, inherit); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#home-wrap .hs-room.none { opacity: .45; }
#home-wrap.land .hs-room { min-width: 60px; max-width: 110px; padding: 5px 11px 5px 8px; } #home-wrap.land .hs-room b { font-size: 1rem; } #home-wrap.land .hs-room svg { width: 15px; height: 15px; }

/* contributors button: hidden and not clickable on the home page (kept in the markup) */
#start [data-contrib-open] { display: none !important; pointer-events: none !important; visibility: hidden !important; }

/* ---------- calmer entrance: the card settles gently, then the boy floats down onto it, then the rest follows ---------- */
@keyframes hf-card { from { opacity: 0; translate: 0 26px; scale: .97; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes hf-boy  { from { opacity: 0; translate: 0 -26px; } to { opacity: 1; translate: 0 0; } }
@keyframes hf-fade { from { opacity: 0; } to { opacity: 1; } }
#home-wrap.play .pi.hs-hero { animation: hf-card 1.6s cubic-bezier(.22, 1, .36, 1) .1s both !important; }
#home-wrap.play .pi.hs-hero .pi-boy img { animation: hf-boy 1.9s cubic-bezier(.22, 1, .36, 1) .85s both !important; }
#home-wrap.play .pi.hs-hero .pi-ground { animation: hf-fade 1.9s ease .85s both !important; }
#home-wrap.play .hs-hi, #home-wrap.play .hs-h1, #home-wrap.play .hs-sub, #home-wrap.play .hs-cls, #home-wrap.play .hs-motto, #home-wrap.play .hs-hero .me-edit,
#home-wrap.play .hs-head, #home-wrap.play .hm-card, #home-wrap.play .hs-card, #home-wrap.play .hs-cheer, #home-wrap.play .hs-act { animation-duration: .95s; animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
#home-wrap.play .hs-hi { --d: 1.05s; } #home-wrap.play .hs-h1 { --d: 1.2s; } #home-wrap.play .hs-sub { --d: 1.4s; }
#home-wrap.play .hs-cls { --d: 1.6s; } #home-wrap.play .hs-motto { --d: 1.75s; } #home-wrap.play .hs-hero .me-edit { --d: 1.85s; }
#home-wrap.play .hm-subj .hs-head { --d: 2s; }
#home-wrap.play .hm-card { --d: calc(2.15s + var(--i, 0) * .11s); animation-timing-function: cubic-bezier(.22, 1, .36, 1); }
#home-wrap.play .hs-two > :nth-child(1) .hs-head { --d: 2.9s; } #home-wrap.play .hs-two > :nth-child(2) .hs-head { --d: 3.05s; }
#home-wrap.play .hs-two > :nth-child(1) .hs-card { --d: 2.95s; } #home-wrap.play .hs-two > :nth-child(2) .hs-card { --d: 3.1s; }
#home-wrap.play .hs-act:nth-child(1) { --d: 3.25s; } #home-wrap.play .hs-act:nth-child(2) { --d: 3.35s; } #home-wrap.play .hs-act:nth-child(3) { --d: 3.45s; } #home-wrap.play .hs-act:nth-child(n+4) { --d: 3.55s; }
#home-wrap.play .hs-row { animation-delay: calc(3.4s + var(--i, 0) * 110ms); }
#home-wrap.play .hs-cheer { --d: 3.7s; }
