/* ==========================================================================
   HELIOTROPE
   Design Philosophy: Good design is as little design as possible.
   ========================================================================== */

:root {
    /* Color: Restrained. Purposeful. */
    --ink: #1a1a1a;
    --paper: #fafafa;
    --muted: #737373;
    --rule: #e5e5e5;
    --accent: #c45a2c;

    /* Spacing: 8px grid */
    --space-xs: 0.5rem;    /* 8px */
    --space-sm: 1rem;      /* 16px */
    --space-md: 1.5rem;    /* 24px */
    --space-lg: 2rem;      /* 32px */
    --space-xl: 3rem;      /* 48px */
    --space-2xl: 4rem;     /* 64px */
    --space-3xl: 6rem;     /* 96px */

    /* Typography: 1.25 ratio */
    --text-sm: 0.875rem;   /* 14px */
    --text-base: 1rem;     /* 16px */
    --text-lg: 1.125rem;   /* 18px */
    --text-xl: 1.25rem;    /* 20px */
    --text-2xl: 1.5rem;    /* 24px */

    /* Measure */
    --measure: 38rem;      /* ~65 characters */
}

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

/* Custom Cursor: ☉ */
html {
    cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'><text x='50%' y='50%' dominant-baseline='central' text-anchor='middle' font-size='32' fill='%23FF6300'>☉</text></svg>") 24 24, auto;
}

/* Text Selection */
::selection {
    background: #FF6300;
    color: var(--paper);
}

/* Base */
html {
    font-size: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   MAIN
   ========================================================================== */

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   MANIFESTO
   ========================================================================== */

.manifesto {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: var(--measure);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Desktop Hero */
.desktop-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-xl) 0;
}

.desktop-logo-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.desktop-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #FF6300;
    flex-shrink: 0;
}

.desktop-intro {
    margin: var(--space-2xl) 0 var(--space-xl);
    max-width: 520px;
}

.desktop-intro p {
    margin-bottom: var(--space-md);
    color: var(--ink);
    line-height: 1.7;
}

.desktop-intro p:first-child {
    font-size: var(--text-lg);
    color: var(--ink);
}

.desktop-intro p:last-child {
    margin-bottom: 0;
}

.desktop-buttons {
    display: flex;
    gap: var(--space-sm);
}

.cta-button-secondary {
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: transparent;
    border: none;
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: color 0.15s ease;
}

.cta-button-secondary:hover {
    color: var(--ink);
}

/* Desktop Expanded Content */
.desktop-expanded {
    display: none;
    padding-top: var(--space-3xl);
}

.desktop-expanded.visible {
    display: block;
}

.manifesto h1 {
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-align: left;
    margin-bottom: 0;
    color: var(--ink);
}

.manifesto .subhead {
    font-size: var(--text-base);
    font-weight: 400;
    font-style: normal;
    color: var(--muted);
    text-align: left;
    margin-bottom: 0;
}

.manifesto .subhead em {
    font-style: normal;
}

.divider-sun {
    display: none;
}

/* Chapter */
.chapter {
    margin-bottom: var(--space-2xl);
}

.chapter p {
    font-size: var(--text-lg);
    line-height: 1.75;
    margin-bottom: var(--space-md);
    max-width: none;
}

.chapter p:last-child {
    margin-bottom: 0;
}

.chapter strong {
    font-weight: 500;
}

.chapter em {
    font-style: italic;
}

/* Horizontal rules */
.manifesto hr {
    border: none;
    height: 1px;
    background: var(--rule);
    margin: var(--space-2xl) 0;
}

/* Links */
a {
    color: #FF6300;
    text-decoration: none;
}

a:hover {
    opacity: 0.7;
}

/* ==========================================================================
   ABOUT PAGE
   ========================================================================== */

.about-page {
    max-width: var(--measure);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
}

.about-hero {
    padding: var(--space-xl) 0;
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid var(--rule);
}

.about-hero h1 {
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--ink);
}

.about-section {
    padding-bottom: var(--space-xl);
    margin-bottom: var(--space-xl);
    border-bottom: 1px solid var(--rule);
}

.about-section:last-of-type {
    border-bottom: none;
}

.about-section p {
    font-size: var(--text-lg);
    line-height: 1.75;
    margin-bottom: var(--space-md);
}

.about-section p:last-of-type {
    margin-bottom: 0;
}

/* CTA */
.cta-section {
    padding: var(--space-lg) 0 var(--space-3xl);
}

.cta-button {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--paper);
    background: #FF6300;
    padding: var(--space-sm) var(--space-lg);
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.cta-button:hover {
    opacity: 0.8;
}

/* CTA visibility: desktop vs mobile */
.cta-desktop {
    margin-top: var(--space-xl);
}

.cta-mobile {
    display: none;
}

@media (max-width: 640px) {
    .desktop-hero {
        display: none;
    }
    .desktop-expanded {
        display: none !important;
    }
    .cta-desktop {
        display: none;
        margin-top: 0;
    }
    .cta-mobile {
        display: block;
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-sm);
    color: var(--muted);
    border-top: 1px solid var(--rule);
}

