/*
 * HOME — A House That Thinks With You
 *
 * GENUX Design System + Craft Principles
 * Dark by design. Alive with breath. Beautiful by default.
 *
 * 鏡
 */

/* ==========================================================================
   DESIGN SYSTEM TOKENS
   ========================================================================== */

:root {
    /* Void Palette (Backgrounds) */
    --void: #07060B;
    --void-warm: #0D0A0F;
    --obsidian: #12101A;
    --surface: rgba(245, 240, 232, 0.04);
    --surface-elevated: rgba(245, 240, 232, 0.06);
    --surface-hover: rgba(245, 240, 232, 0.08);

    /* Signal Colors */
    --amber: #F59E0B;
    --amber-bright: #FBBF24;
    --amber-dim: rgba(245, 158, 11, 0.5);
    --amber-whisper: rgba(245, 158, 11, 0.12);
    --amber-glow: rgba(245, 158, 11, 0.25);

    --emerald: #10B981;
    --emerald-glow: rgba(16, 185, 129, 0.25);

    --cyan: #06B6D4;
    --cyan-glow: rgba(6, 182, 212, 0.25);

    /* Text Hierarchy */
    --text: #F5F0E8;
    --text-dim: rgba(245, 240, 232, 0.65);
    --text-whisper: rgba(245, 240, 232, 0.35);
    --text-ghost: rgba(245, 240, 232, 0.08);

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;

    /* Type Scale (Major Third 1.25) */
    --text-xs: 0.64rem;
    --text-sm: 0.8rem;
    --text-base: 1rem;
    --text-lg: 1.25rem;
    --text-xl: 1.563rem;
    --text-2xl: 1.953rem;
    --text-3xl: 2.441rem;
    --text-4xl: 3.052rem;
    --text-hero: clamp(3rem, 10vw, 6rem);

    /* Spacing (8px grid) */
    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --space-5: 3rem;
    --space-6: 4rem;
    --space-7: 6rem;
    --space-8: 8rem;

    /* Animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-fold: cubic-bezier(0.7, 0, 0.3, 1);

    /* Fibonacci Durations */
    --dur-89: 89ms;
    --dur-144: 144ms;
    --dur-233: 233ms;
    --dur-377: 377ms;
    --dur-610: 610ms;

    /* Layout */
    --max-width: 1200px;
    --content-padding: clamp(1.5rem, 5vw, 4rem);
    --card-radius: 20px;

    /* Category Colors */
    --lighting: #F5C542;
    --audio: #9B59B6;
    --climate: #3498DB;
    --shades: #1ABC9C;
    --security: #E74C3C;
    --entertainment: #E91E63;
    --outdoor: #27AE60;
    --sleep: #5C6BC0;
    --communication: #2980B9;
    --projects: #E67E22;
    --schedule: #F1C40F;
    --content: #00BCD4;
    --circadian: #FF8A65;
    --presence: #FFAB00;
    --predictive: #4DD0E1;
    --visitors: #F06292;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

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

html {
    font-size: 18px;
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-dim);
    background: var(--void);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    cursor: none;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

.skip-link {
    position: fixed;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-3);
    background: var(--amber);
    color: var(--void);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    z-index: 10000;
    transition: top var(--dur-233) var(--ease-out-expo);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.skip-link:focus {
    top: var(--space-3);
    outline: none;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4),
                0 0 0 3px var(--void),
                0 0 0 6px var(--amber);
}

.skip-link:focus-visible {
    outline: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
}

/* ==========================================================================
   BREATHING BACKGROUNDS
   ========================================================================== */

.breath-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    will-change: transform, opacity;
}

.breath-layer-1 {
    background: radial-gradient(ellipse 80% 60% at 50% 50%,
        rgba(245, 158, 11, 0.04) 0%,
        transparent 70%);
    animation: breathe 8s ease-in-out infinite;
}

.breath-layer-2 {
    background: radial-gradient(ellipse 100% 80% at 30% 70%,
        rgba(6, 182, 212, 0.025) 0%,
        transparent 60%);
    animation: breathe-alt 12s ease-in-out infinite;
}

