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

:root {
    --bg: #000;
    --bg-card: #111;
    --bg-code: #0d1117;
    --border: #333;
    --border-code: #30363d;
    --text: #fff;
    --text-secondary: #999;
    --text-muted: #666;
    --accent: #c33;
    --accent-hover: #e44;
    --secondary: #888;
    --green: #5a5;
    --yellow: #ca0;
    --code-text: #e6edf3;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Helvetica Neue', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
}

a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
    text-underline-offset: 2px;
    transition: color 0.2s, text-decoration-color 0.2s;
}

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

code {
    background: var(--bg-code);
    border: 1px solid var(--border-code);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', monospace;
    font-size: 14px;
    color: var(--code-text);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-brand {
    font-size: 18px;
    font-weight: 300;
    color: var(--text);
    letter-spacing: 1px;
    text-decoration: none;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.2s;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

/* Hamburger menu */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: -8px;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: transform 0.2s, opacity 0.2s;
}

.nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 600px) {
    .nav-hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        gap: 0;
        padding: 10px 0;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 12px 25px;
        font-size: 14px;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(255, 255, 255, 0.05);
    }

    nav {
        position: relative;
    }
}

/* Sections */
section {
    padding: 100px 50px;
    max-width: 1100px;
    margin: 0 auto;
}

section.wide {
    max-width: 1400px;
}

.section-title {
    font-size: 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
}

.section-note {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

h2 {
    font-size: 36px;
    font-weight: 300;
    margin-bottom: 25px;
}

/* Page header for subpages */
.page-header {
    padding-top: 90px;
    padding-bottom: 30px;
}

.page-header h1 {
    font-size: 48px;
    font-weight: 200;
}

.page-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.page-header-content {
    flex: 1;
}

.page-header-action {
    flex-shrink: 0;
    margin-top: 8px;
}

@media (max-width: 600px) {
    .page-header-with-action {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-action {
        margin-top: 20px;
        margin-bottom: 0;
    }
}

/* Hero - Split layout */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 60px;
    overflow-x: visible;
}

.hero-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.hero-text h1 {
    font-size: 52px;
    font-weight: 200;
    line-height: 1.1;
    margin-bottom: 25px;
}

.hero-text h1 span {
    color: var(--text-secondary);
}

.hero-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 15px;
}

/* Hero visual */
.hero-visual {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-visual .bs5-device {
    transform: scale(0.85);
    transform-origin: center center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--text);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: var(--text);
}

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

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

.hero-question {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 30px;
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
    text-underline-offset: 4px;
}

.hero-question:hover {
    color: var(--text);
}

.clickable-hint {
    display: inline-block;
    margin-left: 4px;
    transition: transform 0.2s;
}

.hero-question:hover .clickable-hint {
    transform: translateY(2px);
}

.what-is-content {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    max-width: 600px;
}

.what-is-content.expanded {
    display: block;
}

.what-is-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.what-is-content p:last-child {
    margin-bottom: 0;
}

.what-is-content a {
    color: var(--text);
}

.what-is-content a:hover {
    text-decoration-color: var(--text);
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 30px;
    transition: border-color 0.2s;
}

.feature-card:hover {
    border-color: var(--text-muted);
}

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

.feature-icon-ha {
    width: 40px;
    height: 40px;
    color: #18BCF2;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.feature-card-warning {
    position: relative;
}

.feature-card-with-action {
    position: relative;
}

.feature-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 11px;
}

.feature-card-action {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 12px;
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}

.feature-card-action:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.warning-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(204, 170, 0, 0.15);
    border: 1px solid var(--yellow);
    border-radius: 50%;
    color: var(--yellow);
    font-size: 12px;
    line-height: 1;
}

