/* ============================================================
   ALX FFF — Graduation Project Journey (/research/graduation-project/)
   Same design tokens as the main site, self-contained stylesheet.
   ============================================================ */

:root {
    --bg-dark: #050A14;
    --bg-card: #0C1015;
    --bg-alt: #0A0E16;
    --primary: #00D2FF;
    --secondary: #B026FF;
    --border: #2A3645;
    --text-light: #E8EEF5;
    --text-gray: #9AA7B8;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg-dark);
    color: var(--text-gray);
    font-family: 'Outfit', sans-serif;
    line-height: 1.75;
    overflow-x: hidden;
}

img { max-width: 100%; }

/* ===== Reading progress bar ===== */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1200; background: transparent; }
.scroll-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--secondary)); }

/* ===== Minimal navbar ===== */
.j-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1100;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 12px 20px;
    background: rgba(5, 10, 20, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.j-logo { color: var(--text-light); font-size: 1.4rem; font-weight: 800; white-space: nowrap; text-decoration: none; }
.j-logo span { color: var(--primary); }
.j-nav-actions { display: flex; align-items: center; gap: 14px; }
.j-nav-actions a { text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.j-back { color: var(--text-gray); transition: 0.3s; white-space: nowrap; }
.j-back:hover { color: var(--primary); }
.j-chat { color: var(--text-gray); transition: 0.3s; white-space: nowrap; }
.j-chat:hover { color: var(--primary); }
.j-login { background: var(--primary); color: #000; padding: 8px 16px; border-radius: 5px; font-weight: 600; transition: 0.3s; white-space: nowrap; }
.j-login:hover { box-shadow: 0 0 15px var(--primary); }

/* ===== Chapter rail (desktop) ===== */
.act-rail {
    position: fixed; left: 26px; top: 50%; transform: translateY(-50%);
    z-index: 1000; display: flex; flex-direction: column; gap: 16px;
}
.rail-dot { position: relative; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); background: transparent; transition: 0.3s; display: block; }
.rail-dot:hover { border-color: var(--primary); }
.rail-dot.active { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 10px rgba(0, 210, 255, 0.6); }
.rail-label {
    position: absolute; left: 22px; top: 50%; transform: translateY(-50%);
    font-size: 0.8rem; color: var(--text-gray); white-space: nowrap;
    opacity: 0; pointer-events: none; transition: 0.25s;
}
.rail-dot:hover .rail-label, .rail-dot.active .rail-label { opacity: 1; }

/* ===== Hero ===== */
.j-hero {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center; text-align: center;
    position: relative; overflow: hidden;
    padding: 100px 22px 80px;
}
.j-hero::before {
    content: ""; position: absolute; inset: 0;
    background-image: url('../../assets/alxfff_cover.webp');
    background-size: cover; background-position: center;
    opacity: 0.16; filter: saturate(0.8);
}
.j-hero::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, var(--bg-dark) 82%);
}
.hero-inner { position: relative; z-index: 2; max-width: 860px; }
.hero-eyebrow {
    color: var(--secondary); font-size: 0.85rem; font-weight: 600;
    letter-spacing: 3px; text-transform: uppercase; margin-bottom: 22px;
}
.j-hero h1 {
    color: var(--text-light); font-size: clamp(2.4rem, 6.5vw, 4.4rem);
    font-weight: 800; line-height: 1.12; margin-bottom: 24px;
}
.glow { color: var(--primary); text-shadow: 0 0 24px rgba(0, 210, 255, 0.55); }
.hero-sub { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-gray); max-width: 680px; margin: 0 auto 34px; }
.hero-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.stat-chip {
    border: 1px solid var(--border); background: rgba(12, 16, 21, 0.75);
    border-radius: 10px; padding: 8px 16px; font-size: 0.92rem; color: var(--text-gray);
}
.stat-chip b { color: var(--primary); font-weight: 800; margin-right: 4px; }

