/* ==========================================
   CSS Variables & Theme System
   ========================================== */

:root {
    /* Typography - SF Pro for Apple-like look */
    --font-display: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Container */
    --container-max: 680px;
    --container-padding: 1.25rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Border Radius */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Header height */
    --header-height: 52px;
}

/* Light Theme */
[data-theme="light"],
:root {
    --color-bg: #ffffff;
    --color-bg-elevated: #f5f5f7;
    --color-text: #1d1d1f;
    --color-text-secondary: #515154;
    --color-text-tertiary: #86868b;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-accent: #1d1d1f;
    --color-accent-hover: #000000;

    /* Liquid Glass - Light Mode (iOS 26 style) */
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-bg-hover: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-border-outer: rgba(0, 0, 0, 0.06);
    --glass-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.04),
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 8px 24px rgba(0, 0, 0, 0.06);
    --glass-shadow-hover:
        0 0 0 1px rgba(0, 0, 0, 0.06),
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 12px 32px rgba(0, 0, 0, 0.1);
    --glass-highlight: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 50%);
    --glass-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    --glass-blur: 20px;
    --glass-saturation: 180%;
}

/* Dark Theme */
[data-theme="dark"] {
    --color-bg: #000000;
    --color-bg-elevated: #1c1c1e;
    --color-text: #f5f5f7;
    --color-text-secondary: #a1a1a6;
    --color-text-tertiary: #6e6e73;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-accent: #f5f5f7;
    --color-accent-hover: #ffffff;

    /* Liquid Glass - Dark Mode */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-bg-hover: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-border-outer: rgba(255, 255, 255, 0.04);
    --glass-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 2px 8px rgba(0, 0, 0, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.3);
    --glass-shadow-hover:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 12px 32px rgba(0, 0, 0, 0.4);
    --glass-highlight: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 50%);
    --glass-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --glass-blur: 20px;
    --glass-saturation: 180%;
}

/* System Theme */
@media (prefers-color-scheme: dark) {
    [data-theme="system"] {
        --color-bg: #000000;
        --color-bg-elevated: #1c1c1e;
        --color-text: #f5f5f7;
        --color-text-secondary: #a1a1a6;
        --color-text-tertiary: #6e6e73;
        --color-border: rgba(255, 255, 255, 0.1);
        --color-accent: #f5f5f7;
        --color-accent-hover: #ffffff;

        --glass-bg: rgba(255, 255, 255, 0.08);
        --glass-bg-hover: rgba(255, 255, 255, 0.12);
        --glass-border: rgba(255, 255, 255, 0.12);
        --glass-border-outer: rgba(255, 255, 255, 0.04);
        --glass-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.04),
            0 2px 8px rgba(0, 0, 0, 0.2),
            0 8px 24px rgba(0, 0, 0, 0.3);
        --glass-shadow-hover:
            0 0 0 1px rgba(255, 255, 255, 0.08),
            0 4px 12px rgba(0, 0, 0, 0.3),
            0 12px 32px rgba(0, 0, 0, 0.4);
        --glass-highlight: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 50%);
        --glass-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
}

/* ==========================================
   Reset & Base Styles
   ========================================== */

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

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

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color var(--transition-base), color var(--transition-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--color-accent-hover);
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ==========================================
   Layout
   ========================================== */

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

/* ==========================================
   Liquid Glass Effect - Apple iOS 26 Style
   ========================================== */

.liquid-glass {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow), var(--glass-inner-shadow);
    border: 1px solid var(--glass-border);
    overflow: hidden;
    transition: all var(--transition-base);
}

/* Glass highlight/refraction layer */
.liquid-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-highlight);
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

/* Interactive glass hover */
.liquid-glass:hover {
    background: var(--glass-bg-hover);
    box-shadow: var(--glass-shadow-hover), var(--glass-inner-shadow);
    transform: translateY(-1px);
}

.liquid-glass:active {
    transform: translateY(0);
}

/* ==========================================
   Header - Floating Pill Style
   ========================================== */

.header {
    position: fixed;
    top: var(--space-sm);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 1000;
    width: calc(var(--container-max) - var(--container-padding) * 2);
    max-width: calc(100% - var(--space-lg) * 2);
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-slow);
    opacity: 0;
    pointer-events: none;
}

.header.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.header.scrolled {
    background: var(--glass-bg-hover);
    box-shadow: var(--glass-shadow-hover);
}

/* Dark mode header - darker tint for readability while keeping blur */
[data-theme="dark"] .header {
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .header.scrolled {
    background: rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
    [data-theme="system"] .header {
        background: rgba(0, 0, 0, 0.4);
    }

    [data-theme="system"] .header.scrolled {
        background: rgba(0, 0, 0, 0.5);
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--space-sm) 0 var(--space-xs);
    gap: var(--space-sm);
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-bg-elevated);
    border: 1.5px dashed var(--color-border);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* iOS-style Flip Animation Container */
.header-flip-container {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    perspective: 500px;
}

.flip-card {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    height: 100%;
    white-space: nowrap;
    transform-style: preserve-3d;
    transform-origin: center center;
    transition: transform 0.35s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.35s ease;
}

/* Default card (MB) - visible by default */
#flipCardDefault {
    transform: rotateX(0deg);
    opacity: 1;
}