.breath-layer-3 {
    background: radial-gradient(ellipse 60% 40% at 70% 30%,
        rgba(16, 185, 129, 0.02) 0%,
        transparent 50%);
    animation: breathe-deep 16s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes breathe-alt {
    0%, 100% { opacity: 0.3; transform: scale(1) translateX(0); }
    50% { opacity: 0.5; transform: scale(1.08) translateX(20px); }
}

@keyframes breathe-deep {
    0%, 100% { opacity: 0.25; transform: scale(1) translateY(0); }
    50% { opacity: 0.4; transform: scale(1.1) translateY(-20px); }
}

/* ==========================================================================
   AMBIENT CANVAS & GRAIN
   ========================================================================== */

.background-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    animation: grain-shift 0.5s steps(1) infinite;
}

@keyframes grain-shift {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-2%, -2%); }
    50% { transform: translate(2%, 0); }
    75% { transform: translate(0, 2%); }
}

/* ==========================================================================
   CUSTOM CURSOR
   ========================================================================== */

.cursor {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--amber);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    mix-blend-mode: screen;
    box-shadow: 0 0 15px var(--amber), 0 0 40px var(--amber-dim);
    transform: translate(-50%, -50%);
    transition: width var(--dur-144) var(--ease-out-expo),
                height var(--dur-144) var(--ease-out-expo),
                background var(--dur-144) var(--ease-out-expo);
    will-change: left, top;
}

.cursor-ring {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid var(--amber-dim);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: all var(--dur-233) var(--ease-out-expo);
    will-change: left, top, width, height;
}

.cursor-ring.hover {
    width: 60px;
    height: 60px;
    border-color: var(--emerald);
    background: var(--emerald-glow);
}

.cursor-ring.clicking {
    width: 30px;
    height: 30px;
    border-color: var(--amber-bright);
}

/* Hide cursor on touch devices */
@media (hover: none) {
    .cursor, .cursor-ring { display: none; }
    body { cursor: auto; }
}

@media (max-width: 600px) {
    .cursor, .cursor-ring { display: none; }
    body { cursor: auto; }
}

/* ==========================================================================
   FLOATING PARTICLES
   ========================================================================== */

.particles-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--amber);
    border-radius: 50%;
    opacity: 0;
    animation: float-up 15s linear infinite;
    will-change: transform, opacity;
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 0.4;
        transform: translateY(80vh) scale(1);
    }
    90% {
        opacity: 0.4;
        transform: translateY(10vh) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
}

/* ==========================================================================
   READING PROGRESS BAR
   ========================================================================== */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--surface);
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--dur-377) var(--ease-out-expo);
}

.reading-progress.visible {
    opacity: 1;
}

.reading-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--amber), var(--amber-bright));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 50ms linear;
    box-shadow: 0 0 10px var(--amber-glow);
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.loading {
    opacity: 0;
}

body:not(.loading) {
    opacity: 1;
    transition: opacity 1s var(--ease-out-expo);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--content-padding);
    position: relative;
    overflow: hidden;
}

/* Hero Pulse Rings */
.hero-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 500px;
    height: 500px;
    transform: translate(-50%, -50%) scale(0.16);
    border-radius: 50%;
    border: 1px solid var(--amber);
    opacity: 0;
}

.pulse-ring-1 { animation: pulse-expand 7s ease-out infinite; }
.pulse-ring-2 { animation: pulse-expand 8s ease-out 2.5s infinite; }
.pulse-ring-3 { animation: pulse-expand 6.5s ease-out 5s infinite; }

@keyframes pulse-expand {
    0% {
        transform: translate(-50%, -50%) scale(0.16);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* Hero Content */
.hero-content {
    text-align: center;
    max-width: 800px;
    position: relative;
    z-index: 2;
}

.address-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--amber);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--space-4);
    opacity: 0;
    animation: fade-up 1s var(--ease-out-expo) 0.2s forwards;
}

.label-line {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--amber-dim), transparent);
}

.hero-title {
    margin-bottom: var(--space-4);
    position: relative;
}

.title-main {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-hero);
    font-weight: 400;
    font-style: italic;
    line-height: 1;
    color: var(--text);
    letter-spacing: -0.03em;
    opacity: 0;
    animation: fade-up 1.2s var(--ease-out-expo) 0.4s forwards;
}