/* Scroll cue (same language as the main site) */
.j-cue {
    position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
    width: 46px; height: 46px; border-radius: 50%;
    border: 1px solid var(--border); background: rgba(12, 16, 21, 0.6);
    z-index: 2; transition: 0.3s;
}
.j-cue::after {
    content: ""; position: absolute; top: 14px; left: 50%; transform: translateX(-50%) rotate(45deg);
    width: 10px; height: 10px; border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary);
    animation: cue-float 2.2s ease-in-out infinite;
}
.j-cue:hover { box-shadow: 0 0 18px rgba(0, 210, 255, 0.4); border-color: var(--primary); }
@keyframes cue-float { 0%, 100% { transform: translate(-50%, 0) rotate(45deg); } 50% { transform: translate(-50%, 7px) rotate(45deg); } }

/* ===== Acts ===== */
.act { max-width: 1080px; margin: auto; padding: 96px 22px 30px; }
.act-head { margin-bottom: 38px; }
.act-no {
    display: inline-block; color: var(--secondary); font-size: 0.8rem; font-weight: 600;
    letter-spacing: 3px; text-transform: uppercase; margin-bottom: 10px;
}
.act-no::after { content: ""; display: block; width: 52px; height: 2px; margin-top: 8px; background: linear-gradient(90deg, var(--secondary), transparent); }
.act-head h2 { color: var(--text-light); font-size: clamp(1.65rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.2; }

.two-col { display: grid; grid-template-columns: 1.08fr 1fr; gap: 44px; align-items: center; }
.two-col.reverse { grid-template-columns: 1fr 1.08fr; }

.act-text p { margin-bottom: 1.15em; }
.act-text p:last-child { margin-bottom: 0; }
.act-text strong { color: var(--text-light); font-weight: 600; }
.act-text h3 { color: var(--text-light); font-size: 1.5rem; font-weight: 700; margin-bottom: 16px; }

.quote {
    border-left: 3px solid var(--secondary);
    padding: 8px 0 8px 18px; margin: 22px 0 0;
    color: var(--text-light); font-style: italic; font-size: 1.05rem;
}

/* ===== Figures ===== */
.act-fig {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
    padding: 10px; transition: 0.35s;
}
.act-fig img { display: block; width: 100%; border-radius: 9px; }
.act-fig figcaption { font-size: 0.85rem; color: var(--text-gray); padding: 9px 6px 3px; }
.act-fig:hover { border-color: rgba(0, 210, 255, 0.55); box-shadow: 0 0 22px rgba(0, 210, 255, 0.12); }
.act-fig.wide { margin-top: 44px; }
.act-fig img { background: #fff; } /* screenshots from the book sit on white pages — keep the frame clean */

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 40px; }
.gallery .act-fig figcaption { min-height: 2.4em; }

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

/* Machines */
.machine { margin-top: 66px; position: relative; padding-left: 26px; border-left: 1px solid var(--border); }
.machine-no {
    position: absolute; left: -21px; top: 0;
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--bg-dark); border: 1px solid var(--primary);
    color: var(--primary); font-weight: 800; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.25);
}
.machine-body { padding-top: 4px; }
.family-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.family-grid .act-fig { padding: 7px; border-radius: 10px; }
.family-grid .act-fig figcaption { font-size: 0.78rem; padding: 6px 4px 2px; }
.grid-caption { font-size: 0.85rem; color: var(--text-gray); margin-top: 4px; }

/* ===== Counters ===== */
.counters {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
    margin-top: 48px;
}
.counter {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
    padding: 26px 14px; text-align: center; transition: 0.35s;
}
.counter:hover { border-color: rgba(0, 210, 255, 0.5); }
.counter .num { display: block; color: var(--primary); font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; }
.counter .label { display: block; margin-top: 8px; font-size: 0.85rem; color: var(--text-gray); }

