/* ==========================================================================
   Inkfeed Landing — style.css
   E-ink-inspired aesthetic. Graceful degradation without JS.
   ========================================================================== */

/* ==========================================================================
   1. Custom Properties
   ========================================================================== */

:root {
    color-scheme: light dark;

    --bg:             #f5f5f0;
    --bg-card:        #ffffff;
    --bg-alt:         #eceee8;
    --text:           #1a1a1a;
    --text-secondary: #555555;
    --text-muted:     #888888;
    --accent:         #ff6600;
    --accent-hover:   #e05500;
    --kagi:           #6285f0;
    --border:         #d8d8d0;
    --border-light:   #e8e8e2;

    --font-body:  Georgia, 'Times New Roman', serif;
    --font-mono:  'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

    --container:  860px;
    --gap:        24px;
    --radius:     8px;
    --radius-sm:  4px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg:             #1a1a1a;
        --bg-card:        #242424;
        --bg-alt:         #212121;
        --text:           #d4d4d4;
        --text-secondary: #aaaaaa;
        --text-muted:     #777777;
        --accent:         #ff8c33;
        --accent-hover:   #ffa050;
        --kagi:           #809df5;
        --border:         #333333;
        --border-light:   #2e2e2e;
    }
}


/* ==========================================================================
   2. Reset & Base
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg {
    display: block;
    max-width: 100%;
}

ul {
    list-style: none;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}


/* ==========================================================================
   3. Layout
   ========================================================================== */

.container {
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gap);
}

.section {
    padding: 80px 0;
}

.section-alt {
    background-color: var(--bg-alt);
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 48px;
    letter-spacing: -0.02em;
}


/* ==========================================================================
   4. Buttons
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 14px 36px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius);
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.25);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 16px rgba(255, 102, 0, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    background-color: var(--bg-alt);
}

.btn-large {
    padding: 18px 48px;
    font-size: 1.15rem;
}


/* ==========================================================================
   5. Hero
   ========================================================================== */

.hero {
    padding: 80px 0 60px;
    min-height: 85vh;
    display: flex;
    align-items: center;
}

.hero-inner {
    display: flex;
    align-items: center;
    gap: 64px;
}

.hero-text {
    flex: 1;
    min-width: 0;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.accent {
    color: var(--accent);
}

.hero-tagline {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-style: italic;
}

.hero-desc {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 440px;
}

.hero-actions,
.cta-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cta-actions {
    justify-content: center;
}


/* ==========================================================================
   6. Device Mockup
   ========================================================================== */

.hero-device {
    flex-shrink: 0;
}

.device-frame {
    width: 260px;
    background: #2d2d2d;
    border-radius: 20px;
    padding: 14px;
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.08),
        0 12px 40px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.device-screen {
    background: #e8e6de;
    border-radius: var(--radius-sm);
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
    min-height: 340px;
}

.device-content {
    position: relative;
    z-index: 1;
}

.screen-header {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 700;
    color: #c45500;
    margin-bottom: 4px;
}

.screen-date {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 20px;
}

.screen-list {
    border-top: 1px solid #d0cec6;
}

.screen-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #d0cec6;
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: #333;
}

.screen-label {
    font-weight: 600;
}

.screen-count {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #888;
}

.device-chin {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    margin: 14px auto 4px;
}


/* ==========================================================================
   7. E-Ink Refresh Animation
   ========================================================================== */

.eink-flash {
    position: absolute;
    inset: 0;
    background: #1a1a1a;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

/* With JS: flash starts visible, then animates away */
.js-enabled .eink-flash {
    opacity: 1;
}

.eink-flash.refreshing {
    animation: eink-refresh 1.6s ease-out forwards;
}

@keyframes eink-refresh {
    0%   { opacity: 1; }
    18%  { opacity: 0.1; }
    30%  { opacity: 0.85; }
    50%  { opacity: 0.05; }
    65%  { opacity: 0.6; }
    80%  { opacity: 0; }
    100% { opacity: 0; }
}


/* ==========================================================================
   8. Contrast Section (Problem / Solution)
   ========================================================================== */

.contrast-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.contrast-card {
    padding: 32px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

.contrast-card h2 {
    font-size: 1.35rem;
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.contrast-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.illustration {
    margin-bottom: 20px;
}

.illust-svg {
    width: 100%;
    max-height: 140px;
}



/* ==========================================================================
   9. How It Works
   ========================================================================== */

.steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
}

.step {
    text-align: center;
    flex: 1;
    max-width: 220px;
    padding: 16px;
}

.step-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.step-icon svg {
    width: 100%;
    height: 100%;
}

.step h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.step p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-arrow {
    display: flex;
    align-items: center;
    padding-top: 36px;
    color: var(--text-muted);
}

.step-arrow svg {
    width: 32px;
    height: 32px;
}


/* ==========================================================================
   10. Features Grid
   ========================================================================== */

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

.feature-card {
    padding: 28px 24px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    border-color: var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.feature-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
    color: var(--text);
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-card h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
}


/* ==========================================================================
   11. Sources
   ========================================================================== */

.sources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
}

.source-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    transition: border-color 0.2s ease;
}