.title-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 80px;
    background: radial-gradient(ellipse, var(--amber-glow), transparent 70%);
    filter: blur(40px);
    opacity: 0;
    animation: glow-pulse 4s ease-in-out 1.5s infinite;
    pointer-events: none;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.hero-subtitle {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 400;
    font-style: italic;
    color: var(--text-dim);
    margin-bottom: var(--space-5);
    opacity: 0;
    animation: fade-up 1s var(--ease-out-expo) 0.6s forwards;
}

.hero-narrative {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--text-whisper);
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto var(--space-5);
    opacity: 0;
    animation: fade-up 1s var(--ease-out-expo) 0.8s forwards;
}

/* Terminal Demo */
.terminal {
    background: var(--obsidian);
    border: 1px solid var(--surface);
    border-radius: 12px;
    overflow: hidden;
    text-align: left;
    max-width: 480px;
    margin: 0 auto;
    opacity: 0;
    animation: fade-up 1s var(--ease-out-expo) 1s forwards;
}

.terminal-chrome {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--surface);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface-elevated);
}

.terminal-dot:nth-child(1) { background: #FF5F56; }
.terminal-dot:nth-child(2) { background: #FFBD2E; }
.terminal-dot:nth-child(3) { background: #27CA40; }

.terminal-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-whisper);
}

.terminal-screen {
    padding: var(--space-3);
}

.terminal-line {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.terminal-prompt {
    color: var(--cyan);
    margin-right: 8px;
}

.terminal-command {
    color: var(--text);
}

.terminal-output {
    margin-bottom: var(--space-2);
}

.output-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-dim);
    padding: 6px 0;
    opacity: 0;
    animation: terminal-item 0.5s var(--ease-out-expo) calc(var(--delay, 0) * 1s + 1.5s) forwards;
}

.output-item[data-delay="0.1"] { --delay: 0.1; }
.output-item[data-delay="0.2"] { --delay: 0.2; }
.output-item[data-delay="0.3"] { --delay: 0.3; }
.output-item[data-delay="0.4"] { --delay: 0.4; }
.output-item[data-delay="0.5"] { --delay: 0.5; }

@keyframes terminal-item {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.output-spinner {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber-dim);
}

.output-check {
    width: 8px;
    height: 8px;
    margin-left: auto;
}

.output-check::after {
    content: '✓';
    color: var(--emerald);
    font-size: 10px;
}

.terminal-result {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--emerald);
    padding-top: var(--space-2);
    border-top: 1px solid var(--surface);
    opacity: 0;
    animation: fade-up 0.5s var(--ease-out-expo) 2.2s forwards;
}

.result-check::before {
    content: '✓';
    margin-right: 4px;
}

.result-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-whisper);
}

/* Scroll Indicator */
.scroll-indicator-wrapper {
    position: absolute;
    bottom: var(--space-5);
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2);
    cursor: pointer;
    pointer-events: auto;
    border-radius: 8px;
    transition: all var(--dur-233) var(--ease-out-expo);
    opacity: 0;
    animation: fade-up 1s var(--ease-out-expo) 2.5s forwards;
}

.scroll-indicator:hover {
    background: var(--surface);
}

.scroll-text {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-whisper);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color var(--dur-233);
}

.scroll-indicator:hover .scroll-text {
    color: var(--text-dim);
}

.scroll-line {
    width: 1px;
    height: 32px;
    background: linear-gradient(180deg, var(--amber), transparent);
    animation: scroll-pulse 2.5s ease-in-out infinite;
}

@keyframes scroll-pulse {
    0%, 100% { opacity: 0.4; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.2); }
}

.scroll-chevron {
    width: 12px;
    height: 12px;
    border-right: 1.5px solid var(--amber);
    border-bottom: 1.5px solid var(--amber);
    transform: rotate(45deg);
    animation: scroll-bounce 2s ease-in-out infinite;
    margin-top: -4px;
}

@keyframes scroll-bounce {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.6; }
    50% { transform: rotate(45deg) translateY(4px); opacity: 1; }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 6, 11, 0.92);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--surface);
    opacity: 0;
    transform: translateY(-100%);
    transition: all var(--dur-610) var(--ease-out-expo);
}

.nav-bar.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.nav-logo {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 500;
    font-style: italic;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color var(--dur-233);
}