/* ===== Phones & CTA ===== */
.phone-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 22px; margin-top: 20px; }
.phone {
    width: 232px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 20px; padding: 8px; transition: 0.35s;
}
.phone img { display: block; width: 100%; border-radius: 13px; background: #10151d; }
.phone figcaption { text-align: center; font-size: 0.85rem; color: var(--text-gray); padding: 9px 0 4px; }
.phone:hover { transform: translateY(-5px); border-color: rgba(176, 38, 255, 0.6); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }

.cta-card {
    margin: 60px auto 0; max-width: 720px; text-align: center;
    background: linear-gradient(160deg, rgba(0, 210, 255, 0.07), rgba(176, 38, 255, 0.07)), var(--bg-card);
    border: 1px solid var(--border); border-radius: 20px; padding: 46px 28px;
}
.cta-card h3 { color: var(--text-light); font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; margin-bottom: 10px; }
.cta-card p { margin-bottom: 24px; }
.cta-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.btn-solid, .btn-outline {
    display: inline-block; padding: 12px 26px; border-radius: 8px;
    font-weight: 600; text-decoration: none; transition: 0.3s; font-size: 0.98rem;
}
.btn-solid { background: var(--primary); color: #000; }
.btn-solid:hover { box-shadow: 0 0 18px var(--primary); }
.btn-outline { border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: rgba(0, 210, 255, 0.1); box-shadow: 0 0 14px rgba(0, 210, 255, 0.25); }

/* ===== Book card ===== */
.book-card {
    display: flex; gap: 20px; align-items: center;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 20px;
}
.book-card img { width: 46%; border-radius: 10px; border: 1px solid var(--border); }
.book-info h4 { color: var(--text-light); font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin-bottom: 6px; }
.book-info p { font-size: 0.88rem; margin-bottom: 16px; }
.book-info .btn-outline { padding: 10px 18px; font-size: 0.88rem; }
.book-back { display: block; margin-top: 12px; color: var(--text-gray); font-size: 0.88rem; text-decoration: none; transition: 0.3s; }
.book-back:hover { color: var(--primary); }

/* ===== Footer ===== */
.j-footer {
    border-top: 1px solid var(--border); margin-top: 90px;
    padding: 30px 22px; text-align: center; font-size: 0.9rem;
    display: flex; flex-direction: column; gap: 10px;
}
.foot-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 22px; }
.foot-links a { color: var(--text-gray); text-decoration: none; transition: 0.3s; }
.foot-links a:hover { color: var(--primary); }

/* ===== Reveal on scroll (same pattern as main site) ===== */
.reveal-init { opacity: 0; transform: translateY(26px); }
.reveal-init.reveal-visible { opacity: 1; transform: translateY(0); transition: opacity 0.7s ease, transform 0.7s ease; }

/* ===== Live Chart.js cards (Act 5) ===== */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 44px;
}
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 22px 16px;
    /* لازم min-width:0 — من غيرها الـ grid item مش بيقبل يصغّر تحت عرض الـ canvas
       اللي Chart.js بيكتبه inline، فالصفحة بتفضل أعرض من الشاشة بعد rotation/resize */
    min-width: 0;
}
.chart-card:hover { border-color: rgba(0, 210, 255, 0.45); }
.chart-card figcaption { display: block; }
.chart-card figcaption b { display: block; color: var(--text-light); font-size: 1.02rem; font-weight: 600; }
.chart-card figcaption span { display: block; margin-top: 3px; color: var(--text-gray); font-size: 0.82rem; }
.chart-box { position: relative; height: 230px; margin-top: 16px; }
.chart-src { margin-top: 12px; font-size: 0.76rem; color: var(--text-gray); opacity: 0.8; }
/* لو CDN الرسم فشل، الشبكة بتختارى بهدوء والصفحة بتفضل زي ما هي */
.charts-unavailable { display: none; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .act-rail { display: none; }
}
@media (max-width: 820px) {
    .two-col, .two-col.reverse { grid-template-columns: 1fr; gap: 28px; }
    .gallery { grid-template-columns: repeat(2, 1fr); }
    .counters { grid-template-columns: repeat(2, 1fr); }
    .chart-grid { grid-template-columns: 1fr; gap: 20px; }
    .chart-box { height: 210px; }
    .machine { padding-left: 18px; }
    .act { padding: 70px 18px 20px; }
}
@media (max-width: 560px) {
    .j-nav-actions { gap: 9px; }
    .j-nav-actions a { font-size: 0.82rem; }
    .j-login { padding: 7px 11px; }
    .j-back { display: none; }
    .gallery { grid-template-columns: 1fr; }
    .family-grid { grid-template-columns: repeat(2, 1fr); }
    .book-card { flex-direction: column; text-align: center; }
    .book-card img { width: 72%; }
    .phone { width: 200px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal-init { opacity: 1; transform: none; transition: none; }
    .j-cue::after { animation: none; }
    * { transition: none !important; }
}
