/* ============================================================
   story.css  –  Shared styles for all project case-study pages
   ============================================================ */

/* --- Variables --- */
:root {
    --story-bg: #f4f6fa;
    --story-surface: rgba(255, 255, 255, 0.72);
    --story-border: rgba(255, 255, 255, 0.72);
    --story-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
    --story-text: #1d1d1f;
    --story-muted: #57575c;
    --story-soft: #6e6e73;
}

html {
    scroll-behavior: smooth;
}

/* --- Page background --- */
.story-body {
    background:
        radial-gradient(circle at 18% 8%, rgba(0, 113, 227, 0.14), transparent 36%),
        radial-gradient(circle at 84% 20%, rgba(56, 189, 248, 0.11), transparent 30%),
        linear-gradient(180deg, #f8f9fc 0%, #f2f4f8 40%, #eef1f7 100%);
    color: var(--story-text);
}

.story-main {
    position: relative;
    overflow-x: clip;
}

/* --- Sections --- */
.story-section {
    position: relative;
    min-height: auto;
    display: flex;
    align-items: center;
    padding: clamp(4.5rem, 8vh, 7.5rem) 1.2rem;
}

/* .story-section--dense — kept for HTML compatibility, no longer overrides min-height */

.hero-section {
    min-height: auto;
    padding-top: 4rem;
    padding-bottom: 1.5rem;
}

.story-section--auto {
    min-height: auto;
    padding-bottom: 5rem;
}

/* --- Shell / container --- */
.story-shell {
    width: min(1080px, 100%);
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* --- Panels --- */
.story-panel {
    position: relative;
    border-radius: 2rem;
    border: 1px solid var(--story-border);
    background: var(--story-surface);
    backdrop-filter: blur(26px);
    -webkit-backdrop-filter: blur(26px);
    box-shadow: var(--story-shadow);
    padding: clamp(1.5rem, 2.8vw, 2.4rem);
}

.glass-card {
    background: rgba(255, 255, 255, 0.64);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.08);
}

/* --- Typography --- */
.story-kicker {
    margin: 0 0 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--story-soft);
}

.story-title {
    font-size: clamp(2rem, 8vw, 4.3rem);
    line-height: 1;
    letter-spacing: -0.03em;
    font-weight: 650;
}

.story-subtitle {
    margin-top: 0.5rem;
    max-width: 46ch;
    color: var(--story-muted);
    line-height: 1.5;
}

.story-lead {
    margin-top: 1.2rem;
    max-width: 76ch;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(1rem, 2.5vw, 1.24rem);
    line-height: 1.6;
    color: #2e2f33;
}

.story-section-heading {
    margin-bottom: 2rem;
}

.story-section-title {
    font-size: clamp(1.7rem, 4.2vw, 3.3rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    font-weight: 620;
}

.story-section-description {
    margin-top: 0.85rem;
    max-width: 80ch;
    color: var(--story-muted);
    line-height: 1.65;
}

/* --- Grid --- */
.story-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

/* --- Cards --- */
.story-card {
    grid-column: span 4;
    border-radius: 1.5rem;
    padding: 1.35rem;
    background: rgba(255, 255, 255, 0.67);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1);
    transition: transform 0.45s ease, box-shadow 0.45s ease;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.12);
}

.story-card-eyebrow {
    margin-bottom: 0.4rem;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--story-soft);
    font-weight: 650;
}

.story-card-title {
    font-size: clamp(1.1rem, 1.8vw, 1.5rem);
    letter-spacing: -0.015em;
    margin-bottom: 0.45rem;
    font-weight: 620;
    line-height: 1.2;
}

.story-card-body {
    color: var(--story-muted);
    line-height: 1.55;
    font-size: 0.95rem;
}

.story-card-logo {
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    background: #fff;
}

/* --- Subcards (Dynamilis) --- */
.story-subcard {
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.story-resume-panel {
    padding: clamp(1.25rem, 2.6vw, 2.15rem);
}

/* --- Decorative orb --- */
.story-intro-orb {
    position: absolute;
    inset: auto auto 12% -6%;
    width: min(44vw, 460px);
    aspect-ratio: 1;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 35%, rgba(0, 113, 227, 0.28), rgba(56, 189, 248, 0.08) 58%, transparent 72%);
    pointer-events: none;
    filter: blur(2px);
    z-index: 1;
}

/* --- Scroll-reveal animation --- */
.story-animate {
    opacity: 0;
    transform: translateY(36px) scale(0.97);
    filter: blur(6px);
    transition:
        opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--delay, 0) * 120ms);
}

.story-section.is-visible .story-animate {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* --- CTA pill --- */
.story-scroll-cue {
    margin-top: 1.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-weight: 600;
    color: #3e4046;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.09);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-scroll-cue:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

/* --- Navigation --- */
.top-nav-fixed {
    position: relative;
    width: 100%;
    z-index: 10;
}

.top-nav-shell {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0.55rem 1rem 0.1rem;
}

.top-nav-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.15rem 0.05rem;
    border-radius: 999px;
    border: none;
    background: transparent;
}

.top-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.78rem;
    border-radius: 999px;
    font-size: 0.86rem;
    color: var(--story-muted);
    transition: color 0.2s ease, background-color 0.2s ease;
}

.top-nav-link:hover,
.top-nav-link.is-active {
    color: var(--story-text);
    background: transparent;
}

.top-nav-link.is-active {
    font-weight: 600;
}

.top-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    color: var(--story-muted);
    font-size: 0.84rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.top-nav-back:hover {
    color: var(--story-text);
    background: transparent;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .story-section {
        min-height: auto;
        padding-top: 3.75rem;
        padding-bottom: 3.75rem;
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .story-card {
        padding: 1.15rem;
    }

    .story-panel {
        padding: 1.25rem;
    }

    .top-nav-shell {
        padding: 0.4rem 0.4rem 0.1rem;
    }

    .top-nav-card {
        border-radius: 1rem;
    }
}

@media (max-width: 980px) {
    .story-card {
        grid-column: span 6;
    }
}

@media (max-width: 760px) {
    .story-card {
        grid-column: span 12 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .story-animate,
    .story-card,
    .glass-card {
        transition: none !important;
        transform: none !important;
        filter: none !important;
        opacity: 1 !important;
    }
}