.nav-logo:hover {
    color: var(--amber);
}

.nav-links {
    display: flex;
    gap: var(--space-1);
}

.nav-link {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-whisper);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: var(--space-1) var(--space-2);
    border-radius: 6px;
    transition: all var(--dur-233) var(--ease-out-expo);
    position: relative;
}

.nav-num {
    color: var(--amber-dim);
    margin-right: 4px;
    font-size: 10px;
}

.nav-link:hover {
    color: var(--text-dim);
    background: var(--surface);
}

.nav-link.active {
    color: var(--text);
    background: var(--amber-whisper);
}

.nav-link.active .nav-num {
    color: var(--amber);
}

@media (max-width: 900px) {
    .nav-links { gap: 0; }
    .nav-link { padding: 8px 10px; font-size: 10px; }
    .nav-num { display: none; }
}

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

/* ==========================================================================
   STATS SECTION
   ========================================================================== */

.stats-section {
    padding: var(--space-6) var(--content-padding);
    border-bottom: 1px solid var(--surface);
}

.stats-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}

.stat-card {
    text-align: center;
    padding: var(--space-4);
    background: var(--surface);
    border-radius: var(--card-radius);
    border: 1px solid transparent;
    transition: all var(--dur-377) var(--ease-out-expo);
    opacity: 0;
    transform: translateY(24px);
}

.stat-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-card:hover {
    border-color: var(--amber-whisper);
    transform: translateY(-4px);
}

.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 500;
    color: var(--amber);
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-unit {
    font-size: var(--text-lg);
    font-weight: 400;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-whisper);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

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

@media (max-width: 500px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: var(--space-2); }
    .stat-card { padding: var(--space-3); }
    .stat-value { font-size: var(--text-2xl); }
}

@media (max-width: 320px) {
    html { font-size: 14px; }
    .stats-grid { grid-template-columns: 1fr; }
    .section-title { font-size: var(--text-2xl); }
    .hero-subtitle { font-size: var(--text-lg); }
    .terminal { max-width: 100%; }
    .section { padding: var(--space-5) 0; }
    .footer-links { flex-direction: column; gap: var(--space-1); }
}

@media (min-width: 768px) and (max-width: 899px) {
    .tier-diagram { gap: var(--space-1); }
    .tier-card { min-width: 220px; }
}

@media (min-width: 1440px) {
    :root {
        --max-width: 1320px;
    }
    .capabilities-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */

.section {
    padding: var(--space-7) 0;
}

.section-alt {
    background: var(--void-warm);
}

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

.section-header {
    text-align: center;
    margin-bottom: var(--space-6);
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.section-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.section-line {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--amber-dim), transparent);
}

.section-number {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--amber);
    letter-spacing: 0.3em;
}

.section-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 400;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: var(--space-3);
}

.section-title em {
    color: var(--amber);
    font-style: italic;
}

.section-description {
    font-size: var(--text-base);
    color: var(--text-dim);
    line-height: 1.7;
}

/* ==========================================================================
   CAPABILITY CARDS
   ========================================================================== */

.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-4);
}

.capability-card {
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--card-radius);
    padding: var(--space-4);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all var(--dur-377) var(--ease-out-expo);
    opacity: 0;
    transform: translateY(24px);
}

.capability-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Top accent bar */
.capability-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--category-color, var(--amber));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-377) var(--ease-out-expo);
}

/* Hover gradient */
.capability-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--amber-whisper),
        transparent 40%
    );
    opacity: 0;
    transition: opacity var(--dur-233);
    pointer-events: none;
}

