/* ============================================
   ColloidNote — Landing Page
   Light, editorial, scholarly
   ============================================ */

/* ── Design Tokens ────────────────────────── */
:root {
    --color-bg: #FAFAF7;
    --color-bg-alt: #F2F1EC;
    --color-surface: #FFFFFF;

    --text-primary: #1a1918;
    --text-secondary: rgba(26, 25, 24, 0.52);
    --text-tertiary: rgba(26, 25, 24, 0.3);

    --color-accent: #c9714a;
    --color-accent-hover: #b5623d;
    --color-accent-subtle: rgba(201, 113, 74, 0.07);

    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-hover: rgba(0, 0, 0, 0.16);

    --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --max-width: 1120px;
    --section-gap: clamp(100px, 14vw, 180px);
    --gutter: clamp(20px, 5vw, 40px);

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    --shadow-md: 0 2px 4px rgba(0,0,0,0.04), 0 8px 28px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 8px rgba(0,0,0,0.05), 0 16px 48px rgba(0,0,0,0.08);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a { color: inherit; }
img { display: block; max-width: 100%; }

a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

/* ── Grain — disabled ─────────────────────── */
.grain-overlay { display: none; }

/* ── Navigation ───────────────────────────── */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 var(--gutter);
    transition: background-color 0.4s, border-color 0.4s, backdrop-filter 0.4s;
    border-bottom: 1px solid transparent;
}

.site-nav.scrolled {
    background: rgba(250, 250, 247, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom-color: var(--color-border);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}

.nav-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

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

.nav-link {
    text-decoration: none;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.25s;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-download {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 20px;
    background: var(--text-primary);
    color: var(--color-bg);
    border-radius: 8px;
    transition: opacity 0.25s, transform 0.25s;
}

.nav-download:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* ── Hero ─────────────────────────────────── */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 100px var(--gutter) 60px;
    overflow: hidden;
}

.hero-watermark {
    position: absolute;
    width: min(55vw, 640px);
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    user-select: none;
    opacity: 0.04;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 720px;
    position: relative;
    z-index: 1;
}

/* Hero logo */
.hero-logo {
    position: relative;
    margin-bottom: 32px;
    opacity: 0;
    animation: heroFadeScale 1s var(--ease-out) 0.15s both;
}

.hero-logo-img {
    width: 176px;
    height: 176px;
    border-radius: 44px;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-lg);
}

.hero-logo-glow {
    display: none;
}

/* Hero badge */
.hero-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-accent);
    padding: 6px 16px;
    border: 1px solid rgba(201, 113, 74, 0.3);
    border-radius: 100px;
    margin-bottom: 28px;
    opacity: 0;
    animation: heroSlideDown 0.8s var(--ease-out) 0.3s both;
}

/* Hero title */
.hero-title {
    font-family: var(--font-display);
    font-weight: 300;
    font-size: clamp(3rem, 11vw, 6.5rem);
    line-height: 0.92;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.hero-line {
    display: block;
    opacity: 0;
    animation: heroSlideUp 0.9s var(--ease-out) both;
}

.hero-line:nth-child(1) { animation-delay: 0.4s; }
.hero-line:nth-child(2) { animation-delay: 0.55s; }

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

/* Hero subtitle — italic serif for variety */
.hero-subtitle {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1rem, 2.4vw, 1.2rem);
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 540px;
    margin-bottom: 40px;
    opacity: 0;
    animation: heroSlideUp 0.9s var(--ease-out) 0.7s both;
}

/* Hero actions */
.hero-actions {
    opacity: 0;
    animation: heroSlideUp 0.9s var(--ease-out) 0.9s both;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    opacity: 0;
    animation: fadeIn 1s var(--ease-out) 1.3s both;
}

.scroll-text {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    letter-spacing: 0.04em;
}

.scroll-line {
    width: 1px;
    height: 44px;
    background: linear-gradient(to bottom, var(--color-accent), transparent);
    animation: scrollPulse 2.5s var(--ease-in-out) infinite;
}

