/* REMX katmanlı tanıtım bölümü
   Sahnede yalnız gerçek takvim ekranının görüntüsü (takvim.png, 1918×937) kullanılır.
   Katmanlar aynı görüntünün parçalarıdır: ders kartları, öğrenci paneli, izinler ve
   istatistik şeridi ayrı ayrı açılır. Koordinatlar görüntü pikseli cinsindendir.
   Tüm kurallar .rl-root altında; ana sayfanın section/nav seçicilerine dokunmaz. */

.rl-root {
    --rl-pink:   var(--pink, #f2425f);
    --rl-green:  var(--green, #c6e54f);
    --rl-dark:   var(--dark, #1c1e24);
    --rl-gray:   var(--gray, #6b7280);
    --rl-light:  var(--light, #f9fafb);
    --rl-border: var(--border, #e5e7eb);
    --rl-nav-h: 76px;
    --rl-W: 1918;            /* görüntü genişliği */
    --rl-H: 937;             /* görüntü yüksekliği */
    position: relative;
    padding: 6rem 6% 4rem;
    background: #fff;
    color: var(--rl-dark);
    font-family: 'Montserrat', system-ui, sans-serif;
}
.rl-root *, .rl-root *::before, .rl-root *::after { box-sizing: border-box; }

/* ---------- Başlık ---------- */
.rl-head { max-width: 760px; margin-bottom: 2.5rem; }
.rl-label { font-size: .72rem; letter-spacing: 3px; text-transform: uppercase; color: var(--rl-pink); font-weight: 700; margin: 0 0 .8rem; }
.rl-title { font-size: clamp(2rem, 3vw, 3rem); font-weight: 900; text-transform: uppercase; letter-spacing: -1.5px; line-height: 1.1; margin: 0; }
.rl-intro { color: var(--rl-gray); line-height: 1.8; margin: 1.2rem 0 0; max-width: 640px; font-size: 1rem; }

/* ---------- Çerçeve ---------- */
.rl-frame { display: flex; flex-direction: column; gap: 14px; }

/* Aşama düğmeleri (JS yoksa gizli) */
.rl-steps { display: none; gap: .4rem; max-width: 760px; width: 100%; margin: 0 auto; }
.rl-js .rl-steps { display: flex; }
.rl-steps button {
    flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: .45rem;
    padding: .5rem .7rem; border-radius: 999px; border: 1.5px solid var(--rl-border);
    background: #fff; color: var(--rl-gray);
    font: inherit; font-size: .72rem; font-weight: 700; letter-spacing: .3px;
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: background .25s, color .25s, border-color .25s;
}
.rl-steps button:hover { border-color: var(--rl-pink); color: var(--rl-dark); }
.rl-steps button:focus-visible { outline: 3px solid rgba(242,66,95,.5); outline-offset: 2px; }
.rl-steps .rl-n { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; background: var(--rl-light); color: var(--rl-gray); }
.rl-steps .rl-t { overflow: hidden; text-overflow: ellipsis; }
.rl-steps button.is-done .rl-n { background: var(--rl-green); color: var(--rl-dark); }
.rl-steps button.is-active { background: var(--rl-pink); border-color: var(--rl-pink); color: #fff; }
.rl-steps button.is-active .rl-n { background: #fff; color: var(--rl-pink); }

/* ---------- Sahne ---------- */
.rl-stage {
    position: relative; overflow: hidden; margin: 0 auto; width: 100%;
    aspect-ratio: 1918 / 937;
    border: 1px solid var(--rl-border); border-radius: 14px; background: #fff;
    box-shadow: 0 24px 60px rgba(28,30,36,.14);
}
.rl-canvas {
    /* Kamera: görüntünün (cx, cy, cw) bölgesini sahneye sığdırır */
    --cx: 0; --cy: 0; --cw: 1918;
    position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1918 / 937;
    transform-origin: 0 0;
    transform: scale(calc(1918 / var(--cw))) translate(calc(var(--cx) / -1918 * 100%), calc(var(--cy) / -937 * 100%));
    transition: transform .9s cubic-bezier(.65, 0, .25, 1);
}
.rl-base { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rl-ov { position: absolute; inset: 0; }

/* Görüntü parçası (crop) ve örtü (mask) ortak konumlandırma */
.rl-crop, .rl-mask, .rl-ring, .rl-count {
    position: absolute;
    left:   calc(var(--x) / 1918 * 100%);
    top:    calc(var(--y) / 937 * 100%);
    width:  calc(var(--w) / 1918 * 100%);
    height: calc(var(--h) / 937 * 100%);
}
.rl-crop {
    background-image: url("takvim.png");
    background-repeat: no-repeat;
    background-size: calc(1918 / var(--w) * 100%) calc(937 / var(--h) * 100%);
    background-position: calc(var(--x) / (1918 - var(--w)) * 100%) calc(var(--y) / (937 - var(--h)) * 100%);
}
.rl-mask { background: var(--m, #e9f6ec); }

/* Animasyonsuz modda yalnız görüntünün kendisi görünür (parçalar ve örtüler gerekmez) */
.rl-crop, .rl-mask, .rl-ring, .rl-count { display: none; }
.rl-anim .rl-crop, .rl-anim .rl-mask, .rl-anim .rl-ring { display: block; }
.rl-anim .rl-count { display: grid; }

/* Katman sırası */
.rl-cellmask { z-index: 1; }
.rl-cell { z-index: 2; }
.rl-m4   { z-index: 3; }
.rl-sidemask, .rl-statmask { z-index: 4; }
.rl-side, .rl-stats { z-index: 5; }
.rl-count { z-index: 6; }
.rl-ring { z-index: 7; }
.rl-m1   { z-index: 8; }

.rl-cell { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
.rl-count {
    place-items: center; background: var(--m);
    color: #fff; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    font-weight: 700; font-size: calc(var(--k, .6) * 33px); line-height: 1;
    font-variant-numeric: tabular-nums;
}
.rl-ring { border: 3px solid var(--rl-pink); border-radius: 8px; box-shadow: 0 0 0 6px rgba(242,66,95,.18); }
.rl-m1 {
    display: none; place-items: center; background: var(--rl-light);
    color: #9ca3af; font-weight: 600; font-size: calc(var(--k, .6) * 40px);
}
.rl-anim .rl-m1 { display: grid; }

/* ---------- Katman görünürlüğü ----------
   .rl-lN : N. adımda görünür olur.   .rl-mN : N. adımda kaybolur (örtüyü kaldırır). */
.rl-anim .rl-l2, .rl-anim .rl-l3, .rl-anim .rl-l4, .rl-anim .rl-l5 {
    opacity: 0; visibility: hidden; transform: var(--rl-from, translateY(10px) scale(.94));
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.rl-anim.is-s2 .rl-l2, .rl-anim.is-s3 .rl-l3, .rl-anim.is-s4 .rl-l4, .rl-anim.is-s5 .rl-l5 {
    opacity: 1; visibility: visible; transform: none;
    transition:
        opacity .4s ease calc(var(--i, 0) * 40ms),
        transform .5s cubic-bezier(.2, .8, .2, 1) calc(var(--i, 0) * 40ms),
        visibility 0s linear calc(var(--i, 0) * 40ms);
}
.rl-anim .rl-m1, .rl-anim .rl-m4 { opacity: 1; visibility: visible; transition: opacity .3s ease .45s, visibility 0s linear 0s; }
.rl-anim.is-s1 .rl-m1, .rl-anim.is-s4 .rl-m4 { opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s linear .45s; }
.rl-anim .rl-side  { --rl-from: translateX(-30%); }
.rl-anim .rl-stats { --rl-from: translateY(40%); }
.rl-anim .rl-count { --rl-from: none; }
.rl-anim .rl-ring  { opacity: 0; transition: opacity .3s; }
.rl-anim[data-current="4"] .rl-ring { opacity: 1; transition: opacity .4s ease .5s; }

/* Kamera konumları — masaüstü (sahne oranı görüntüyle aynı) */
.rl-anim[data-current="2"] .rl-canvas { --cx: 0;   --cy: 0; --cw: 1300; }
.rl-anim[data-current="3"] .rl-canvas { --cx: 318; --cy: 0; --cw: 1300; }
.rl-anim[data-current="4"] .rl-canvas { --cx: 318; --cy: 0; --cw: 1600; }

/* ---------- Anlatım ---------- */
.rl-step { max-width: 760px; margin: 0 auto 2.5rem; }
.rl-step-no {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; font-weight: 900; font-size: .9rem;
    background: var(--rl-pink); color: #fff; margin-bottom: .8rem;
}
.rl-step h3 { font-size: 1.35rem; font-weight: 900; text-transform: uppercase; letter-spacing: -.5px; line-height: 1.2; margin: 0 0 .6rem; }
.rl-step h3:focus { outline: none; }
.rl-step h3:focus-visible { outline: 2px solid var(--rl-pink); outline-offset: 4px; border-radius: 4px; }
.rl-step p { color: var(--rl-gray); line-height: 1.7; font-size: .92rem; margin: 0 0 .8rem; }
.rl-step ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.rl-step li { position: relative; padding-left: 1.3rem; font-size: .84rem; line-height: 1.55; color: #374151; }
.rl-step li::before { content: ''; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--rl-pink); }
.rl-step li.rl-key { padding-left: 1.8rem; }
.rl-step li.rl-key::before { display: none; }
.rl-sw { position: absolute; left: 0; top: .22em; width: 18px; height: 14px; border-radius: 3px; background: var(--c); }
.rl-demo-link {
    display: inline-block; margin-top: .4rem;
    background: var(--rl-pink); color: #fff; text-decoration: none;
    padding: .95rem 2.3rem; border-radius: 50px;
    font-weight: 800; font-size: .8rem; letter-spacing: 2px; text-transform: uppercase;
    box-shadow: 0 6px 20px rgba(242,66,95,.35); transition: transform .3s, box-shadow .3s;
}
.rl-demo-link:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(242,66,95,.45); }
.rl-demo-link:focus-visible { outline: 3px solid var(--rl-dark); outline-offset: 3px; }

/* ---------- Animasyonlu mod: yapışkan çerçeve + değişen açıklama ---------- */
.rl-anim .rl-track { position: relative; height: 620vh; }
.rl-anim .rl-frame {
    position: sticky; top: var(--rl-nav-h);
    height: calc(100vh - var(--rl-nav-h));
    justify-content: center; padding: 12px 0;
}
.rl-anim .rl-stage { width: min(100%, calc((100vh - var(--rl-nav-h) - 270px) * 1918 / 937)); }
.rl-anim .rl-texts { position: relative; height: 190px; width: min(100%, 1180px); margin: 0 auto; }
.rl-anim .rl-step {
    position: absolute; inset: 0; margin: 0; max-width: none;
    display: grid; grid-template-columns: minmax(200px, .9fr) 1.3fr 1.3fr; gap: 0 2.2rem; align-items: start;
    opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
.rl-anim .rl-step.is-current {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .45s ease .15s, transform .45s ease .15s, visibility 0s linear .15s;
}
.rl-anim .rl-step .rl-step-no { margin-bottom: .6rem; }

/* ---------- Mobil ---------- */
@media (max-width: 899px) {
    .rl-root { padding: 4.5rem 5% 3rem; }
    .rl-head { margin-bottom: 1.5rem; }
    .rl-steps .rl-t { display: none; }
    .rl-steps button { justify-content: center; padding: .4rem; }

    /* Dar ekranda tüm ekran yerine ilgili bölge yakından gösterilir */
    .rl-anim .rl-stage { aspect-ratio: 440 / 395; width: min(100%, calc((100vh - var(--rl-nav-h) - 300px) * 440 / 395)); }
    .rl-anim .rl-canvas,
    .rl-anim[data-current="3"] .rl-canvas,
    .rl-anim[data-current="4"] .rl-canvas { --cx: 320; --cy: 45; --cw: 440; }
    .rl-anim[data-current="2"] .rl-canvas { --cx: 0;   --cy: 40;  --cw: 330; }
    .rl-anim[data-current="5"] .rl-canvas { --cx: 320; --cy: 538; --cw: 445; }

    .rl-anim .rl-texts { height: 215px; }
    .rl-anim .rl-step { display: block; }
    .rl-anim .rl-step ul { display: none; }
    .rl-step h3 { font-size: 1.1rem; }
    .rl-step p { font-size: .88rem; }
    .rl-anim .rl-step-no { width: 32px; height: 32px; font-size: .8rem; }
}

/* Kısa ekranda (yatay telefon vb.) JS animasyonu açmaz; yine de güvenlik için */
@media (max-height: 559px) {
    .rl-anim .rl-track { height: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .rl-root *, .rl-root *::before, .rl-root *::after { transition: none !important; animation: none !important; }
}

/* Örnek dersler (adım 3): boş yuvalara eklenen yeşil kartlar ve turuncu grup dersleri.
   Boyutlar görüntü pikselinde; yazılar --k ölçeğiyle büyür. */
.rl-lesson {
    position: absolute;
    left:   calc(var(--x) / 1918 * 100%);
    top:    calc(var(--y) / 937 * 100%);
    width:  calc(var(--w) / 1918 * 100%);
    height: calc(var(--h) / 937 * 100%);
    z-index: 2; display: none; overflow: hidden; border-radius: 3px;
    padding: calc(var(--k, .6) * 6px) calc(var(--k, .6) * 7px);
    background: #20a846; color: #fff;
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: calc(var(--k, .6) * 12px); font-weight: 800; line-height: 1.2;
    text-transform: uppercase; white-space: nowrap; text-overflow: ellipsis;
}
.rl-lesson em { display: block; font-size: calc(var(--k, .6) * 10px); font-weight: 500; font-style: italic; text-transform: none; opacity: .92; margin-top: calc(var(--k, .6) * 4px); }
.rl-lesson.rl-grup { background: #f5a00b; }
.rl-lesson.rl-grup b { display: block; font-size: calc(var(--k, .6) * 13px); font-weight: 800; }
.rl-av {
    position: absolute; top: calc(var(--k, .6) * 24px);
    width: calc(var(--k, .6) * 22px); height: calc(var(--k, .6) * 22px); border-radius: 50%;
    background: #1e3a8a; color: #fff; display: grid; place-items: center;
    font-size: calc(var(--k, .6) * 9px); font-weight: 800; text-transform: uppercase;
}
.rl-anim .rl-lesson { display: block; }
