/* ============================================
   Screen 1 (Hero) — Flex Column + Two-column Content
   CTA button pinned to bottom of viewport
   Uses CSS vars from base.css
   ============================================ */

/* Screen1 section: no vertical centering, s1 handles its own layout */
.screen-section[data-screen="screen1"] {
    justify-content: flex-start;
    overflow: visible;
}

/* Override container width for hero */
.container.hero-container {
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Hero wrapper: flex column, full viewport ---- */
.s1 {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: calc(100svh - var(--nav-height, 72px));
    padding: 0 0 32px;
    overflow: hidden;
}

/* ---- Content area: two-column grid, vertically centered ---- */
.s1-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    flex: 1;
}

/* ---- Ambient orbs ---- */
.s1-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    will-change: transform;
    animation: s1-float 20s ease-in-out infinite;
}

.s1-orb--green {
    width: 500px;
    height: 500px;
    background: var(--accent-light);
    opacity: 0.08;
    top: -10%;
    right: 20%;
}

.s1-orb--purple {
    width: 400px;
    height: 400px;
    background: #7b61ff;
    opacity: 0.06;
    bottom: 5%;
    left: -5%;
}

@keyframes s1-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ---- Left column: text ---- */
.s1-text {
    position: relative;
    z-index: 1;
}

/* ---- Badge ---- */
.s1-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-radius: 10px;
    background: var(--accent-subtle);
    border: 1px solid var(--accent-border);
    margin-bottom: 28px;
    animation: s1-fadeUp 0.8s var(--ease-out-expo) both;
}

.s1-badge__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-light);
    box-shadow: 0 0 12px var(--accent-glow);
    animation: s1-blink 2s ease-in-out infinite;
}

.s1-badge__text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.s1-badge__text strong {
    color: var(--accent-light);
    font-weight: 700;
}

.s1-badge__sep {
    color: rgba(255, 255, 255, 0.15);
    margin: 0 2px;
}

