/* ============================================================
   Saad Mansoor Minhas — Portfolio
   Vibrant, kinetic, Framer-grade. Big type, real color, motion.
   ============================================================ */

:root {
    --bg: #0a0a0e;
    --panel: #121218;
    --card: #15151c;
    --border: #232330;
    --border-hi: #34344a;
    --text: #f5f5f7;
    --muted: #a1a1ae;
    --dim: #6e6e7a;
    --violet: #8b5cf6;
    --pink: #ec4899;
    --orange: #f97316;
    --lime: #a3e635;
    --grad: linear-gradient(100deg, #8b5cf6 0%, #ec4899 50%, #f97316 100%);
    --display: 'Space Grotesk', 'Inter', sans-serif;
    --body: 'Inter', system-ui, sans-serif;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 110px; }

body {
    font-family: var(--body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--violet); color: #fff; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ---------- Type ---------- */
h1, h2, h3, .display { font-family: var(--display); letter-spacing: -0.02em; }

.grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.kicker::before {
    content: '';
    width: 22px; height: 2px;
    border-radius: 2px;
    background: var(--grad);
}

/* ============================================================
   Motion
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(36px) scale(0.985);
    transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}

.reveal.visible { opacity: 1; transform: none; }

/* hero load-in */
@keyframes riseIn {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: none; }
}

.rise { opacity: 0; animation: riseIn 0.9s var(--ease-out) forwards; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.18s; }
.rise-3 { animation-delay: 0.31s; }
.rise-4 { animation-delay: 0.44s; }
.rise-5 { animation-delay: 0.57s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal, .rise { opacity: 1; transform: none; }
}

/* ============================================================
   Nav — floating pill
   ============================================================ */
.nav {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: 100px;
    background: rgba(18, 18, 24, 0.72);
    border: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    max-width: calc(100vw - 32px);
}

.nav.scrolled { border-color: var(--border-hi); }

.nav-logo {
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 8px 16px 8px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo .spark {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--grad);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.7);
}

.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-links a {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--muted);
    padding: 8px 14px;
    border-radius: 100px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-links a.active { color: var(--text); background: rgba(255, 255, 255, 0.09); }

.nav-links .nav-hire {
    color: #0a0a0e;
    background: var(--text);
    font-weight: 600;
    margin-left: 6px;
}

.nav-links .nav-hire:hover { background: #fff; color: #0a0a0e; }

.nav-toggle { display: none; background: none; border: none; padding: 10px 14px; z-index: 201; }
.nav-toggle span {
    display: block;
    width: 20px; height: 2px;
    border-radius: 2px;
    background: var(--text);
    margin: 4.5px 0;
    transition: transform 0.3s var(--ease-spring), opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 760px) {
    .nav { width: calc(100vw - 32px); justify-content: space-between; }
    .nav-toggle { display: block; }
    .nav-links {
        position: fixed;
        inset: 0;
        background: rgba(10, 10, 14, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 18px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    .nav-links.open { opacity: 1; pointer-events: auto; }
    .nav-links a { font-size: 1.5rem; font-family: var(--display); }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: transform 0.35s var(--ease-spring), box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    will-change: transform;
}

.btn:hover { transform: translateY(-3px) scale(1.02); }
.btn:active { transform: translateY(0) scale(0.98); }

.btn-primary {
    background: var(--text);
    color: #0a0a0e;
}

.btn-primary:hover {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 14px 40px rgba(236, 72, 153, 0.35);
}

.btn-ghost {
    border-color: var(--border-hi);
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover { border-color: var(--violet); box-shadow: 0 10px 32px rgba(139, 92, 246, 0.25); }

.btn .arr { transition: transform 0.3s var(--ease-spring); display: inline-block; }
.btn:hover .arr { transform: translateX(4px); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 150px 0 60px;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    pointer-events: none;
    animation: blobDrift 18s ease-in-out infinite alternate;
}

.blob-violet { width: 560px; height: 560px; background: rgba(139, 92, 246, 0.32); top: -180px; left: -120px; }
.blob-pink { width: 460px; height: 460px; background: rgba(236, 72, 153, 0.24); top: 10%; right: -160px; animation-delay: -6s; }
.blob-orange { width: 420px; height: 420px; background: rgba(249, 115, 22, 0.18); bottom: -180px; left: 32%; animation-delay: -12s; }

@keyframes blobDrift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(70px, -50px) scale(1.15); }
    100% { transform: translate(-50px, 60px) scale(0.92); }
}

.hero-inner { position: relative; z-index: 2; text-align: center; max-width: 880px; margin: 0 auto; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid var(--border-hi);
    background: rgba(255, 255, 255, 0.04);
    padding: 9px 20px;
    border-radius: 100px;
    margin-bottom: 32px;
}

.hero-badge .pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--lime);
    position: relative;
}