.capability-card:hover {
    border-color: var(--surface-hover);
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.capability-card:hover::before {
    transform: scaleX(1);
}

.capability-card:hover::after {
    opacity: 1;
}

/* Category colors */
.capability-card[data-category="lighting"] { --category-color: var(--lighting); }
.capability-card[data-category="audio"] { --category-color: var(--audio); }
.capability-card[data-category="climate"] { --category-color: var(--climate); }
.capability-card[data-category="shades"] { --category-color: var(--shades); }
.capability-card[data-category="security"] { --category-color: var(--security); }
.capability-card[data-category="entertainment"] { --category-color: var(--entertainment); }
.capability-card[data-category="outdoor"] { --category-color: var(--outdoor); }
.capability-card[data-category="sleep"] { --category-color: var(--sleep); }
.capability-card[data-category="communication"] { --category-color: var(--communication); }
.capability-card[data-category="projects"] { --category-color: var(--projects); }
.capability-card[data-category="schedule"] { --category-color: var(--schedule); }
.capability-card[data-category="content"] { --category-color: var(--content); }
.capability-card[data-category="circadian"] { --category-color: var(--circadian); }
.capability-card[data-category="presence"] { --category-color: var(--presence); }
.capability-card[data-category="predictive"] { --category-color: var(--predictive); }
.capability-card[data-category="visitors"] { --category-color: var(--visitors); }

.card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-elevated);
    border: 1px solid var(--surface);
    border-radius: 12px;
    flex-shrink: 0;
    transition: all var(--dur-377) var(--ease-spring);
}

.card-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--category-color, var(--amber));
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: all var(--dur-233);
}

.capability-card:hover .card-icon {
    transform: scale(1.1) rotate(-5deg);
    border-color: var(--category-color, var(--amber));
    box-shadow: 0 0 20px color-mix(in srgb, var(--category-color, var(--amber)) 30%, transparent);
}

.capability-card:hover .card-icon svg {
    filter: drop-shadow(0 0 8px var(--category-color, var(--amber)));
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 500;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 4px;
}

.card-count {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--category-color, var(--amber));
    letter-spacing: 0.04em;
}

.card-description {
    font-size: var(--text-sm);
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: var(--space-3);
    flex-grow: 1;
}

.card-features {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    padding-top: var(--space-3);
    border-top: 1px solid var(--surface);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-whisper);
    transition: color var(--dur-233);
}

.capability-card:hover .feature-item {
    color: var(--text-dim);
}

.feature-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--category-color, var(--amber));
    flex-shrink: 0;
    opacity: 0.6;
    transition: all var(--dur-233);
}

.capability-card:hover .feature-dot {
    opacity: 1;
    box-shadow: 0 0 6px var(--category-color, var(--amber));
}

@media (max-width: 700px) {
    .capabilities-grid { grid-template-columns: 1fr; }
    .card-features { grid-template-columns: 1fr; }
}

/* ==========================================================================
   TIER DIAGRAM
   ========================================================================== */

.tier-diagram {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}

.tier-card {
    flex: 1;
    min-width: 280px;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--card-radius);
    padding: var(--space-4);
    text-align: center;
    position: relative;
    transition: all var(--dur-377) var(--ease-out-expo);
    opacity: 0;
    transform: translateY(24px);
}

.tier-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.tier-card:hover {
    border-color: var(--amber-whisper);
    transform: translateY(-4px);
}

.tier-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--void);
    background: var(--amber);
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: var(--space-2);
}

.tier-1 .tier-badge { background: var(--security); }
.tier-2 .tier-badge { background: var(--presence); }
.tier-3 .tier-badge { background: var(--climate); }

.tier-name {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.tier-tech {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--amber);
    margin-bottom: var(--space-2);
}

.tier-desc {
    font-size: var(--text-sm);
    color: var(--text-dim);
    line-height: 1.6;
}

.tier-connector {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--amber-dim), var(--amber), var(--amber-dim));
    align-self: center;
    display: none;
}

@media (min-width: 900px) {
    .tier-connector { display: block; }
}

/* ==========================================================================
   CODE SHOWCASE
   ========================================================================== */

.code-showcase {
    background: var(--obsidian);
    border: 1px solid var(--surface);
    border-radius: 12px;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(24px);
}