/* ── App Store Badge ──────────────────────── */
.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    padding: 10px 22px 10px 16px;
    background: #000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 13px;
    text-decoration: none;
    color: #fff;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.store-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
}

.store-badge:active {
    transform: translateY(-1px);
}

.apple-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.store-badge-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.store-badge-eyebrow {
    font-size: 0.55rem;
    letter-spacing: 0.02em;
    line-height: 1;
    opacity: 0.85;
    margin-bottom: 1px;
}

.store-badge-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.store-badge-lg {
    padding: 13px 28px 13px 20px;
}

.store-badge-lg .apple-icon {
    width: 26px;
    height: 26px;
}

.store-badge-lg .store-badge-title {
    font-size: 1.4rem;
}

/* ── Section Utilities ────────────────────── */
.section-header {
    text-align: center;
    margin-bottom: 56px;
}

/* Italic serif label — typographic variety */
.section-label {
    display: inline-block;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--color-accent);
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 4.5vw, 2.6rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary);
}

/* Thin accent rule under section headers */
.section-header::after {
    content: '';
    display: block;
    width: 36px;
    height: 1px;
    background: var(--color-accent);
    margin: 24px auto 0;
    opacity: 0.5;
}

/* ── Video Theater ────────────────────────── */
.video-theater {
    position: relative;
    background: #D28367;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.theater-video {
    display: flex;
    justify-content: center;
}

.theater-video video {
    display: block;
    max-height: 85vh;
    width: auto;
    vertical-align: bottom;
}

.video-progress {
    width: 50%;
    max-width: calc(80vh * 1640 / 2360 * 0.5);
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin: 16px auto 0;
    cursor: pointer;
    position: relative;
    transition: height 0.2s;
}

.video-progress:hover {
    height: 5px;
}

.video-progress-fill {
    height: 100%;
    background: var(--color-accent);
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
    transition: none;
}

.video-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    cursor: pointer;
    transition: background 0.4s, opacity 0.4s;
    z-index: 2;
}

.video-play-btn svg {
    width: 72px;
    height: 72px;
    transition: transform 0.35s var(--ease-out);
}

.video-play-btn:hover svg {
    transform: scale(1.12);
}

.video-play-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ── Gallery ──────────────────────────────── */
.gallery {
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
}

.gallery .section-header {
    padding: 0 var(--gutter);
}

.gallery-viewport {
    position: relative;
}

.gallery-viewport::before,
.gallery-viewport::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 2;
    pointer-events: none;
}

.gallery-viewport::before {
    left: 0;
    background: linear-gradient(to right, var(--color-bg), transparent);
}

.gallery-viewport::after {
    right: 0;
    background: linear-gradient(to left, var(--color-bg), transparent);
}

.gallery-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 8px max(24px, calc((100vw - var(--max-width)) / 2));
    padding-bottom: 16px;
    cursor: grab;
    scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
    display: none;
}

.gallery-track:active {
    cursor: grabbing;
}

.gallery-track img {
    scroll-snap-align: center;
    height: 520px;
    width: auto;
    border-radius: 18px;
    flex-shrink: 0;
    user-select: none;
    box-shadow: var(--shadow-lg);
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.gallery-track img:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08), 0 24px 60px rgba(0,0,0,0.1);
}

/* ── Features ─────────────────────────────── */
.features {
    padding: 0 var(--gutter);
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
    background: var(--color-bg-alt);
}

.features-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

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

.feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 36px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.35s, transform 0.4s var(--ease-out), box-shadow 0.4s;
}

.feature-card:hover {
    border-color: rgba(201, 113, 74, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-subtle);
    border-radius: 14px;
    color: var(--color-accent);
    margin-bottom: 22px;
    transition: transform 0.35s var(--ease-out);
}