/* Story card - hidden below by default */
.flip-card-story {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateX(-90deg);
    opacity: 0;
    pointer-events: none;
}

/* When in story - flip MB up, flip story in from below */
.header.in-story #flipCardDefault {
    transform: rotateX(90deg);
    opacity: 0;
    pointer-events: none;
}

.header.in-story .flip-card-story {
    transform: rotateX(0deg);
    opacity: 1;
    pointer-events: auto;
}

/* Flip animation for story-to-story transitions */
.header.in-story .flip-card-story.flipping-out {
    animation: flipOut 0.2s ease-in forwards;
}

.header.in-story .flip-card-story.flipping-in {
    animation: flipIn 0.2s ease-out forwards;
}

@keyframes flipOut {
    0% {
        transform: rotateX(0deg);
        opacity: 1;
    }

    100% {
        transform: rotateX(90deg);
        opacity: 0;
    }
}

@keyframes flipIn {
    0% {
        transform: rotateX(-90deg);
        opacity: 0;
    }

    100% {
        transform: rotateX(0deg);
        opacity: 1;
    }
}

.header-story-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.header-story-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid var(--color-border);
}

.header-story-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
    justify-content: center;
}

.header-story-title {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-story-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Header Socials - fade in on scroll */
.header-socials {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.header.scrolled .header-socials {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.header-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.header-social:hover {
    color: var(--color-text);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--color-text-secondary);
    position: relative;
    transition: color var(--transition-fast);
}

.theme-toggle:hover {
    color: var(--color-text);
}

.theme-toggle::before {
    display: none;
}

.sun-icon,
.moon-icon {
    position: absolute;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

[data-theme="light"] .moon-icon,
[data-theme="system"] .moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.8);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.8);
}

@media (prefers-color-scheme: dark) {
    [data-theme="system"] .sun-icon {
        opacity: 0;
        transform: rotate(-90deg) scale(0.8);
    }

    [data-theme="system"] .moon-icon {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* ==========================================
   Above Fold Section
   ========================================== */

.above-fold {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-xl);
    display: flex;
    flex-direction: column;
}

.above-fold>.container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Hero Row */
.hero-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.hero-image-wrapper {
    flex-shrink: 0;
}

.hero-image {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
    object-fit: cover;
}

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

.hero-name {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.1;
    margin-bottom: 4px;
}

.hero-tagline {
    font-size: 1.0625rem;
    color: var(--color-text-secondary);
    letter-spacing: 0;
}

.mobile-break {
    display: none;
    margin-bottom: var(--space-sm);
}

.hero-socials {
    display: flex;
    gap: var(--space-xs);
    margin-left: -8px;
}

.social-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
}

.social-pill:hover {
    color: var(--color-text);
}

/* Intro Text */
.intro-text {
    font-size: 1.0625rem;
    line-height: 1.55;
    letter-spacing: 0.01em;
    color: var(--color-text);
    margin-bottom: var(--space-xl);
}

/* Section Label */
.section-label {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-sm);
}

/* Journey Section - Vertical Timeline */
.journey-section {
    margin-bottom: var(--space-lg);
}

.journey-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    position: relative;
}

/* Timeline line */
.journey-grid::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: var(--color-border);
    border-radius: 1px;
}

.journey-card {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    text-decoration: none;
    color: var(--color-text);
    position: relative;
    background: none;
    border: none;
    border-radius: 0;
    transition: all var(--transition-fast);
}

/* Timeline dot */
.journey-card::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-xl) + 3px);
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--color-bg);
    border: 2px solid var(--color-text-tertiary);
    border-radius: 50%;
    transition: all var(--transition-fast);
    z-index: 1;
}

.journey-card::after {
    display: none;
}

.journey-url {
    display: none;
}

.featured-name {
    display: none;
}

.featured-url {
    display: none;
}

.story-url {
    display: none;
}

.social-name {
    display: none;
}

.social-url {
    display: none;
}

.md-prefix {
    display: none;
}

.bracket {
    display: none;
}

.journey-card:hover::before {
    border-color: var(--color-text);
    background: var(--color-text);
}

.journey-card:hover .journey-title {
    color: var(--color-text);
}

.journey-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.journey-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

.placeholder-icon {
    background: var(--color-bg-elevated);
    border: 1.5px dashed var(--color-border);
}

.placeholder-icon span {
    font-size: 0.5rem;
    font-weight: 600;
    color: var(--color-text-tertiary);
}

.journey-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    padding-top: 0;
    justify-content: center;
}

.journey-year {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-tertiary);
    letter-spacing: 0.02em;
}

.journey-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0;
    transition: color var(--transition-fast);
    line-height: 1.3;
}

.journey-claim {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--color-text-tertiary);
    line-height: 1.4;
}