.hero-badge .pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid var(--lime);
    animation: ping 1.8s ease-out infinite;
}

@keyframes ping {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.9); opacity: 0; }
}

.hero h1 {
    font-size: clamp(2.7rem, 7.2vw, 5.2rem);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 28px;
}

.hero-sub {
    font-size: clamp(1.02rem, 1.6vw, 1.2rem);
    color: var(--muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-sub strong { color: var(--text); font-weight: 600; }

.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 64px; }

.hero-stats {
    display: flex;
    justify-content: center;
    gap: clamp(28px, 6vw, 72px);
    flex-wrap: wrap;
}

.hstat { text-align: center; }

.hstat .v {
    font-family: var(--display);
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    font-weight: 700;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hstat .l { font-size: 0.83rem; color: var(--muted); margin-top: 4px; }

/* ============================================================
   Marquee
   ============================================================ */
.marquee {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 26px 0;
    overflow: hidden;
    position: relative;
    background: var(--panel);
}

.marquee-track {
    display: flex;
    gap: 56px;
    width: max-content;
    animation: marquee 36s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.marquee-item {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--dim);
    display: flex;
    align-items: center;
    gap: 56px;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.marquee-item::after { content: '✦'; color: var(--violet); font-size: 0.8rem; }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: 130px 0 0; position: relative; }

.section-head { margin-bottom: 56px; }

.section-head h2 {
    font-size: clamp(2rem, 4.6vw, 3.2rem);
    font-weight: 700;
    line-height: 1.1;
    margin-top: 16px;
    max-width: 20ch;
}

.section-head p { color: var(--muted); max-width: 56ch; margin-top: 16px; }

/* ============================================================
   About — bento
   ============================================================ */
.bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
}

.bento-card {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--card);
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: transform 0.45s var(--ease-spring), border-color 0.3s ease, box-shadow 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hi);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.bento-photo {
    grid-column: span 4;
    grid-row: span 2;
    padding: 0;
    min-height: 420px;
}

.bento-photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    transition: transform 0.7s var(--ease-out);
}

.bento-photo:hover img { transform: scale(1.05); }

.bento-photo .tag-loc {
    position: absolute;
    bottom: 18px; left: 18px;
    z-index: 2;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(10, 10, 14, 0.75);
    border: 1px solid var(--border-hi);
    padding: 8px 16px;
    border-radius: 100px;
    backdrop-filter: blur(8px);
}

.bento-bio { grid-column: span 8; }

.bento-bio p { color: var(--muted); margin-bottom: 14px; font-size: 1.02rem; }
.bento-bio p:last-child { margin-bottom: 0; }
.bento-bio strong { color: var(--text); font-weight: 600; }

.bento-mini { grid-column: span 4; }
.bento-mini-wide { grid-column: span 8; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

.bento-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 18px;
    background: rgba(139, 92, 246, 0.12);
}

.bento-mini:nth-of-type(odd) .bento-icon { background: rgba(236, 72, 153, 0.12); }

.bento-card h3 { font-size: 1.08rem; font-weight: 600; margin-bottom: 8px; }
.bento-card .d { color: var(--muted); font-size: 0.9rem; }

.bento-card .glow {
    position: absolute;
    top: -60px; right: -60px;
    width: 160px; height: 160px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.bento-card:hover .glow { opacity: 0.5; }
.glow-v { background: var(--violet); }
.glow-p { background: var(--pink); }
.glow-o { background: var(--orange); }
.glow-l { background: var(--lime); }

@media (max-width: 900px) {
    .bento-photo, .bento-bio, .bento-mini, .bento-mini-wide { grid-column: span 12; }
    .bento-photo { min-height: 360px; }
}

@media (min-width: 561px) and (max-width: 900px) {
    .bento-mini { grid-column: span 6; }
}

/* ============================================================
   Experience
   ============================================================ */
.xp-card {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--card);
    padding: 36px;
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 36px;
    position: relative;
    overflow: hidden;
    transition: transform 0.45s var(--ease-spring), border-color 0.3s ease;
}