footer a {
    color: var(--muted);
}

footer a:hover {
    color: var(--ink);
}

.social-icons {
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: color 0.15s ease;
}

.social-icons a:hover {
    color: #FF6300;
    opacity: 1;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 640px) {
    :root {
        --text-lg: 1rem;
    }

    main {
        margin-top: var(--space-lg);
    }

    .manifesto {
        padding: var(--space-lg) var(--space-md) var(--space-2xl);
    }

    .manifesto .subhead {
        margin-bottom: var(--space-2xl);
    }

    .about-page {
        padding: var(--space-lg) var(--space-md);
    }

    footer {
        padding: var(--space-sm) var(--space-md);
        flex-direction: column;
        gap: var(--space-xs);
    }
}

/* ==========================================================================
   MOBILE LANDING
   First screen on mobile before stories mode
   ========================================================================== */

.mobile-landing {
    display: none;
}

.landing-mode .mobile-landing {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--paper);
    z-index: 300;
    padding: var(--space-xl) var(--space-md) var(--space-xl);
}

.landing-mode main,
.landing-mode footer {
    display: none;
}

.landing-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 var(--space-xs);
}

.landing-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.landing-header h1 {
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.08em;
    margin: 0;
}

.landing-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #FF6300;
    flex-shrink: 0;
}

.landing-subhead {
    font-size: var(--text-base);
    color: var(--muted);
    margin-bottom: var(--space-xl);
}

.landing-text {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--ink);
}

.landing-text p {
    margin-bottom: var(--space-sm);
}

.landing-text p:last-child {
    margin-bottom: 0;
    }

.landing-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: 0 var(--space-xs);
    margin-top: var(--space-xl);
}

.landing-btn {
    display: block;
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-base);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s ease;
}

.landing-btn:hover {
    opacity: 0.85;
}

.landing-btn-primary {
    background: #FF6300;
    color: var(--paper);
}

.landing-btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--rule);
}

.landing-btn-secondary:hover {
    border-color: var(--muted);
}

/* ==========================================================================
   STORIES MODE (Mobile)
   Instagram-style swipe/tap navigation
   ========================================================================== */

/* Hidden by default */
.stories-header,
.tap-zone {
    display: none;
}

/* Also hide landing in stories mode */
.stories-mode .mobile-landing {
    display: none;
}

/* Stories Mode Active */
.stories-mode {
    overflow: hidden;
}

/* Override mobile hiding for stories mode */
.stories-mode .desktop-expanded {
    display: block !important;
}

/* Stories Header */
.stories-mode .stories-header {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--paper);
    padding: 12px;
}

/* Top Row: Profile + Social Icons */
.stories-mode .stories-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stories-mode .profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FF6300;
    color: var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.stories-mode .profile-pic:hover {
    transform: scale(1.05);
}

.stories-mode .profile-pic:active {
    transform: scale(0.95);
}

.stories-mode .stories-social {
    display: flex;
    gap: 16px;
    align-items: center;
}

.stories-mode .stories-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    opacity: 0.6;
}

.stories-mode .stories-social a:hover {
    opacity: 1;
    color: #FF6300;
}

/* Progress Bar */
.stories-mode .stories-progress {
    display: flex;
    gap: 4px;
}

.stories-mode .progress-segment {
    flex: 1;
    height: 2px;
    background: var(--rule);
    border-radius: 2px;
    overflow: hidden;
}

.stories-mode .progress-fill {
    width: 0%;
    height: 100%;
    background: #FF6300;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.stories-mode .progress-segment.complete .progress-fill {
    width: 100%;
}

.stories-mode .progress-segment.active .progress-fill {
    width: 100%;
    animation: progress-fill 8s linear forwards;
}

@keyframes progress-fill {
    from { width: 0%; }
    to { width: 100%; }
}

/* Tap Zones - hidden, using document click instead */
.tap-zone {
    display: none !important;
}

/* Main Content in Stories Mode */
.stories-mode main {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    overflow: hidden;
}

.stories-mode .manifesto {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.stories-mode .manifesto h1,
.stories-mode .manifesto .subhead,
.stories-mode .desktop-hero,
.stories-mode .desktop-logo-row {
    display: none;
}

.stories-mode .manifesto hr {
    display: none;
}

/* Chapters as Slides */
.stories-mode .chapter {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    padding: var(--space-xl) var(--space-md);
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.stories-mode .chapter.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%);
    z-index: 160;
}

.stories-mode .chapter.prev {
    opacity: 0;
    transform: translateY(-50%) translateX(-20px);
}

.stories-mode .chapter.next {
    opacity: 0;
    transform: translateY(-50%) translateX(20px);
}

.stories-mode .chapter p {
    font-size: var(--text-base);
    line-height: 1.65;
    margin-bottom: var(--space-sm);
}

.stories-mode .chapter .cta-mobile {
    margin-top: var(--space-lg);
}

.stories-mode .chapter .cta-mobile .cta-button {
    display: inline-block;
}

/* Footer hidden in Stories Mode */
.stories-mode footer {
    display: none;
}