/* Featured Section */
.featured-section {
    margin-bottom: var(--space-2xl);
}

.featured-row {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-left: -4px;
}

.featured-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 var(--space-xs);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.featured-logo:hover {
    transform: translateY(-2px);
}

.featured-logo img {
    height: 24px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.5);
    transition: filter var(--transition-fast);
}

.featured-logo:hover img {
    filter: none;
}

/* Dark mode: invert dark/black logos to white */
[data-theme="dark"] .featured-logo.logo-dark img {
    filter: grayscale(100%) invert(1) opacity(0.7);
}

[data-theme="dark"] .featured-logo.logo-dark:hover img {
    filter: invert(1);
}

/* Colored logos in dark mode: invert to make them visible on dark bg */
[data-theme="dark"] .featured-logo.logo-color img {
    filter: grayscale(100%) invert(1) opacity(0.7);
}

[data-theme="dark"] .featured-logo.logo-color:hover img {
    filter: invert(1);
}

/* Yellow logo (Cointelegraph) - yellow is too light, needs special handling */
.featured-logo.logo-yellow img {
    filter: sepia(1) saturate(0) brightness(0.4) opacity(0.8);
}

.featured-logo.logo-yellow:hover img {
    filter: none;
}

[data-theme="dark"] .featured-logo.logo-yellow img {
    filter: sepia(1) saturate(0) brightness(3) opacity(0.7);
}

[data-theme="dark"] .featured-logo.logo-yellow:hover img {
    filter: brightness(3);
}

/* ==========================================
   Placeholder Styles (Wireframe)
   ========================================== */

.placeholder-image {
    background: var(--color-bg-elevated);
    border: 1.5px dashed var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.placeholder-text {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    font-weight: 500;
    text-align: center;
    padding: var(--space-sm);
}

/* ==========================================
   Stories Section - Seamless Blog Layout
   ========================================== */

.stories-section {
    padding-top: var(--space-lg);
    background: var(--color-bg);
}

.stories-section>.container {
    padding-bottom: var(--space-lg);
}

/* Stories section label aligned to container left */
.stories-section>.container .section-label {
    margin-left: 0;
}

.story {
    margin-bottom: var(--space-3xl);
}

.story:last-child {
    margin-bottom: 0;
    padding-bottom: var(--space-3xl);
}

/* Story Intro - Non-sticky section header */
.story-intro {
    padding: var(--space-md) 0;
    margin-bottom: var(--space-sm);
}

.story-intro .container {
    padding: 0 var(--container-padding);
}

.story-intro-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.story-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.story-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--color-border);
}

.story-meta {
    flex: 1;
    min-width: 0;
}

.story-year {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 2px;
}

.story-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
}

.story-title .title-text {
    display: inline;
    margin-bottom: 2px;
    color: var(--color-text);
    transition: color var(--transition-fast);
}

.story-subtitle {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    letter-spacing: 0;
}

/* Story Header Link */
.story-header-link {
    text-decoration: none;
    color: inherit;
    border-radius: 16px;
    padding: var(--space-sm);
    margin: calc(var(--space-sm) * -1);
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.story-header-link:hover {
    background-color: rgba(0, 0, 0, 0.03);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.06),
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.story-header-link:hover .story-title {
    color: var(--color-accent);
}

.story-header-link:hover .external-link-icon {
    opacity: 1;
    transform: translateX(0);
}

.external-link-icon {
    flex-shrink: 0;
    color: var(--color-text-tertiary);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
}

.story-header-link:hover .external-link-icon {
    color: var(--color-accent);
}

/* Dark mode adjustments for story header link */
[data-theme="dark"] .story-header-link:hover {
    background-color: var(--color-bg-elevated);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

@media (prefers-color-scheme: dark) {
    [data-theme="system"] .story-header-link:hover {
        background-color: var(--color-bg-elevated);
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.1),
            0 4px 16px rgba(0, 0, 0, 0.4),
            0 8px 32px rgba(0, 0, 0, 0.3);
        transform: translateY(-2px);
    }
}

/* Story Content */
.story-content {
    padding-top: var(--space-sm);
}

.story-paragraph {
    font-size: 1.0625rem;
    line-height: 1.55;
    letter-spacing: 0.01em;
    color: var(--color-text);
    margin-bottom: var(--space-md);
}

.story-paragraph:last-child {
    margin-bottom: 0;
}

/* Story Media */
.story-media {
    margin: var(--space-xl) 0;
    max-width: 100%;
    overflow: hidden;
}

.story-media img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    object-fit: cover;
    border: 1px solid var(--color-border);
}

.story-media video {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
}

.story-media-video {
    position: relative;
}

.story-media .media-placeholder {
    aspect-ratio: 16/10;
    border-radius: var(--radius-lg);
    min-height: 180px;
    max-height: 400px;
    width: 100%;
}

.story-media.wide .media-placeholder {
    aspect-ratio: 21/9;
    max-height: 320px;
}

.story-media.small .media-placeholder {
    aspect-ratio: 4/3;
    min-height: 120px;
    max-height: 280px;
}

