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

   Principles:
   - Constraint-driven: identify structural limits before building
   - Felt experience > technical correctness: watch it 10 times
   - Animation restraint: animate state changes, not decorations
   - Hierarchy through color, not just size
   - If removing the animation doesn't hurt comprehension, remove it
   ========================================================================== */

/* Typography: Inter font family */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Color: Restrained. Purposeful. */
    --ink: #1a1a1a;
    --paper: #FFFFFF;
    --muted: #737373;
    --rule: #e5e5e5;
    --accent: #FF6300;
    --focus-ring: rgba(255, 99, 0, 0.4);

    /* Hierarchy through color intensity */
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --text-tertiary: rgba(115, 115, 115, 0.7);

    /* Interactive surfaces */
    --hover-surface: rgba(0, 0, 0, 0.02);

    /* 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 */

    /* Animation: Per Design System Style Guide */
    --duration-instant: 100ms;
    --duration-fast: 150ms;
    --duration-normal: 200ms;
    --duration-slow: 300ms;

    /* Easing curves */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

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

body {
    /* Inter - per Design System Style Guide */
    font-family: "Inter", "SF Pro Display", -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", 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;
    /* Improve text rendering */
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1;
}

/* ==========================================================================
   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;
    min-height: 100vh;
    min-height: 100dvh; /* Use dynamic viewport height for better mobile support */
}

/* Smooth scroll for anchor navigation */
html {
    scroll-behavior: smooth;
}

.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: var(--accent);
    flex-shrink: 0;
}

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

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

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

.desktop-cta {
    margin-top: var(--space-xl);
}

.desktop-cta .eager-cta {
    margin-bottom: var(--space-sm);
}

.cta-prompt {
    color: var(--muted);
    margin-bottom: var(--space-lg);
}

.divider-symbol {
    color: var(--ink);
    font-size: var(--text-lg);
    margin: var(--space-lg) 0;
}

/* Learn More inline link - matches connect link style */
/* "See if we're a fit" link - muted color, distinct from primary CTA */
.learn-more-link,
a.learn-more-link {
    color: var(--muted) !important;
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
    border-radius: 2px;
}

.learn-more-link:hover,
a.learn-more-link:hover {
    color: var(--ink) !important;
}

.learn-more-link:active,
a.learn-more-link:active {
    color: var(--ink) !important;
    opacity: 0.7;
}

.learn-more-link:focus-visible,
a.learn-more-link:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Desktop Expanded Content - Always visible, scrollable */
.desktop-expanded {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
}

.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;
}

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

.chapter h2 {
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: var(--space-md);
}

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

.cta-link {
    display: inline-block;
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--duration-fast) var(--ease-out);
    border-radius: 2px;
}

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

.cta-link:active {
    opacity: 0.6;
}

.cta-link:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

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


/* Ensure strong tags always render as bold */
.chapter p strong {
    font-weight: 700;
}

.chapter-body {
    font-weight: 400;
}

/* For final section with email, bold the line before it */
.chapter:has(.email-copy) p:nth-last-of-type(2) {
    font-weight: 500;
}

.chapter strong {
    font-weight: 500;
}

.chapter em {
    font-style: italic;
}

/* Chapter list styling */
.chapter-list {
    list-style: none;
    padding: 0;
    margin: var(--space-md) 0 0 0;
}

.chapter-list li {
    position: relative;
    padding-left: 1.25em;
    margin-bottom: var(--space-sm);
    line-height: 1.7;
}

.chapter-list li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--muted);
}

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

/* Chapter note (italic emphasis) */
.chapter-note {
    font-style: italic;
    color: var(--muted);
    margin-top: var(--space-md);
}

/* Chapter outro styling */
.chapter-outro {
    font-size: var(--text-lg);
}

.chapter-outro-final {
    font-style: italic;
    color: var(--muted);
    margin-top: var(--space-sm);
}

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

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--duration-fast) var(--ease-out);
    border-radius: 2px;
}

a:active {
    opacity: 0.7;
}

a:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* ==========================================================================
   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;
}


/* ==========================================================================
   EMAIL COPY FEEDBACK
   ========================================================================== */

.email-copy {
    cursor: pointer;
    display: inline-block;
    position: relative;
    font-size: var(--text-sm);
    color: var(--muted);
    user-select: none;
    -webkit-user-select: none;
    transition: color var(--duration-fast) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    border-radius: 2px;
}

.email-copy:hover {
    color: var(--accent);
}

.email-copy:active {
    opacity: 0.7;
}

.email-copy:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.email-text {
    transition: opacity var(--duration-fast) var(--ease-out);
}

.email-copied {
    position: absolute;
    left: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    color: var(--accent);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
    white-space: nowrap;
}

.email-copy.copied .email-text {
    opacity: 0;
}

.email-copy.copied .email-copied {
    opacity: 1;
    transform: scale(1);
}

.checkmark {
    width: 0.9em;
    height: 0.9em;
    stroke: var(--accent);
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
}

.email-copy.copied .checkmark {
    animation: checkmark-draw 0.3s ease forwards;
}

@keyframes checkmark-draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* REMOVED: Mobile hiding rules - now using unified scrollable layout */