.code-showcase.visible {
    opacity: 1;
    transform: translateY(0);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--surface);
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot:nth-child(1) { background: #FF5F56; }
.code-dot:nth-child(2) { background: #FFBD2E; }
.code-dot:nth-child(3) { background: #27CA40; }

.code-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-whisper);
}

.code-block {
    padding: var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.8;
    overflow-x: auto;
}

.code-comment { color: var(--text-whisper); }
.code-keyword { color: var(--cyan); }
.code-method { color: var(--amber); }
.code-string { color: var(--emerald); }
.code-param { color: var(--text-dim); }

/* ==========================================================================
   ARCHITECTURE DIAGRAM
   ========================================================================== */

.arch-diagram {
    max-width: 800px;
    margin: 0 auto var(--space-5);
}

.arch-layer {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(24px);
}

.arch-layer.visible {
    opacity: 1;
    transform: translateY(0);
}

.arch-primary { margin-bottom: var(--space-3); }
.arch-secondary { margin-bottom: var(--space-3); }

.arch-box {
    background: var(--surface);
    border: 1px solid var(--surface-elevated);
    border-radius: 12px;
    padding: var(--space-3) var(--space-4);
    text-align: center;
    transition: all var(--dur-377) var(--ease-out-expo);
}

.arch-box:hover {
    border-color: var(--amber-whisper);
    transform: translateY(-4px);
}

.arch-main {
    background: linear-gradient(135deg, var(--surface-elevated), var(--surface));
    border-color: var(--amber-whisper);
    padding: var(--space-4) var(--space-5);
}

.arch-label {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.arch-sublabel {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-whisper);
}

.arch-connector-line {
    width: 2px;
    height: 24px;
    background: linear-gradient(180deg, var(--amber), var(--amber-dim));
    margin: var(--space-2) auto;
}

.arch-tertiary {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.priority-badge {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
}

.priority-critical {
    background: rgba(231, 76, 60, 0.2);
    color: #E74C3C;
}

.priority-high {
    background: rgba(230, 126, 34, 0.2);
    color: #E67E22;
}

.priority-medium {
    background: rgba(39, 174, 96, 0.2);
    color: #27AE60;
}

.priority-low {
    background: rgba(6, 182, 212, 0.2);
    color: #06B6D4;
}

/* ==========================================================================
   CALLOUT
   ========================================================================== */

.callout {
    background: var(--surface);
    border-left: 3px solid var(--amber);
    border-radius: 0 12px 12px 0;
    padding: var(--space-4);
    margin-bottom: var(--space-5);
    opacity: 0;
    transform: translateY(24px);
}

.callout.visible {
    opacity: 1;
    transform: translateY(0);
}

.callout-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--amber);
    margin-bottom: var(--space-2);
}

.callout p {
    font-size: var(--text-sm);
    color: var(--text-dim);
    line-height: 1.7;
}

/* ==========================================================================
   DATA TABLE
   ========================================================================== */

.table-wrapper {
    overflow-x: auto;
    opacity: 0;
    transform: translateY(24px);
}

.table-wrapper.visible {
    opacity: 1;
    transform: translateY(0);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.data-table th,
.data-table td {
    padding: var(--space-2) var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--surface);
}

.data-table th {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--amber);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--surface);
}

.data-table td {
    color: var(--text-dim);
}

.data-table tr:hover td {
    background: var(--surface);
}

.data-table .mono {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text);
}

/* ==========================================================================
   TIMELINE
   ========================================================================== */

.timeline-container {
    max-width: 700px;
    margin: 0 auto;
}

.timeline-track {
    position: relative;
    padding-left: var(--space-6);
}

.timeline-track::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        var(--amber) 5%,
        var(--amber) 95%,
        transparent 100%
    );
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-5);
    opacity: 0;
    transform: translateX(24px);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-marker {
    position: absolute;
    left: calc(-1 * var(--space-6) + 10px);
    top: 4px;
    width: 14px;
    height: 14px;
    background: var(--amber);
    border: 3px solid var(--void);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--amber-whisper);
    z-index: 1;
}

.timeline-time {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--amber);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-1);
}

.timeline-content {
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: var(--space-3);
    transition: all var(--dur-377) var(--ease-out-expo);
}

.timeline-item:hover .timeline-content {
    border-color: var(--surface-hover);
    transform: translateX(4px);
}

.timeline-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--space-1);
}

.timeline-description {
    font-size: var(--text-sm);
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: var(--space-2);
}

.timeline-tags {
    display: flex;
    gap: var(--space-1);
    flex-wrap: wrap;
}

.timeline-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--amber);
    background: var(--amber-whisper);
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 0.03em;
}

/* ==========================================================================
   LESSONS GRID
   ========================================================================== */

.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
}