/* ---- Headline ---- */
.s1-headline {
    display: flex;
    flex-direction: column;
    font-size: clamp(2.8rem, 4vw, 4.2rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    animation: s1-fadeUp 0.8s var(--ease-out-expo) 0.15s both;
}

.s1-headline__white {
    color: var(--text-primary);
}

.s1-headline__gradient {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- Subtitle ---- */
.s1-subtitle {
    margin-top: 20px;
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 440px;
    animation: s1-fadeUp 0.8s ease 0.35s both;
}

/* ---- CTA row: inside .s1-text, below subtitle ---- */
.s1-cta-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 36px;
    animation: s1-fadeUp 0.8s ease 0.5s both;
}

.s1-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 48px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, #2ee02e, #10aa10);
    border-radius: 16px;
    box-shadow:
        0 8px 32px rgba(20, 204, 20, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.s1-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(20, 204, 20, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.s1-cta-primary svg {
    transition: transform 0.3s ease;
}

.s1-cta-primary:hover svg {
    transform: translateX(4px);
}

.s1-cta-ghost {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.3s;
}

.s1-cta-ghost:hover {
    color: #fff;
}

/* ---- Right column: Dashboard ---- */
.s1-dashboard {
    position: relative;
    z-index: 1;
    perspective: 1200px;
    animation: s1-dashEnter 1s var(--ease-out-expo) 0.3s both;
}

@keyframes s1-dashEnter {
    from { opacity: 0; transform: translateY(60px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.s1-dash {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.15s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
    will-change: transform;
    animation: s1-dashFloat 4s ease-in-out infinite 1.5s;
}

.s1-dash:hover {
    box-shadow: 0 0 60px rgba(87,243,87,0.08), 0 20px 60px rgba(0,0,0,0.3);
}

@keyframes s1-dashFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Dashboard header */
.s1-dash__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.s1-dash__title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.s1-dash__live {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--accent-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.s1-dash__live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-light);
    animation: s1-blink 1.5s ease-in-out infinite;
}

/* ---- Chart ---- */
.s1-chart {
    height: 180px;
    position: relative;
    margin-bottom: 24px;
    margin-left: -32px;
    margin-right: -32px;
    overflow: visible;
    background: rgba(255,255,255,0.02);
    padding: 20px 4px 30px;
    border-top: 1px solid rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.s1-chart svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.s1-chart__dot {
    opacity: 0;
    animation: s1-dotPop 0.4s ease both;
}

.s1-chart__dot:nth-child(4) { animation-delay: 1.8s; }
.s1-chart__dot:nth-child(5) { animation-delay: 2.1s; }
.s1-chart__dot:nth-child(6) { animation-delay: 2.4s; }

@keyframes s1-dotPop {
    from { opacity: 0; }
    to { opacity: 1; }
}

.s1-chart__value {
    font-family: var(--font-sans);
    fill: var(--accent-light);
    font-size: 18px;
    font-weight: 700;
    opacity: 0;
    animation: s1-fadeIn 0.4s ease both;
}

.s1-chart__value:nth-of-type(1) { animation-delay: 1.8s; }
.s1-chart__value:nth-of-type(2) { animation-delay: 2.1s; }
.s1-chart__value:nth-of-type(3) { animation-delay: 2.4s; }

.s1-chart__month {
    font-family: var(--font-sans);
    fill: rgba(255,255,255,0.3);
    font-size: 12px;
}

.s1-chart__line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: s1-drawLine 2s cubic-bezier(0.4,0,0.2,1) forwards 0.8s;
}

.s1-chart__area {
    opacity: 0;
    animation: s1-fadeIn 1s ease forwards 1.5s;
}

@keyframes s1-drawLine {
    to { stroke-dashoffset: 0; }
}

/* ---- Dashboard metrics grid ---- */
.s1-dash-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.s1-dash-metric {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    transition: border-color 0.3s, background 0.3s;
    animation: s1-metricPop 0.5s var(--ease-out-expo) both;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.s1-dash-metric:nth-child(1) { animation-delay: 1.2s; }
.s1-dash-metric:nth-child(2) { animation-delay: 1.35s; }
.s1-dash-metric:nth-child(3) { animation-delay: 1.5s; }
.s1-dash-metric:nth-child(4) { animation-delay: 1.65s; }

@keyframes s1-metricPop {
    from { opacity: 0; transform: scale(0.85) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.s1-dash-metric:hover {
    border-color: rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
}

.s1-dash-metric__info {
    flex: 1;
    min-width: 0;
}

.s1-dash-metric__value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.s1-dash-metric__value--green { color: var(--accent-light); }
.s1-dash-metric__value--purple { color: #7b61ff; }
.s1-dash-metric__value--pink { color: #e83830; }
.s1-dash-metric__value--amber { color: #ffaa00; }

.s1-dash-metric__label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.s1-dash-metric__icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

/* ---- Backed-by (under dashboard) ---- */
.s1-backed {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    justify-content: space-between;
    width: 100%;
}

.s1-backed .backed-by-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.s1-backed .backed-by-logos {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: space-around;
}

.s1-backed .backed-logo {
    height: 20px;
    opacity: 0.4;
    transition: opacity var(--transition-fast);
}

.s1-backed .backed-logo:hover {
    opacity: 1;
}


/* ---- Desktop/Mobile CTA toggle ---- */
.s1-cta-mobile {
    display: none;
}

/* ---- Client logos marquee: bottom of screen ---- */
.s1-clients {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding-top: 24px;
    animation: s1-fadeUp 0.8s ease 0.6s both;
    width: 100%;
}

.s1-clients__label {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.65;
    font-weight: 400;
    letter-spacing: normal;
}

/* Marquee wrapper with fade edges */
.s1-clients__marquee {
    position: relative;
    width: 100%;
    overflow: hidden;
    cursor: grab;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.s1-clients__marquee:active {
    cursor: grabbing;
}

.s1-clients__track {
    display: flex;
    align-items: center;
    gap: 48px;
    width: max-content;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
}

.s1-clients__link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.s1-clients__logo {
    height: 52px;
    width: auto;
    opacity: 0.35;
    filter: grayscale(1) brightness(1.8);
    transition: opacity 0.4s, filter 0.4s;
    flex-shrink: 0;
    pointer-events: auto;
    -webkit-user-drag: none;
    user-select: none;
}

/* Normalize wide logos to match Qazaq Oil width (~165px at 52px height) */
.s1-clients__logo[alt="Biopharma"],
.s1-clients__logo[alt="Espresso Day"] {
    max-width: 165px;
    height: auto;
    max-height: 52px;
}

/* Match Hani to KDL Olymp size (~117px width) */
.s1-clients__logo[alt="Hani"] {
    max-width: 117px;
    height: auto;
    max-height: 52px;
}

.s1-clients__logo:hover {
    opacity: 1;
    filter: grayscale(0) brightness(1);
}

/* ---- Shared animations ---- */
@keyframes s1-fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes s1-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes s1-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   Responsive: Tablet (<=1024px)
   ============================================ */
@media (max-width: 1024px) {
    .s1-content {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }

    .s1-text {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .s1-headline {
        align-items: center;
    }

    .s1-subtitle {
        max-width: 560px;
    }

    .s1-dashboard {
        max-width: 640px;
        margin: 0 auto;
        width: 100%;
    }
}

/* ============================================
   Responsive: Mobile (<=768px)
   ============================================ */
@media (max-width: 768px) {
    .s1 {
        padding: 8px 0 12px;
        /* Force exact viewport fit so CTA stays at bottom */
        height: calc(100svh - var(--nav-height, 72px));
        min-height: auto;
        overflow: visible;
    }

    /* Switch from grid to flex-column so dashboard can shrink */
    .s1-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        min-height: 0;
        justify-content: space-evenly;
    }

    .s1-dashboard {
        flex-shrink: 1;
        min-height: 0;
        overflow: hidden;
        width: 100%;
    }

    .container.hero-container {
        padding: 0 20px;
    }

    .s1-headline {
        font-size: clamp(1.8rem, 7vw, 2.6rem);
    }

    .s1-subtitle {
        font-size: 0.9rem;
        margin-top: 12px;
    }

    .s1-cta-desktop {
        display: none;
    }

    .s1-cta-mobile {
        display: flex;
        width: 100%;
        margin-top: 12px;
        justify-content: center;
    }

    .s1-cta-primary {
        width: 100%;
        justify-content: center;
        text-align: center;
        padding: 14px 36px;
    }

    .s1-clients {
        padding: 8px 0 0;
        gap: 8px;
    }

    .s1-clients__track {
        gap: 28px;
    }

    .s1-clients__logo {
        height: 37px;
    }

    .s1-clients__logo[alt="Biopharma"],
    .s1-clients__logo[alt="Espresso Day"] {
        max-width: 118px;
        height: auto;
        max-height: 37px;
    }

    .s1-clients__logo[alt="Hani"] {
        max-width: 84px;
        height: auto;
        max-height: 37px;
    }

    .s1-dashboard {
        max-width: 100%;
    }

    .s1-dash {
        padding: 16px;
        border-radius: 18px;
    }

    .s1-dash__header {
        margin-bottom: 12px;
    }

    .s1-chart {
        margin-left: -16px;
        margin-right: -16px;
        height: 110px;
        padding: 12px 4px 20px;
        margin-bottom: 12px;
    }

    .s1-dash-metrics {
        gap: 8px;
    }

    .s1-dash-metric {
        padding: 10px 12px;
        border-radius: 10px;
    }

    .s1-dash-metric__value {
        font-size: 1.3rem;
    }

    .s1-dash-metric__label {
        font-size: 0.75rem;
    }

    .s1-dash-metric__icon {
        font-size: 1.1rem;
    }
}

/* ============================================
   Responsive: Large phones (<=480px)
   ============================================ */
@media (max-width: 480px) {
    .s1-headline {
        font-size: clamp(1.7rem, 7vw, 2.2rem);
    }

    .s1-subtitle {
        font-size: 0.85rem;
    }

    .s1-badge {
        padding: 6px 16px;
    }

    .s1-badge__text {
        font-size: 0.8rem;
    }
}

/* ============================================
   Responsive: Small phones (<=400px)
   ============================================ */
@media (max-width: 400px) {
    .s1 {
        padding: 0 0 12px;
    }

    .container.hero-container {
        padding: 0 16px;
    }

    .s1-content {
        gap: 12px;
    }

    .s1-headline {
        font-size: clamp(1.5rem, 7.5vw, 2rem);
    }

    .s1-subtitle {
        font-size: 0.8rem;
        margin-top: 8px;
    }

    .s1-badge {
        padding: 6px 14px;
        max-width: 100%;
    }

    .s1-badge__text {
        font-size: 0.75rem;
    }

    .s1-dash {
        padding: 12px;
    }

    .s1-dash__header {
        flex-wrap: wrap;
        gap: 4px;
    }

    .s1-dash__title {
        font-size: 0.75rem;
    }

    .s1-chart {
        margin-left: -12px;
        margin-right: -12px;
        height: 90px;
        padding: 8px 4px 16px;
        margin-bottom: 8px;
    }

    .s1-dash-metric {
        padding: 8px 10px;
    }

    .s1-dash-metric__value {
        font-size: 1.15rem;
    }

    .s1-dash-metric__label {
        font-size: 0.7rem;
    }

    .s1-cta-row {
        margin-top: 14px;
    }

    .s1-cta-primary {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .s1-clients {
        padding: 4px 0 0;
        gap: 6px;
    }

    .s1-clients__track {
        gap: 20px;
    }

    .s1-clients__logo {
        height: 30px;
    }

    .s1-clients__logo[alt="Biopharma"],
    .s1-clients__logo[alt="Espresso Day"] {
        max-width: 96px;
        height: auto;
        max-height: 30px;
    }

    .s1-clients__logo[alt="Hani"] {
        max-width: 68px;
        height: auto;
        max-height: 30px;
    }

    .s1-clients__label {
        font-size: 0.85rem;
    }
}

/* ============================================
   Short viewports (iPhone SE Safari toolbar)
   ============================================ */
@media (max-height: 600px) and (max-width: 768px) {
    .s1 {
        padding: 0 0 6px;
    }

    .s1-content {
        gap: 8px;
    }

    .s1-headline {
        font-size: clamp(1.3rem, 5.5vw, 1.7rem);
    }

    .s1-subtitle {
        display: none;
    }

    .s1-badge {
        margin-bottom: 8px;
    }

    .s1-cta-primary {
        padding: 10px 24px;
        font-size: 0.85rem;
    }

    .s1-chart {
        height: 70px;
        padding: 6px 4px 14px;
        margin-bottom: 6px;
    }

    .s1-dash {
        padding: 10px;
    }

    .s1-dash__header {
        margin-bottom: 6px;
    }

    .s1-dash-metric {
        padding: 6px 8px;
    }

    .s1-dash-metric__value {
        font-size: 1rem;
    }

    .s1-dash-metric__icon {
        font-size: 0.9rem;
    }

    .s1-clients {
        padding: 2px 0 0;
        gap: 4px;
    }

    .s1-clients__logo {
        height: 26px;
    }

    .s1-clients__logo[alt="Biopharma"],
    .s1-clients__logo[alt="Espresso Day"] {
        max-width: 84px;
        height: auto;
        max-height: 26px;
    }

    .s1-clients__logo[alt="Hani"] {
        max-width: 60px;
        height: auto;
        max-height: 26px;
    }

    .s1-clients__label {
        font-size: 0.8rem;
    }
}

/* ============================================
   DEV MODE
   ============================================ */
body.dev-mode .s1 {
    outline: 2px solid cyan !important;
}

body.dev-mode .s1-text {
    outline: 2px dashed #ff0 !important;
}

body.dev-mode .s1-dashboard {
    outline: 2px solid lime !important;
}