/* Requirements */
.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.requirements-column h3 {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.requirements-column h3.required {
    color: var(--accent);
}

.requirements-column h3.recommended {
    color: var(--green);
}

.requirements-column h3.supported {
    color: var(--yellow);
}

.req-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.req-item:last-child {
    border-bottom: none;
}

.req-name {
    font-size: 16px;
    margin-bottom: 4px;
}

.req-note {
    font-size: 14px;
    color: var(--text-muted);
}

/* Danger warning */
.danger-warning {
    background: rgba(204, 51, 51, 0.1);
    border: 2px solid var(--accent);
    border-radius: 6px;
    padding: 20px 25px;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.danger-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.danger-content strong {
    display: block;
    color: var(--accent);
    font-size: 16px;
    margin-bottom: 8px;
}

.danger-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Caution warning (yellow) */
.caution-warning {
    background: rgba(204, 170, 0, 0.1);
    border: 2px solid var(--yellow);
    border-radius: 6px;
    padding: 20px 25px;
    margin-bottom: 30px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.caution-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
    filter: grayscale(100%) brightness(1.5) sepia(100%) hue-rotate(0deg) saturate(5);
}

.caution-content strong {
    display: block;
    color: var(--yellow);
    font-size: 16px;
    margin-bottom: 8px;
}

.caution-content ul {
    margin: 0;
    padding-left: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.caution-content li {
    margin-bottom: 6px;
}

.caution-content li:last-child {
    margin-bottom: 0;
}

.caution-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 12px 0 0 0;
}

/* Steps */
.steps-title {
    font-size: 20px;
    font-weight: 400;
    margin: 50px 0 30px 0;
    color: var(--text);
}

.steps {
    margin-top: 20px;
}

.step {
    display: flex;
    gap: 25px;
    padding: 25px 0;
    border-bottom: 1px solid var(--border);
}

.step:last-child {
    border-bottom: none;
}

.step-number {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: var(--secondary);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.step-content h3 {
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 8px;
}

.step-content p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.step-content a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
    text-underline-offset: 3px;
}

.step-content a:hover {
    text-decoration-color: var(--text);
}

.step-list {
    margin: 10px 0 15px 20px;
    font-size: 15px;
    color: var(--text-secondary);
}

.step-list li {
    margin-bottom: 6px;
}

/* Overview section */
.overview-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
    margin: 30px 0 50px 0;
}

.overview-diagram svg {
    width: 100%;
    max-width: 500px;
    height: auto;
}

.overview-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.overview-text p {
    margin-bottom: 15px;
}

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

.overview-text strong {
    color: var(--text);
}

.overview-text a {
    color: var(--text);
}

.overview-text a:hover {
    text-decoration-color: var(--text);
}

@media (max-width: 900px) {
    .overview-split {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .overview-diagram {
        order: 1;
    }

    .overview-text {
        order: 2;
    }
}

.connector-diagram {
    margin: 20px 0;
    max-width: 320px;
}

.connector-diagram-tight {
    margin: 10px 0;
}

.connector-diagram svg {
    width: 100%;
    height: auto;
}

.diagram-caption {
    font-size: 13px !important;
    color: var(--text-muted) !important;
    margin-top: 8px !important;
    font-style: italic;
}

/* Step with example thumbnail */
.step-content {
    position: relative;
    flex: 1;
}

.step-with-example {
    min-height: 140px;
    padding-right: 190px;
}

.step-with-example .step-text p:last-child {
    margin-bottom: 0;
}

.step-with-example .example-thumbnail {
    position: absolute;
    right: 0;
    top: 0;
}

.example-thumbnail {
    flex-shrink: 0;
    width: 160px;
}

.example-thumbnail img {
    width: 160px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.example-thumbnail img:hover {
    border-color: var(--text-muted);
    transform: scale(1.02);
}

.example-thumbnail .diagram-caption {
    text-align: center;
    cursor: pointer;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 36px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: var(--text);
}

/* Code blocks - terminal style */
.code-block {
    background: var(--bg-code);
    border: 1px solid var(--border-code);
    border-radius: 8px;
    padding: 16px 20px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', monospace;
    font-size: 14px;
    overflow-x: auto;
    margin-top: 10px;
    max-width: 100%;
}

.code-block code {
    display: block;
    background: none;
    border: none;
    padding: 0;
    color: var(--code-text);
    line-height: 1.6;
}

.code-block code::before {
    content: '$ ';
    color: var(--green);
}

/* Config example blocks */
.config-example {
    background: var(--bg-code);
    border: 1px solid var(--border-code);
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    margin-top: 10px;
    max-width: 100%;
}

.config-example pre {
    margin: 0;
}

.config-example code {
    display: block;
    background: none;
    border: none;
    padding: 0;
    color: var(--code-text);
    line-height: 1.6;
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', monospace;
    font-size: 13px;
    white-space: pre;
}

/* Compact config example */
.config-example-compact {
    padding: 12px 16px;
    margin-top: 8px;
}

.config-example-compact code {
    font-size: 12px;
    line-height: 1.5;
}

/* Installer split layout (step 3) */
.installer-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .installer-split {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/* Home Assistant config grid (step 4) */
.ha-config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.ha-config-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

/* Flat variant without boxes */
.ha-config-grid-flat .ha-config-item {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

.ha-config-item h4 {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 10px;
}

.ha-config-item p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

.ha-config-item .config-example {
    margin-top: 0;
}

.ha-config-item .config-example code {
    font-size: 11px;
    line-height: 1.4;
}

/* Success list (step 5) */
.step-list-success {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

.step-list-success li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 10px;
}

.step-list-success li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: bold;
    font-size: 14px;
}

/* Future ideas - full width stacked cards */
.ideas-list {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.idea-card-full {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 25px;
    transition: all 0.2s;
}

.idea-card-full:hover {
    border-color: var(--text-muted);
}

.idea-card-full h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.expand-icon {
    color: var(--text-muted);
    font-weight: 300;
    font-size: 20px;
    width: 24px;
    text-align: center;
    transition: color 0.2s;
}

.idea-card-full:hover .expand-icon {
    color: var(--text-secondary);
}

.idea-card-full p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 15px;
    display: none;
}

.idea-card-full.expanded p {
    display: block;
}

.done-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--green);
    background: rgba(85, 170, 85, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.experimental-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--yellow);
    background: rgba(204, 170, 0, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.feature-card-with-badge {
    position: relative;
}

.feature-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    margin-left: 0;
}

.footer-version {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 8px;
}

.btn-version-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--green);
    background: rgba(85, 170, 85, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 4px;
}

.repo-version {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
    letter-spacing: 0.5px;
}

.hero-release-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Story page styles */
.story-content {
    padding-top: 0;
}

.story-lead {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 30px;
}

.story-content p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.story-content h2 {
    font-size: 24px;
    font-weight: 400;
    margin: 60px 0 25px 0;
    color: var(--text);
}

.story-content em {
    color: var(--text);
    font-style: italic;
}

.story-content a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--text-muted);
    text-underline-offset: 2px;
}