.source-badge:hover {
    border-color: var(--border);
}

.source-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.source-icon svg {
    width: 100%;
    height: 100%;
}

.source-info h3 {
    font-size: 0.92rem;
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}

.source-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}


/* ==========================================================================
   12. Output Formats
   ========================================================================== */

.formats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.format-card {
    text-align: center;
    padding: 28px 16px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.format-card:hover {
    border-color: var(--border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.format-badge {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
    opacity: 0.6;
    margin-bottom: 10px;
}

.format-card h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.format-card p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}


/* ==========================================================================
   13. CTA Section
   ========================================================================== */

.cta-section {
    text-align: center;
    padding: 100px 0;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.cta-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}


/* ==========================================================================
   14. Footer
   ========================================================================== */

.footer {
    padding: 32px 0;
    background: var(--bg-alt);
    text-align: center;
}

.footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}


/* ==========================================================================
   15. Progressive Enhancement — Scroll Reveal
   Without JS: everything is visible (no .js-enabled = no hiding).
   With JS: elements start hidden, revealed on scroll.
   ========================================================================== */

.js-enabled .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-enabled .reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid children */
.js-enabled .features-grid .feature-card:nth-child(2) { transition-delay: 0.08s; }
.js-enabled .features-grid .feature-card:nth-child(3) { transition-delay: 0.16s; }
.js-enabled .features-grid .feature-card:nth-child(4) { transition-delay: 0.24s; }
.js-enabled .features-grid .feature-card:nth-child(5) { transition-delay: 0.32s; }
.js-enabled .features-grid .feature-card:nth-child(6) { transition-delay: 0.40s; }

.js-enabled .contrast-grid .contrast-card:nth-child(2) { transition-delay: 0.12s; }

.js-enabled .steps .step:nth-child(3) { transition-delay: 0.1s; }
.js-enabled .steps .step-arrow:nth-child(2) { transition-delay: 0.05s; }
.js-enabled .steps .step:nth-child(5) { transition-delay: 0.2s; }
.js-enabled .steps .step-arrow:nth-child(4) { transition-delay: 0.15s; }


/* ==========================================================================
   16. Responsive
   ========================================================================== */

/* Tablet and below */
@media (max-width: 900px) {
    .hero {
        min-height: auto;
        padding: 60px 0 40px;
    }

    .hero-inner {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-desc {
        margin-inline: auto;
    }

    .contrast-grid {
        grid-template-columns: 1fr;
    }

    .steps {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .step {
        max-width: 320px;
    }

    .step-arrow {
        padding-top: 0;
        transform: rotate(90deg);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sources-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-inline: auto;
    }

    .formats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 36px;
    }
}

/* Mobile */
@media (max-width: 560px) {
    .hero-title {
        font-size: 2.4rem;
    }

    .hero-tagline {
        font-size: 1.2rem;
    }

    .hero-desc {
        font-size: 1rem;
    }

    .device-frame {
        width: 220px;
    }

    .device-screen {
        min-height: 280px;
        padding: 18px 16px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .formats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        padding: 48px 0;
    }

    .cta-section {
        padding: 60px 0;
    }

    .cta-section h2 {
        font-size: 1.6rem;
    }

    .btn {
        padding: 12px 28px;
        font-size: 1rem;
    }

    .btn-large {
        padding: 14px 36px;
        font-size: 1.05rem;
    }

    .contrast-card {
        padding: 24px 20px;
    }

    .format-card {
        padding: 20px 12px;
    }
}