.feature-card:hover .feature-icon {
    transform: scale(1.08) rotate(-3deg);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

/* Serif heading for feature cards */
.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

/* Sans body for feature description */
.feature-card p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Staggered reveal for feature cards */
.features-grid .feature-card:nth-child(2) { transition-delay: 0.08s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.16s; }
.features-grid .feature-card:nth-child(4) { transition-delay: 0.24s; }

/* ── Pricing ──────────────────────────────── */
.pricing {
    padding: 0 var(--gutter);
    padding-top: var(--section-gap);
    padding-bottom: var(--section-gap);
}

.pricing-inner {
    max-width: 820px;
    margin: 0 auto;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: start;
}

.price-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 40px 36px;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.price-card-pro {
    border-color: var(--color-accent);
    border-width: 2px;
}

.price-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fff;
    background: var(--color-accent);
    padding: 5px 18px;
    border-radius: 100px;
    white-space: nowrap;
}

.price-header {
    margin-bottom: 32px;
}

/* Serif for tier name */
.price-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.price-amount {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.price-currency {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--text-secondary);
    align-self: flex-start;
    margin-top: 6px;
}

/* Large serif price number */
.price-value {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.price-period {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-left: 8px;
}

.price-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 36px;
}

.price-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.price-features li::before {
    content: '\2713';
    color: var(--color-accent);
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent-subtle);
    border-radius: 50%;
}

.price-cta {
    display: block;
    text-align: center;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 14px 24px;
    border-radius: 12px;
    transition: all 0.3s var(--ease-out);
}

.price-cta-outline {
    color: var(--text-primary);
    border: 1px solid var(--color-border-hover);
    background: transparent;
}

.price-cta-outline:hover {
    border-color: var(--text-tertiary);
    background: rgba(0, 0, 0, 0.02);
    transform: translateY(-2px);
}

.price-cta-filled {
    color: #fff;
    background: var(--color-accent);
    border: 1px solid transparent;
}

.price-cta-filled:hover {
    background: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201, 113, 74, 0.2);
}

/* ── Final CTA ────────────────────────────── */
.final-cta {
    padding: var(--section-gap) var(--gutter);
    background: var(--color-bg-alt);
}

.final-cta-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.final-cta-logo {
    width: 128px;
    height: 128px;
    border-radius: 32px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-md);
}

.final-cta h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.final-cta p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 36px;
}

/* ── Footer ───────────────────────────────── */
.site-footer {
    padding: 40px var(--gutter) 36px;
    border-top: 1px solid var(--color-border);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text-tertiary);
}

.footer-logo-img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    opacity: 0.45;
}

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

.footer-links a {
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-tertiary);
    transition: color 0.25s;
}

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

.footer-copy {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ── Scroll-triggered Reveals ─────────────── */
[data-reveal] {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ── Keyframe Animations ──────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes heroFadeScale {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes heroSlideUp {
    from { opacity: 0; transform: translateY(32px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes heroSlideDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.35; transform: scaleY(1); }
    50% { opacity: 0.9; transform: scaleY(1.1); }
}

/* ── Responsive ───────────────────────────── */
@media (max-width: 1024px) {
    .gallery-track img {
        height: 440px;
    }
}

@media (max-width: 768px) {
    .nav-links .nav-link {
        display: none;
    }

    .hero {
        padding-top: 80px;
        padding-bottom: 48px;
        min-height: 100svh;
    }

    .hero-title {
        font-size: clamp(2.6rem, 13vw, 4rem);
    }

    .hero-logo-img {
        width: 144px;
        height: 144px;
    }

    .scroll-indicator {
        display: none;
    }

    .theater-video video {
        width: 100%;
    }

    .gallery-track img {
        height: 380px;
    }

    .gallery-viewport::before,
    .gallery-viewport::after {
        width: 32px;
    }

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

    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }


    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.4rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .gallery-track img {
        height: 320px;
    }

    .feature-card {
        padding: 28px 24px;
    }

    .price-card {
        padding: 32px 28px;
    }

    .price-value {
        font-size: 2.6rem;
    }
}

/* ── Reduced Motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .scroll-line {
        animation: none;
    }
}