.story-content a:hover {
    color: var(--text);
    text-decoration-color: var(--text);
}

/* Story split layout - image beside text */
.story-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
    margin: 40px 0;
}

.story-split.reverse {
    direction: rtl;
}

.story-split.reverse > * {
    direction: ltr;
}

.story-split-text p {
    max-width: none;
}

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

.story-split-visual {
    max-width: 450px;
}

.story-split-visual img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.story-split-visual .story-image-caption {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
    font-style: italic;
}

/* Story gallery - row of images */
.story-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin: 30px 0 50px 0;
}

.story-gallery-item {
    text-align: center;
}

.story-gallery-item img {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.story-gallery-item .story-image-caption {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    font-style: italic;
}

@media (max-width: 900px) {
    .story-gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    .story-gallery-item:last-child {
        grid-column: 1 / -1;
        justify-self: center;
    }

    .story-gallery-item:last-child img {
        max-width: 280px;
    }
}

@media (max-width: 600px) {
    .story-gallery {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .story-gallery-item img {
        max-width: 300px;
    }

    .story-gallery-item:last-child {
        grid-column: auto;
    }
}

.story-image-caption {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 10px;
    font-style: italic;
}

.story-meme {
    margin: 40px 0;
    text-align: center;
}

.story-meme .story-image-caption {
    text-align: center;
}

.story-meme img {
    max-width: 400px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.back-link {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.back-link a {
    color: var(--text-secondary);
    font-size: 15px;
}

.back-link a:hover {
    color: var(--text);
    text-decoration-color: var(--text);
}

/* Demo page */
.demo-content {
    padding-top: 0;
}

/* Demo grid */
.demo-grid {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.demo-item {
    text-align: center;
}

.demo-item h3 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 15px;
    color: var(--text);
}

.demo-comment {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 30px;
    line-height: 1.7;
}

.demo-row {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    max-width: 100%;
    overflow: visible;
}

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

.demo-device .bs5-device {
    transform: scale(1.1);
    transform-origin: center center;
}

/* Technical details panel */
.demo-details {
    position: absolute;
    right: calc(50% - 480px);
    top: 40px;
}

.details-toggle {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 2px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.details-toggle:hover {
    background: var(--accent);
    color: var(--text);
}

.demo-details.expanded .details-toggle {
    background: var(--accent);
    color: var(--text);
}

.details-text {
    position: absolute;
    top: -5px;
    left: auto;
    right: calc(100% + 20px);
    width: 320px;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: linear-gradient(145deg, #161616 0%, #111 100%);
    border: 1px solid var(--border);
    border-right: 3px solid var(--accent);
    border-radius: 4px;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.25s ease;
    z-index: 10;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.demo-details.expanded .details-text {
    max-height: 400px;
    opacity: 1;
    padding: 20px 22px;
    border-color: #444;
    transform: translateX(0);
    cursor: pointer;
}

@media (max-width: 1200px) {
    .demo-details {
        right: calc(50% - 420px);
    }
}

@media (max-width: 1100px) {
    .demo-device .bs5-device {
        transform: scale(0.95);
    }

    .demo-details {
        right: calc(50% - 380px);
    }
}

@media (max-width: 1000px) {
    .demo-device .bs5-device {
        transform: scale(0.85);
    }

    .demo-details {
        right: calc(50% - 340px);
    }
}

@media (max-width: 900px) {
    .demo-device .bs5-device {
        transform: scale(0.75);
    }

    .demo-details {
        right: calc(50% - 300px);
        top: 30px;
    }

    .details-text {
        width: 260px;
    }
}

@media (max-width: 800px) {
    .demo-device .bs5-device {
        transform: scale(0.65);
    }

    .demo-details {
        right: calc(50% - 260px);
        top: 20px;
    }
}

@media (max-width: 700px) {
    .demo-row {
        flex-direction: column;
        align-items: center;
    }

    .demo-device .bs5-device {
        transform: scale(0.9);
    }

    .demo-details {
        position: relative;
        right: auto;
        top: auto;
        margin-top: -30px;
    }

    .details-text {
        left: 50%;
        right: auto;
        top: calc(100% + 15px);
        transform: translateX(-50%) translateY(-10px);
        width: 300px;
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
        border-top: 3px solid var(--accent);
    }

    .demo-details.expanded .details-text {
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 768px) {
    .demo-grid {
        gap: 60px;
    }

    .demo-item h3 {
        font-size: 20px;
    }
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 40px;
    text-align: center;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-text {
    font-size: 14px;
    color: var(--text-muted);
}

.footer-text span {
    color: var(--text-secondary);
}

.footer-disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 10px;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero {
        padding-top: 85px;
    }

    .hero-split {
        display: flex;
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .hero-text {
        display: contents;
    }

    .hero-text h1 {
        order: 1;
    }

    .hero-text .hero-description {
        order: 2;
        margin-bottom: 0;
    }

    .hero-visual {
        order: 3;
        margin: -20px 0 -30px 0;
        overflow: visible;
    }

    .hero-text .hero-question {
        order: 4;
        margin-bottom: 10px;
    }

    .hero-text .what-is-content {
        order: 5;
    }

    .hero-text .hero-cta {
        order: 6;
    }

    .hero-visual .bs5-device {
        transform: scale(0.7);
        padding: 0;
    }

    .story-split {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .story-split.reverse {
        direction: ltr;
    }

    .story-split-visual {
        position: static;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    section {
        padding: 60px 25px;
        overflow-x: hidden;
    }

    .hero {
        padding-top: 25px;
    }

    .nav-inner {
        padding: 0 25px;
    }

    .nav-links {
        gap: 20px;
    }

    .nav-links a {
        font-size: 12px;
    }

    .hero-text h1 {
        font-size: 32px;
        margin-bottom: 15px;
    }

    .hero-description {
        font-size: 15px;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    .page-header {
        padding-top: 25px;
    }

    .page-header h1 {
        font-size: 32px;
    }

    .page-header-action {
        display: none;
    }

    .demo-row {
        overflow: hidden;
    }

    h2 {
        font-size: 28px;
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }

    .step {
        flex-direction: column;
        gap: 15px;
    }

    .story-meme img {
        max-width: 100%;
    }

    .hero-visual .bs5-device {
        transform: scale(0.65);
    }
}

@media (max-width: 500px) {
    .hero-visual .bs5-device {
        transform: scale(0.55);
    }

    .demo-device .bs5-device {
        transform: scale(0.8);
    }

    .details-text {
        width: 240px;
    }
}

@media (max-width: 400px) {
    .demo-device .bs5-device {
        transform: scale(0.65);
    }
}

.emulator-cta-simple {
    margin: 60px 0 0;
    text-align: center;
}

/* Emulator prompt toast */
.emulator-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(145deg, #1a1a1a 0%, #111 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.emulator-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.emulator-toast-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.emulator-toast-content p {
    margin: 0;
    font-size: 15px;
    color: var(--text-secondary);
}

.emulator-toast-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.emulator-toast-link:hover {
    color: var(--accent-hover);
}

.emulator-toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 0 0 10px;
    line-height: 1;
    transition: color 0.2s;
}

.emulator-toast-close:hover {
    color: var(--text);
}

/* Make BS5 buttons clickable */
.demo-device .bs5-btn-back,
.demo-device .bs5-btn-fwd,
.demo-device .bs5-btn-go,
.demo-device .bs5-wheel-disc,
.hero-visual .bs5-btn-back,
.hero-visual .bs5-btn-fwd,
.hero-visual .bs5-btn-go,
.hero-visual .bs5-wheel-disc {
    cursor: pointer;
    transition: opacity 0.15s;
}


@media (max-width: 600px) {
    .emulator-toast {
        bottom: 20px;
        left: 20px;
        right: 20px;
        transform: translateX(0) translateY(100px);
    }

    .emulator-toast.visible {
        transform: translateX(0) translateY(0);
    }

    .emulator-toast-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