.xp-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--grad);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.5s var(--ease-out);
}

.xp-card:hover { transform: translateX(8px); border-color: var(--border-hi); }
.xp-card:hover::before { transform: scaleY(1); }

.xp-side .when {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.xp-side .now {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lime);
    border: 1px solid rgba(163, 230, 53, 0.35);
    background: rgba(163, 230, 53, 0.08);
    padding: 4px 12px;
    border-radius: 100px;
}

.xp-side .org { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }

.xp-main h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 14px; }

.xp-main ul { display: grid; gap: 10px; margin-bottom: 20px; }

.xp-main li {
    color: var(--muted);
    font-size: 0.95rem;
    padding-left: 22px;
    position: relative;
}

.xp-main li::before {
    content: '';
    position: absolute;
    left: 2px; top: 9px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--grad);
}

.xp-main li strong { color: var(--text); font-weight: 600; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--muted);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 14px;
    border-radius: 100px;
    transition: all 0.25s ease;
}

.pill:hover {
    color: var(--text);
    border-color: var(--violet);
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
}

@media (max-width: 760px) {
    .xp-card { grid-template-columns: 1fr; gap: 18px; padding: 28px; }
}

/* ============================================================
   Projects
   ============================================================ */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.proj {
    border: 1px solid var(--border);
    border-radius: 28px;
    background: var(--card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.5s var(--ease-spring), border-color 0.3s ease, box-shadow 0.4s ease;
}

.proj:hover {
    transform: translateY(-10px);
    border-color: var(--border-hi);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.proj-cover {
    height: 210px;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    overflow: hidden;
}

.proj-cover::before {
    content: attr(data-num);
    position: absolute;
    top: -28px; right: 6px;
    font-family: var(--display);
    font-size: 9.5rem;
    font-weight: 700;
    line-height: 1;
    color: rgba(255, 255, 255, 0.1);
    transition: transform 0.6s var(--ease-out), color 0.4s ease;
}

.proj:hover .proj-cover::before { transform: translateY(-10px) scale(1.06); color: rgba(255, 255, 255, 0.18); }

.cover-violet { background: linear-gradient(135deg, #2e1065 0%, #7c3aed 100%); }
.cover-lime { background: linear-gradient(135deg, #1a2e05 0%, #65a30d 100%); }
.cover-orange { background: linear-gradient(135deg, #431407 0%, #ea580c 100%); }
.cover-pink { background: linear-gradient(135deg, #500724 0%, #db2777 100%); }

.proj-cover .chip {
    position: relative;
    z-index: 1;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(10, 10, 14, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 7px 16px;
    border-radius: 100px;
    backdrop-filter: blur(8px);
}

.proj-body { padding: 28px; display: flex; flex-direction: column; flex: 1; }

.proj-body h3 {
    font-size: 1.32rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.proj-body h3 .arr { transition: transform 0.35s var(--ease-spring); color: var(--muted); }
.proj:hover h3 .arr { transform: translate(5px, -2px); color: var(--text); }

.proj-body p { color: var(--muted); font-size: 0.94rem; flex: 1; margin-bottom: 20px; }

@media (max-width: 800px) {
    .projects-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Skills
   ============================================================ */
.skill-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.skill-group {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--card);
    padding: 28px;
    transition: transform 0.45s var(--ease-spring), border-color 0.3s ease;
}

.skill-group:hover { transform: translateY(-5px); border-color: var(--border-hi); }

.skill-group h3 {
    font-size: 1.02rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-group h3 .ico { font-size: 1.1rem; }

@media (max-width: 760px) { .skill-groups { grid-template-columns: 1fr; } }

/* ============================================================
   Credentials
   ============================================================ */
.cred-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

.cred-card {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--card);
    padding: 28px;
    transition: transform 0.45s var(--ease-spring), border-color 0.3s ease;
}

.cred-card:hover { transform: translateY(-5px); border-color: var(--border-hi); }

.cred-card .badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 100px;
    margin-bottom: 16px;
    color: var(--violet);
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.cred-card h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 6px; }
.cred-card p { color: var(--muted); font-size: 0.86rem; }

@media (max-width: 800px) { .cred-row { grid-template-columns: 1fr; } }

/* ============================================================
   CTA
   ============================================================ */
.cta { padding: 150px 0 130px; text-align: center; position: relative; overflow: hidden; }

.cta .blob { animation-duration: 14s; }

.cta-inner { position: relative; z-index: 2; }

.cta h2 {
    font-size: clamp(2.4rem, 6.5vw, 4.6rem);
    font-weight: 700;
    line-height: 1.06;
    max-width: 18ch;
    margin: 0 auto 24px;
}

.cta p { color: var(--muted); max-width: 52ch; margin: 0 auto 44px; }

.cta-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--border); padding: 36px 0; }

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.footer p { font-size: 0.84rem; color: var(--dim); }

.footer-links { display: flex; gap: 22px; }

.footer-links a {
    font-size: 0.86rem;
    color: var(--muted);
    transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--text); }

/* ============================================================
   Case-study pages
   ============================================================ */
.study-hero {
    position: relative;
    padding: 190px 0 80px;
    overflow: hidden;
}

.crumb {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 32px;
    transition: color 0.2s ease, transform 0.3s var(--ease-spring);
}

.crumb:hover { color: var(--text); transform: translateX(-4px); }

.study-hero h1 {
    font-size: clamp(2.3rem, 5.8vw, 4rem);
    font-weight: 700;
    line-height: 1.08;
    max-width: 20ch;
    margin-bottom: 24px;
}

.study-hero .lede {
    font-size: 1.12rem;
    color: var(--muted);
    max-width: 62ch;
    margin-bottom: 36px;
}

.study-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.study-meta > div {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    padding: 18px 22px;
}

.study-meta .k {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dim);
    margin-bottom: 6px;
}

.study-meta .v { font-size: 0.92rem; color: var(--text); font-weight: 500; }

@media (max-width: 680px) { .study-meta { grid-template-columns: 1fr; } }

.flow {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel);
    padding: 20px 26px;
    font-family: var(--display);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.flow .sep {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0 8px;
}

.study-section { padding: 84px 0 0; }

.study-section h2 {
    font-size: clamp(1.6rem, 3.4vw, 2.3rem);
    font-weight: 700;
    margin: 14px 0 24px;
}

.prose { max-width: 68ch; }
.prose p { color: var(--muted); margin-bottom: 18px; font-size: 1.02rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 600; }

.prose ul { display: grid; gap: 12px; }
.prose ul li {
    color: var(--muted);
    padding-left: 24px;
    position: relative;
    font-size: 0.98rem;
}
.prose ul li::before {
    content: '';
    position: absolute;
    left: 2px; top: 9px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--grad);
}
.prose ul li strong { color: var(--text); }

.challenge-grid { display: grid; gap: 18px; }

.challenge {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--card);
    padding: 30px;
    transition: transform 0.45s var(--ease-spring), border-color 0.3s ease;
}

.challenge:hover { transform: translateY(-4px); border-color: var(--border-hi); }

.challenge h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 12px; }
.challenge p { color: var(--muted); font-size: 0.95rem; margin-bottom: 10px; }
.challenge p:last-child { margin-bottom: 0; }
.challenge strong { color: var(--lime); font-weight: 600; }

.results-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

.result {
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--card);
    padding: 28px 24px;
    text-align: center;
    transition: transform 0.45s var(--ease-spring), border-color 0.3s ease;
}

.result:hover { transform: translateY(-5px); border-color: var(--border-hi); }

.result .num {
    font-family: var(--display);
    font-size: 1.9rem;
    font-weight: 700;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result .lbl { font-size: 0.84rem; color: var(--muted); margin-top: 8px; }

@media (max-width: 800px) { .results-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .results-row { grid-template-columns: 1fr; } }

.study-end { padding: 90px 0 110px; display: flex; gap: 16px; }

/* ============================================================
   404
   ============================================================ */
.error-page {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.error-page .code {
    font-family: var(--display);
    font-size: clamp(6rem, 20vw, 12rem);
    font-weight: 700;
    line-height: 1;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-page h1 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; margin: 12px 0 14px; }
.error-page p { color: var(--muted); max-width: 44ch; margin-bottom: 36px; }