.lesson-card {
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: var(--card-radius);
    padding: var(--space-4);
    transition: all var(--dur-377) var(--ease-out-expo);
    opacity: 0;
    transform: translateY(24px);
}

.lesson-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.lesson-card:hover {
    border-color: var(--amber-whisper);
    transform: translateY(-4px);
}

.lesson-number {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--amber);
    letter-spacing: 0.1em;
    margin-bottom: var(--space-2);
}

.lesson-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--space-2);
}

.lesson-text {
    font-size: var(--text-sm);
    color: var(--text-dim);
    line-height: 1.7;
}

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

.footer {
    padding: var(--space-7) var(--content-padding);
    text-align: center;
    border-top: 1px solid var(--surface);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-kanji {
    font-family: 'Noto Sans JP', serif;
    font-size: var(--text-4xl);
    color: var(--amber);
    margin-bottom: var(--space-3);
    opacity: 0.8;
}

.footer-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 500;
    font-style: italic;
    color: var(--text);
    margin-bottom: var(--space-1);
}

.footer-subtitle {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-whisper);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-3);
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.footer-link {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-whisper);
    text-decoration: none;
    padding: var(--space-1) var(--space-2);
    border-radius: 6px;
    transition: all var(--dur-233) var(--ease-out-expo);
}

.footer-link:hover {
    color: var(--amber);
    background: var(--surface);
}

.footer-link svg {
    flex-shrink: 0;
}

.footer-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-whisper);
}

.footer-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-whisper);
}

/* ==========================================================================
   SHIMMER TEXT
   ========================================================================== */

.shimmer {
    background: linear-gradient(
        135deg,
        var(--text) 0%,
        var(--amber) 25%,
        var(--text) 50%,
        var(--amber) 75%,
        var(--text) 100%
    );
    background-size: 400% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 8s ease infinite;
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ==========================================================================
   REVEAL ANIMATIONS
   ========================================================================== */

[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: all var(--dur-610) var(--ease-out-expo);
}

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

/* ==========================================================================
   EASTER EGG OVERLAY
   ========================================================================== */

.easter-egg-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    cursor: pointer;
    transition: background 2s var(--ease-out-expo);
}

.easter-egg-night {
    background: rgba(7, 6, 11, 0);
}

.easter-egg-night.active {
    background: rgba(7, 6, 11, 0.97);
}

.easter-egg-morning {
    background: rgba(255, 200, 100, 0);
}

.easter-egg-morning.active {
    background: linear-gradient(180deg,
        rgba(255, 180, 80, 0.95) 0%,
        rgba(255, 140, 60, 0.90) 50%,
        rgba(200, 100, 50, 0.85) 100%
    );
}

.easter-egg-morning .easter-egg-title {
    color: var(--void);
}

.easter-egg-morning .easter-egg-sequence {
    color: rgba(0, 0, 0, 0.6);
}

.easter-egg-cinema {
    background: rgba(0, 0, 0, 0);
}

.easter-egg-cinema.active {
    background: rgba(0, 0, 0, 0.98);
}

.easter-egg-cinema .easter-egg-title {
    color: var(--amber);
}

.easter-egg-content {
    text-align: center;
}

.easter-egg-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 400;
    font-style: italic;
    color: var(--text);
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 1s var(--ease-out-expo);
}

.easter-egg-overlay.active .easter-egg-title {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.easter-egg-sequence {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--text-whisper);
    margin-top: var(--space-4);
    min-height: 24px;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.easter-egg-overlay.active .easter-egg-sequence {
    opacity: 1;
    transition-delay: 0.6s;
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

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

    .hero-pulse,
    .breath-layer,
    .particles-container,
    .title-glow,
    .grain-overlay {
        display: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   SELECTION
   ========================================================================== */

::selection {
    background: var(--amber-whisper);
    color: var(--text);
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .breath-layer,
    .background-canvas,
    .grain-overlay,
    .cursor,
    .cursor-ring,
    .particles-container,
    .reading-progress,
    .nav-bar,
    .scroll-indicator-wrapper,
    .hero-pulse {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .capability-card,
    .stat-card,
    .tier-card,
    .lesson-card,
    .timeline-content,
    .callout {
        background: #f5f5f5;
        border: 1px solid #ddd;
    }
}