/* ==========================================================================
   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);
}


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

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Apple HIG: 44pt minimum touch target */
    min-width: 44px;
    min-height: 44px;
    color: var(--muted);
    transition: color var(--duration-fast) var(--ease-out);
    border-radius: 50%;
}

.social-icons a:hover {
    opacity: 1;
    color: var(--ink);
}

.social-icons a:active {
    opacity: 0.6;
    transform: scale(0.95);
}

.social-icons a:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

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

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

    main {
        margin-top: 0;
    }

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

    /* Mobile hero - full viewport with safe area support */
    .desktop-hero {
        padding: var(--space-xl) 0;
        padding-top: calc(var(--space-xl) + env(safe-area-inset-top, 0px));
        padding-bottom: var(--space-xl);
    }

    .desktop-intro {
        margin: var(--space-xl) 0 var(--space-lg);
    }

    .desktop-intro p {
        margin-bottom: var(--space-md);
    }

    .desktop-cta {
        margin-top: var(--space-lg);
    }

    .manifesto .subhead {
        margin-bottom: 0;
    }

    /* Mobile expanded content */
    .desktop-expanded {
        padding-top: var(--space-2xl);
        padding-bottom: calc(var(--space-2xl) + env(safe-area-inset-bottom, 0px));
    }

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

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

/* ==========================================================================
   COMMENTED OUT: MOBILE LANDING (stories feature disabled)
   ========================================================================== */

/*
.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: calc(var(--space-xl) + env(safe-area-inset-top, 0px)) 
             calc(var(--space-md) + env(safe-area-inset-right, 0px)) 
             calc(var(--space-2xl) + env(safe-area-inset-bottom, 0px))
             calc(var(--space-md) + env(safe-area-inset-left, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.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: var(--accent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--paper);
    font-size: 16px;
    line-height: 1;
}

.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-md);
}

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

.eager-cta {
    color: var(--muted);
    margin-bottom: var(--space-xs);
}

.landing-cta {
    margin-top: var(--space-xl);
    padding-bottom: var(--space-lg);
}

.landing-cta .eager-cta {
    margin-bottom: 0;
    padding: 0 var(--space-xs);
    line-height: 1.8;
}

.landing-cta .eager-cta a {
    text-decoration: none;
    display: inline-block;
    min-height: 44px;
    padding: 10px 4px;
    margin: -10px -4px;
}

.landing-cta .eager-cta a:first-of-type {
    color: var(--accent);
}

.landing-cta .eager-cta .learn-more-link {
    color: var(--muted);
}

.landing-cta .eager-cta .learn-more-link:hover {
    color: var(--ink);
}

.landing-cta .eager-cta .learn-more-link:active {
    color: var(--ink);
    opacity: 0.7;
}
*/

/* ==========================================================================
   COMMENTED OUT: STORIES MODE (stories feature disabled)
   ========================================================================== */

/*
.stories-header {
    display: none;
}

.stories-mode .mobile-landing {
    display: none;
}

.stories-mode {
    overflow: hidden;
}

.stories-mode .desktop-expanded {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    padding: 0 !important;
    z-index: 150;
}

.stories-mode .stories-header {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--paper);
    padding: 12px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
}

.stories-mode .stories-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

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

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

.stories-mode .stories-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: var(--ink);
    opacity: 0.6;
    border-radius: 50%;
}

.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: var(--accent);
    border-radius: 2px;
}

.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%; }
}

.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;
}

.stories-mode .chapter {
    position: absolute;
    top: calc(78px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    bottom: env(safe-area-inset-bottom, 0px);
    padding: var(--space-lg) var(--space-md);
    margin: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--paper);
}

.stories-mode .chapter.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto;
    z-index: 160;
}

.stories-mode .chapter.prev {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-20px);
    z-index: 150;
}

.stories-mode .chapter.next {
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    z-index: 150;
}

.stories-mode .chapter > * {
    flex-shrink: 0;
}

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

.stories-mode footer {
    display: none;
}

.mobile-fab {
    display: none;
    position: fixed;
    bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
    right: var(--space-md);
    min-width: 44px;
    min-height: 44px;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 22px;
    background: var(--paper);
    color: var(--ink);
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--rule);
    z-index: 1000;
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
}

.mobile-fab svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 640px) {
    .stories-mode .mobile-fab {
        display: flex;
    }
}
*/

/* ==========================================================================
   AUTH GATE PATTERN
   Standard structure for password-protected pages

   Structure:
   - .auth-gate: fullscreen centered container
   - .auth-container: max-width 360px, centered
   - .logo-row: heliotrope branding (circle + wordmark)
   - .auth-company: company name, prominent (1.25rem, 600 weight)
   - .auth-title: document type, subdued (0.75rem, uppercase, muted)
   - .auth-form: password input + submit button

   Spacing:
   - Logo row margin-bottom: 2rem
   - Company name margin-bottom: 0.25rem
   - Title margin-bottom: 2rem (consistent across all auth pages)

   Colors use design system variables:
   - --accent for submit button and focus states
   - --muted for secondary text and back links
   - --rule for input borders
   ========================================================================== */