.story-media figcaption {
    font-size: 0.8125rem;
    color: var(--color-text-tertiary);
    text-align: center;
    margin-top: var(--space-sm);
}

/* Video placeholder */
.media-placeholder.video {
    position: relative;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
}

/* Bento Grid Layout */
.story-bento {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    grid-template-rows: minmax(200px, 320px);
    gap: var(--space-sm);
    margin: var(--space-xl) 0;
}

.bento-item {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--color-bg-elevated);
    position: relative;
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.bento-tall {
    grid-row: span 1;
}

.bento-tall img {
    object-fit: cover;
    object-position: top center;
}

.bento-wide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg) 100%);
}

.bento-wide img {
    object-fit: contain;
    max-height: 100%;
    width: auto;
    max-width: 100%;
    padding: var(--space-md);
}

/* Story Duo - Two items centered side by side */
.story-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
}

.story-duo figure {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    aspect-ratio: 4/5;
}

.story-duo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

/* Story Gallery */
.story-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin: var(--space-xl) 0;
}

.story-gallery .story-media {
    margin: 0;
}

/* ==========================================
   Footer
   ========================================== */

.footer {
    background: var(--color-bg);
    padding: var(--space-2xl) 0 var(--space-lg);
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

@media (min-width: 480px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer-brand .logo {
    display: inline-block;
    width: auto;
    height: auto;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-xs);
}

.footer-tagline {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.footer-socials {
    display: flex;
    gap: var(--space-md);
}

.footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.footer-social:hover {
    color: var(--color-text);
}

/* Footer Bottom */
.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

@media (min-width: 480px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.footer-bottom p {
    font-size: 0.8125rem;
    color: var(--color-text-tertiary);
}

.footer-bottom {
    padding-bottom: 60px;
}

/* Footer Theme Toggle */
.footer-theme-toggle {
    background: none;
    border: none;
    padding: 0;
}

/* ==========================================
   Responsive - Mobile (iPhone 16 Pro)
   ========================================== */

@media (max-width: 430px) {
    :root {
        --container-padding: 1rem;
        --header-height: 48px;
    }

    body {
        font-size: 15px;
    }

    .header-content {
        gap: var(--space-xs);
        padding: 0 var(--space-2xs);
    }

    .logo {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }


    .above-fold {
        min-height: 100vh;
        min-height: 100dvh;
        padding-top: var(--space-lg);
    }

    .header {
        top: var(--space-xs);
        width: calc(100% - var(--space-md) * 2);
        max-width: calc(100vw - var(--space-md) * 2);
        height: 44px;
    }

    .header-content {
        padding: 0 var(--space-xs);
        overflow: visible;
    }

    .header-left {
        gap: var(--space-xs);
        min-width: 0;
        overflow: visible;
    }

    .header-logo-img {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .header-story-info {
        max-width: 140px;
        overflow: hidden;
    }

    .header-social {
        width: 24px;
        height: 24px;
    }

    .header-social svg {
        width: 14px;
        height: 14px;
    }

    .hero-image {
        width: 110px;
        height: 110px;
        border-radius: var(--radius-lg);
    }

    .hero-name {
        font-size: 1.5rem;
    }

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

    .mobile-break {
        display: block;
    }

    .intro-text {
        font-size: 1rem;
    }

    .journey-grid {
        padding-left: var(--space-lg);
    }

    .journey-grid::before {
        left: 5px;
    }

    .journey-card::before {
        left: calc(-1 * var(--space-lg) + 2px);
        width: 8px;
        height: 8px;
    }

    .journey-icon {
        width: 36px;
        height: 36px;
        border-radius: 9px;
    }

    .journey-title {
        font-size: 0.9375rem;
    }

    .journey-claim {
        font-size: 0.75rem;
    }

    .journey-section {
        margin-bottom: var(--space-md);
    }

    .featured-section {
        margin-bottom: var(--space-lg);
    }

    .featured-logo {
        height: 32px;
        padding: 0 var(--space-sm);
    }

    /* Header story context on mobile */
    .header-story-icon {
        width: 32px;
        height: 32px;
    }

    .header-story-title {
        font-size: 0.8125rem;
    }

    .header-story-subtitle {
        display: none;
    }

    .header-flip-container {
        height: 32px;
    }

    .story-intro {
        padding: var(--space-sm) 0;
        margin-bottom: var(--space-xs);
    }

    .story-intro-content {
        gap: var(--space-sm);
    }

    .story-icon {
        width: 44px;
        height: 44px;
        border-radius: 11px;
    }

    .story-title {
        font-size: 1.125rem;
    }

    .story-subtitle {
        font-size: 0.8125rem;
    }

    .story-paragraph {
        margin-bottom: var(--space-sm);
    }

    .section-label {
        margin-bottom: var(--space-xs);
    }

    /* Fix media placeholders on mobile */
    .story-media .media-placeholder {
        min-height: 140px;
        max-height: 280px;
        border-radius: var(--radius-md);
    }

    .story-media {
        margin: var(--space-md) 0;
    }

    .story-media img {
        border-radius: var(--radius-md);
    }

    .story-media video {
        border-radius: var(--radius-md);
    }

    .story-media.wide .media-placeholder {
        max-height: 200px;
    }

    .story-gallery {
        grid-template-columns: 1fr;
    }

    /* Bento grid mobile - stack vertically */
    .story-bento {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: var(--space-sm);
        margin: var(--space-md) 0;
    }

    .bento-item {
        border-radius: var(--radius-md);
    }

    .bento-item img {
        border-radius: var(--radius-md);
    }

    .bento-tall {
        grid-row: span 1;
        height: 240px;
    }

    .bento-wide {
        height: 180px;
    }

    .bento-wide img {
        padding: var(--space-sm);
    }

    .story-duo {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .story-duo figure {
        aspect-ratio: 3/4;
    }
}

/* ==========================================
   Responsive - Desktop
   ========================================== */

@media (min-width: 768px) {
    body {
        font-size: 17px;
    }

    .container {
        --container-padding: 2rem;
    }

    .hero-row {
        gap: var(--space-xl);
    }

    .hero-image {
        width: 140px;
        height: 140px;
    }

    .hero-name {
        font-size: 2.25rem;
    }

    .intro-text {
        font-size: 1.125rem;
    }

    .journey-grid {
        padding-left: var(--space-2xl);
    }

    .journey-grid::before {
        left: 9px;
    }

    .journey-card::before {
        left: calc(-1 * var(--space-2xl) + 5px);
    }

    .journey-icon {
        width: 40px;
        height: 40px;
    }

    .journey-title {
        font-size: 1.0625rem;
    }

    .story-paragraph {
        font-size: 1.125rem;
    }

    .story-title {
        font-size: 1.75rem;
    }
}

/* ==========================================
   Animations
   ========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.story {
    animation: fadeIn 0.5s ease forwards;
}

/* ==========================================
   Accessibility
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

/* ==========================================
   Floating Human/Machine Mode Toggle
   ========================================== */

.floating-mode-toggle {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
    border-radius: var(--radius-full);
    padding: 4px;
    gap: 2px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

[data-theme="dark"] .floating-mode-toggle {
    background: rgba(0, 0, 0, 0.6);
}

.mode-btn {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    color: var(--color-text-tertiary);
    background: transparent;
    transition: all var(--transition-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
}

.mode-btn::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    box-sizing: border-box;
    transform-origin: center center;
    position: relative;
    top: -0.5px;
}

.mode-btn:hover {
    color: var(--color-text-secondary);
}

.mode-btn.active {
    color: var(--color-text);
}

.mode-btn.active::before {
    background: currentColor;
}

[data-theme="dark"] .mode-btn.active {
    color: var(--color-text);
}

/* Human button - pulsating dot when active */
.mode-btn-human.active::before {
    animation: dot-pulse 1.5s ease-in-out infinite;
}

/* Machine button - green pulsating dot only when active */
.mode-btn-machine.active::before {
    background: #22c55e;
    border-color: #22c55e;
    animation: dot-pulse 1.5s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

/* ==========================================
   Mode Transition Animations
   ========================================== */

/* Machine Transition Overlay (Human → Machine) */
.machine-reveal-hidden {
    opacity: 0 !important;
}

.machine-reveal-visible {
    opacity: 1 !important;
    transition: opacity 0.5s ease-out !important;
}

.machine-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0d0d0d;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-out;
}

.machine-transition-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.machine-transition-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

/* Keep mode toggle above overlay */
.floating-mode-toggle {
    z-index: 10000 !important;
}

/* Blur Transition (Machine → Human) - Applied to content, not overlay */
body.mode-blur-transition > *:not(.floating-mode-toggle):not(.machine-transition-overlay) {
    filter: blur(8px);
    opacity: 0.85;
    transition: filter 0.1s ease-out, opacity 0.1s ease-out;
}

body.mode-blur-transition .floating-mode-toggle {
    filter: none !important;
    opacity: 1 !important;
    transition: none !important;
}

body.mode-blur-out > *:not(.floating-mode-toggle):not(.machine-transition-overlay) {
    filter: blur(0px);
    opacity: 1;
    transition: filter 0.2s ease-out, opacity 0.2s ease-out;
}

/* ==========================================
   Machine Mode - Terminal/Markdown Style
   Mimics parallel.ai: pure text, no layout
   ========================================== */

[data-mode="machine"] {
    --font-body: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    --font-display: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
}

[data-mode="machine"] body {
    background: #0d0d0d;
    color: #e5e5e5;
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: 0;
}

/* Hide header completely */
[data-mode="machine"] .header {
    display: none !important;
}

/* Hide ALL visuals - images, videos, icons */
[data-mode="machine"] .hero-image-wrapper,
[data-mode="machine"] .hero-image,
[data-mode="machine"] .story-media,
[data-mode="machine"] .story-bento,
[data-mode="machine"] .story-duo,
[data-mode="machine"] .story-gallery,
[data-mode="machine"] .journey-icon,
[data-mode="machine"] .story-icon,
[data-mode="machine"] .external-link-icon,
[data-mode="machine"] .theme-toggle,
[data-mode="machine"] .footer-theme-toggle,
[data-mode="machine"] .header-socials,
[data-mode="machine"] .featured-logo img {
    display: none !important;
}

/* Reset ALL layout - make everything flow as simple text */
[data-mode="machine"] .above-fold,
[data-mode="machine"] .hero-row,
[data-mode="machine"] .hero-info,
[data-mode="machine"] .journey-section,
[data-mode="machine"] .journey-grid,
[data-mode="machine"] .journey-card,
[data-mode="machine"] .journey-info,
[data-mode="machine"] .stories-section,
[data-mode="machine"] .story,
[data-mode="machine"] .story-intro,
[data-mode="machine"] .story-intro-content,
[data-mode="machine"] .story-meta,
[data-mode="machine"] .story-content,
[data-mode="machine"] .footer-content,
[data-mode="machine"] .footer-bottom {
    display: block;
    padding: 0;
    margin: 0;
    gap: 0;
    background: none;
    box-shadow: none;
}

[data-mode="machine"] .container {
    max-width: 700px;
    margin: 0 auto;
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
}

[data-mode="machine"] .above-fold {
    padding: var(--space-md) 0;
    min-height: auto;
}

/* Above-fold container - no overall border, sections get their own */
[data-mode="machine"] .above-fold > .container {
    border: none !important;
    padding: 0 !important;
}

/* Intro box (hero-row + intro-text) - first bordered section */
[data-mode="machine"] .above-fold .hero-row {
    border-left: 1px solid #444 !important;
    border-right: 1px solid #444 !important;
    padding: 0 var(--space-lg) !important;
}

[data-mode="machine"] .above-fold .intro-text {
    border-left: 1px solid #444 !important;
    border-right: 1px solid #444 !important;
    padding: 0 var(--space-lg) !important;
    margin-bottom: var(--space-2xl) !important;
}

/* Featured In section - separate bordered box */
[data-mode="machine"] .featured-section {
    border-left: 1px solid #444 !important;
    border-right: 1px solid #444 !important;
    padding: 0 var(--space-lg) !important;
    margin-bottom: var(--space-2xl) !important;
    display: block !important;
}

[data-mode="machine"] .featured-section .section-label {
    margin: 0 0 var(--space-xs) 0;
}

[data-mode="machine"] .featured-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: var(--space-2xs) !important;
}

[data-mode="machine"] .featured-logo {
    display: inline-flex !important;
    width: auto !important;
    height: auto !important;
    background: #e5e5e5 !important;
    color: #0d0d0d;
    padding: 0 3px;
    text-decoration: none;
    border-radius: 0;
}

[data-mode="machine"] .featured-logo:hover {
    background: #fff !important;
    text-decoration: underline;
}

/* Featured In - link labels and URLs */
[data-mode="machine"] .featured-logo::before,
[data-mode="machine"] .featured-logo::after {
    display: none;
}

[data-mode="machine"] .featured-name {
    display: inline;
    color: #0d0d0d;
    font-size: 13px;
}

[data-mode="machine"] .featured-url {
    display: inline;
    color: #666;
    font-size: 13px;
}

[data-mode="machine"] .story-url {
    display: inline;
    color: #666;
    font-size: 13px;
}

[data-mode="machine"] .social-name {
    display: inline;
    color: #0d0d0d;
    font-size: 13px;
}

[data-mode="machine"] .social-url {
    display: inline;
    color: #666;
    font-size: 13px;
}

/* Featured logo ::before/::after removed - using real HTML elements now */

/* Journey section - separate bordered box with gap from intro */
[data-mode="machine"] .journey-section {
    border-left: 1px solid #444 !important;
    border-right: 1px solid #444 !important;
    padding: 0 var(--space-lg) !important;
    margin-bottom: var(--space-2xl) !important;
}

/* Stories section - ensure container alignment */
[data-mode="machine"] .stories-section {
    padding: 0;
}

[data-mode="machine"] .stories-section > .container {
    max-width: 700px;
    padding: 0 !important;
    margin: 0 auto 0 auto !important;
    border-left: 1px solid #444 !important;
    border-right: 1px solid #444 !important;
}

/* Stories section label */
[data-mode="machine"] .stories-section > .container > .section-label {
    padding: 0 var(--space-lg) !important;
    margin: 0 !important;
}

/* Each story gets its own bordered box */
[data-mode="machine"] .story {
    border-left: 1px solid #444 !important;
    border-right: 1px solid #444 !important;
    padding: 0 var(--space-lg) !important;
    margin-bottom: var(--space-2xl) !important;
}

/* Remove all link styling except text */
[data-mode="machine"] .story-header-link {
    display: block;
    padding: 0;
    margin: 0;
    background: none !important;
    border-radius: 0;
}

[data-mode="machine"] .story-header-link:hover {
    background: none !important;
    box-shadow: none;
    transform: none;
}

/* Headings - markdown style */
[data-mode="machine"] .hero-name {
    font-size: 13px;
    font-weight: normal;
    margin-bottom: var(--space-2xs);
    line-height: 1.4;
    letter-spacing: 0;
}

[data-mode="machine"] .hero-name::before {
    display: none;
}

[data-mode="machine"] .md-prefix {
    display: inline;
    color: #666;
}

[data-mode="machine"] .bracket {
    display: inline;
    color: #e5e5e5;
}

[data-mode="machine"] .hero-tagline {
    font-size: 13px;
    color: #808080;
    margin-bottom: var(--space-xs);
    line-height: 1.4;
    letter-spacing: 0;
}

[data-mode="machine"] .hero-tagline::before {
    display: none;
}

[data-mode="machine"] .section-label {
    font-size: 13px;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 0;
    color: #e5e5e5;
    margin: 0 0 var(--space-xs) 0;
    line-height: 1.4;
}

[data-mode="machine"] .section-label::before {
    display: none;
}

[data-mode="machine"] .story-title {
    font-size: 13px;
    font-weight: normal;
    color: #e5e5e5;
    line-height: 1.4;
    letter-spacing: 0;
}

[data-mode="machine"] .story-title .bracket {
    display: inline;
    color: #e5e5e5;
}

[data-mode="machine"] .story-title .title-text {
    display: inline;
    color: #e5e5e5;
}


/* Hide story year and subtitle in header link (CTA) */
[data-mode="machine"] .story-header-link .story-year,
[data-mode="machine"] .story-header-link .story-subtitle {
    display: none;
}

/* Show story year and subtitle in regular context */
[data-mode="machine"] .story-year,
[data-mode="machine"] .story-subtitle {
    font-size: 11px;
    color: #666;
    display: block;
    line-height: 1.4;
    letter-spacing: 0;
}

/* Intro text - font styles */
[data-mode="machine"] .intro-text {
    font-size: 13px;
    color: #e5e5e5;
    line-height: 1.4;
    letter-spacing: 0;
    margin-top: var(--space-md);
}

/* Journey items - simple one-liners */
[data-mode="machine"] .journey-grid {
    margin-bottom: 0;
}

[data-mode="machine"] .journey-grid::before {
    display: none;
}

[data-mode="machine"] .journey-card {
    margin-bottom: var(--space-2xs);
    display: block;
    text-decoration: none;
}

[data-mode="machine"] .journey-card:hover {
    text-decoration: underline;
}

[data-mode="machine"] .journey-card::before {
    display: none;
}

[data-mode="machine"] .journey-card::after {
    display: none;
}

[data-mode="machine"] .journey-url {
    display: inline;
    color: #666;
    font-size: 13px;
}

[data-mode="machine"] .journey-info {
    display: inline;
}

[data-mode="machine"] .journey-title {
    font-size: 13px;
    font-weight: normal;
    color: #e5e5e5;
    display: inline;
    line-height: 1.4;
    letter-spacing: 0;
}

[data-mode="machine"] .journey-title::before {
    display: none;
}

[data-mode="machine"] .journey-title::after {
    display: none;
}

[data-mode="machine"] .journey-year,
[data-mode="machine"] .journey-claim {
    display: none;
}

/* Story sections - bordered boxes with gaps */
[data-mode="machine"] .story {
    max-width: 700px;
    margin: 0 auto var(--space-2xl) auto !important;
    padding: 0 var(--space-lg) !important;
    border-left: 1px solid #444 !important;
    border-right: 1px solid #444 !important;
    border-bottom: none;
}

[data-mode="machine"] .story .container {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

[data-mode="machine"] .story:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

[data-mode="machine"] .story-intro {
    padding: 0;
    margin-bottom: var(--space-xs);
}

[data-mode="machine"] .story-content {
    padding-top: 0;
}

/* Story link as CTA with full white background including URL */
[data-mode="machine"] .story-intro-content.story-header-link {
    display: inline-block !important;
    background: #e5e5e5 !important;
    color: #0d0d0d;
    padding: 0 3px;
    margin-bottom: var(--space-xs);
    text-decoration: none;
}

[data-mode="machine"] .story-intro-content.story-header-link:hover {
    background: #fff !important;
    text-decoration: underline;
}

[data-mode="machine"] .story-header-link .story-meta {
    display: inline;
}

[data-mode="machine"] .story-header-link .story-title {
    color: #0d0d0d;
    padding: 0;
    display: inline;
    background: transparent;
}

[data-mode="machine"] .story-header-link .story-title .bracket {
    display: inline;
    color: #0d0d0d;
}

[data-mode="machine"] .story-header-link .story-title .title-text {
    color: #0d0d0d;
}



[data-mode="machine"] .story-paragraph {
    font-size: 13px;
    color: #e5e5e5;
    margin-bottom: var(--space-sm);
    line-height: 1.4;
    letter-spacing: 0;
}

[data-mode="machine"] .story-paragraph:last-child {
    margin-bottom: 0;
}

/* Social links as markdown with full white background */
[data-mode="machine"] .hero-socials {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2xs);
    margin: var(--space-md) 0 0 0;
}

[data-mode="machine"] .hero-socials .social-pill {
    display: inline-flex;
    width: auto;
    height: auto;
    padding: 0 3px;
    border-radius: 0;
    background: #e5e5e5;
    color: #0d0d0d;
    text-decoration: none;
}

[data-mode="machine"] .hero-socials .social-pill:hover {
    background: #fff;
    text-decoration: underline;
}

[data-mode="machine"] .hero-socials .social-pill svg {
    display: none;
}

[data-mode="machine"] .hero-socials .social-pill::before,
[data-mode="machine"] .hero-socials .social-pill::after {
    display: none;
}

/* Footer - simple text with side borders */
[data-mode="machine"] .footer {
    background: #0d0d0d;
    border-top: none;
    padding: 0 0 60px 0;
}

[data-mode="machine"] .footer > .container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    border-left: 1px solid #444 !important;
    border-right: 1px solid #444 !important;
}

[data-mode="machine"] .footer-brand .logo {
    font-size: 13px;
    font-weight: normal;
    color: #e5e5e5;
    margin-bottom: var(--space-2xs);
    line-height: 1.4;
    letter-spacing: 0;
}

[data-mode="machine"] .footer-tagline {
    font-size: 13px;
    color: #e5e5e5;
    line-height: 1.4;
    letter-spacing: 0;
}

[data-mode="machine"] .footer-socials {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2xs);
    margin: var(--space-xs) 0 0 0;
}

[data-mode="machine"] .footer-social {
    display: inline-flex;
    background: #e5e5e5;
    color: #0d0d0d;
    padding: 0 3px;
    text-decoration: none;
}

[data-mode="machine"] .footer-social:hover {
    background: #fff;
    text-decoration: underline;
}

[data-mode="machine"] .footer-social svg {
    display: none;
}

[data-mode="machine"] .footer-social::before,
[data-mode="machine"] .footer-social::after {
    display: none;
}

[data-mode="machine"] .footer-bottom {
    margin-top: var(--space-sm);
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
}

[data-mode="machine"] .footer-bottom p {
    font-size: 11px;
    color: #e5e5e5;
    line-height: 1.4;
    letter-spacing: 0;
}

/* Floating toggle */
[data-mode="machine"] .floating-mode-toggle {
    background: #1a1a1a;
    border: 1px solid #444;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

[data-mode="machine"] .mode-btn {
    color: #666;
    font-family: 'SF Mono', monospace;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0;
    line-height: 1;
}

[data-mode="machine"] .mode-btn:hover {
    color: #e5e5e5;
}

[data-mode="machine"] .mode-btn.active {
    background: #e5e5e5;
    color: #0d0d0d;
}

[data-mode="machine"] .mode-btn-human.active::before {
    background: #0d0d0d;
    border-color: #0d0d0d;
}

[data-mode="machine"] .mode-btn-machine.active::before {
    background: #22c55e;
    border-color: #22c55e;
    animation: dot-pulse 1.5s ease-in-out infinite;
}

/* Mobile */
@media (max-width: 430px) {
    [data-mode="machine"] body {
        font-size: 13px;
    }

    [data-mode="machine"] .container {
        padding-left: var(--space-md);
        padding-right: var(--space-md);
    }

    [data-mode="machine"] .above-fold .hero-row,
    [data-mode="machine"] .above-fold .intro-text,
    [data-mode="machine"] .featured-section,
    [data-mode="machine"] .journey-section,
    [data-mode="machine"] .stories-section > .container,
    [data-mode="machine"] .story,
    [data-mode="machine"] .footer > .container {
        margin-left: var(--space-sm) !important;
        margin-right: var(--space-sm) !important;
    }

    .floating-mode-toggle {
        bottom: var(--space-md);
    }

    .mode-btn {
        font-size: 0.625rem;
        padding: 6px 10px;
    }
}

/* Mobile - machine mode line breaks */
@media (max-width: 430px) {
    [data-mode="machine"] .hero-socials .social-pill,
    [data-mode="machine"] .featured-logo,
    [data-mode="machine"] .footer-social {
        display: inline-flex !important;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: flex-start;
        text-align: left;
        background: #e5e5e5 !important;
        padding: 0 3px !important;
        max-width: 100%;
    }

    [data-mode="machine"] .social-name,
    [data-mode="machine"] .featured-name {
        color: #0d0d0d;
    }

    [data-mode="machine"] .social-url,
    [data-mode="machine"] .featured-url {
        color: #0d0d0d;
        word-break: break-all;
        text-align: left;
    }

    [data-mode="machine"] .journey-card,
    [data-mode="machine"] .story-header-link {
        display: block !important;
        text-align: left;
    }

    [data-mode="machine"] .journey-url,
    [data-mode="machine"] .story-url {
        display: block;
        word-break: break-all;
        text-align: left;
    }
}