/* ================================================================
   CorvusTunnel Landing Page — Style
   Design: Dark premium glassmorphism, flying crow, micro-animations
   Entity: KALAI (kalai-tech.com)
   ================================================================ */

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

:root {
    --bg: #08080a;
    --bg-card: #0e0e14;
    --bg-elevated: #13131b;
    --surface: #18182a;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(242, 58, 58, 0.3);

    --text: #f4f4f6;
    --text-muted: #8c8c95;
    --text-dim: #6a6a72;

    --accent: #f23a3a;
    --accent-hover: #f87171;
    --accent-glow: rgba(242, 58, 58, 0.25);
    --accent-soft: rgba(242, 58, 58, 0.08);
    --silver: #c0c0c0;

    --gradient: linear-gradient(135deg, #f23a3a 0%, #c11f1f 50%, #f23a3a 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(242,58,58,0.15), rgba(193,31,31,0.05));

    --radius: 12px;
    --radius-lg: 20px;
    --radius-sm: 8px;

    --font: 'Archivo', system-ui, -apple-system, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Reveal Animations ───────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Old crow-container / crow-hero-img styles removed — hero now uses canvas animation */



/* ══════════════════════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════════════════════ */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 24px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#nav.nav-scrolled {
    background: rgba(10, 10, 15, 0.82);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.3px;
}
.nav-logo:hover { color: var(--text); }

.nav-crow-icon {
    transition: transform 0.3s ease;
}
.nav-logo:hover .nav-crow-icon {
    transform: rotate(-10deg) scale(1.1);
}

.nav-logo-text {
    background: linear-gradient(135deg, var(--text), var(--silver));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--accent);
    transition: width 0.3s ease;
}
.nav-links a:hover::after { width: 100%; }

.nav-github {
    display: flex !important;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.25s;
}
.nav-github::after { display: none !important; }
.nav-github:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 110;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ══════════════════════════════════════════════════════════════
   HERO
   ══════════════════════════════════════════════════════════════ */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 24px 100px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* Animated glow orbs */
.hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    animation: glowPulse 8s ease-in-out infinite;
}

.hero-glow-1 {
    width: 600px;
    height: 600px;
    background: var(--accent);
    top: -200px;
    right: -100px;
}

.hero-glow-2 {
    width: 450px;
    height: 450px;
    background: #f87171;
    bottom: -150px;
    left: -80px;
    animation-delay: 4s;
}

.hero-glow-3 {
    width: 300px;
    height: 300px;
    background: #6d28d9;
    top: 30%;
    left: 60%;
    animation-delay: 2s;
    opacity: 0.2;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.25; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(1.15); }
}

/* Subtle grid overlay */
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(239, 68, 68, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(239, 68, 68, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    border-radius: 100px;
    background: var(--accent-soft);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-hover);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 32px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: dotPulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }
    50% { opacity: 0.4; box-shadow: 0 0 4px rgba(34, 197, 94, 0.2); }
}

.hero-title {
    font-size: clamp(44px, 7vw, 76px);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -2.5px;
    margin-bottom: 24px;
}

.hero-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 100% center; }
}

.hero-subtitle {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 40px;
}

.hero-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-install {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    transition: all 0.35s;
    position: relative;
    overflow: hidden;
}
.hero-install::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.hero-install:hover::before { opacity: 1; }
.hero-install:hover {
    border-color: var(--accent);
    box-shadow: 0 0 40px var(--accent-glow), inset 0 0 20px rgba(239, 68, 68, 0.03);
}

.install-prompt {
    font-family: var(--mono);
    color: var(--accent);
    font-weight: 600;
    font-size: 15px;
    user-select: none;
}

.hero-install code {
    font-family: var(--mono);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--silver);
    position: relative;
    z-index: 1;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s, transform 0.2s;
    display: flex;
    position: relative;
    z-index: 1;
}
.copy-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin-top: 56px;
}

.stat { text-align: center; }
.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}
.stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}
.stat-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
}

/* ══════════════════════════════════════════════════════════════
   SECTIONS
   ══════════════════════════════════════════════════════════════ */
.section {
    padding: 100px 0;
    position: relative;
}
.section-dark {
    background: var(--bg-card);
}

.section-title {
    font-size: clamp(30px, 4.5vw, 44px);
    font-weight: 800;
    text-align: center;
    letter-spacing: -1px;
    margin-bottom: 12px;
}
.section-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 15.5px;
    margin-bottom: 56px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ══════════════════════════════════════════════════════════════
   GETTING STARTED (TIMELINE)
   ══════════════════════════════════════════════════════════════ */
.steps-timeline {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.step-card {
    display: flex;
    gap: 24px;
    padding-bottom: 40px;
}

.step-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px var(--accent-glow);
    position: relative;
    z-index: 1;
}

.step-line {
    width: 2px;
    flex: 1;
    background: linear-gradient(to bottom, var(--accent), rgba(239, 68, 68, 0.1));
    margin-top: 8px;
    border-radius: 1px;
}

.step-content {
    flex: 1;
    padding-top: 4px;
}

.step-content h3 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.step-content p {
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ── Code Blocks ───────────────────────────────────────────── */
.code-block {
    background: #0c0c14;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.code-block:hover {
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.04);
    border-bottom: 1px solid var(--border);
}

.code-lang {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.code-copy {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.code-copy:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--silver);
}

.code-prompt { color: var(--accent); font-weight: 600; }
.code-comment { color: var(--text-dim); }
.code-success { color: #22c55e; }
.code-error { color: #ef4444; }
.code-accent { color: var(--accent-hover); }
.code-dim { color: var(--text-dim); }

/* ══════════════════════════════════════════════════════════════
   FEATURES GRID
   ══════════════════════════════════════════════════════════════ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.feature-card {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}
.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-subtle);
    opacity: 0;
    transition: opacity 0.35s;
    border-radius: var(--radius-lg);
}
.feature-card:hover::before { opacity: 1; }
.feature-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(239, 68, 68, 0.08);
}

.feature-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-soft);
    border: 1px solid rgba(239, 68, 68, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: background 0.3s, box-shadow 0.3s;
}
.feature-card:hover .feature-icon-wrap {
    background: rgba(239, 68, 68, 0.12);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.feature-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    letter-spacing: -0.2px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    position: relative;
}

/* ══════════════════════════════════════════════════════════════
   ARCHITECTURE DIAGRAM
   ══════════════════════════════════════════════════════════════ */
.arch-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.arch-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-width: 160px;
    transition: all 0.3s;
    position: relative;
}
.arch-node::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), transparent);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}
.arch-node:hover::before { opacity: 1; }
.arch-node:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.arch-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.arch-label {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.3px;
}

.arch-detail {
    font-size: 11.5px;
    color: var(--text-dim);
    text-align: center;
}

.arch-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}

.arch-arrow {
    position: relative;
    width: 80px;
    height: 2px;
}

.arch-arrow-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), rgba(239, 68, 68, 0.3));
    border-radius: 1px;
    position: relative;
}
.arch-arrow-line::after {
    content: '↔';
    position: absolute;
    top: -10px;
    right: -4px;
    color: var(--accent);
    font-size: 12px;
}

.arch-arrow-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    top: -1px;
    animation: particleFlow 2s ease-in-out infinite;
}
.arch-arrow-particles span:nth-child(1) { animation-delay: 0s; }
.arch-arrow-particles span:nth-child(2) { animation-delay: 0.7s; }
.arch-arrow-particles span:nth-child(3) { animation-delay: 1.4s; }

@keyframes particleFlow {
    0% { left: 0; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

.arch-encrypt-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    padding: 2px 8px;
    background: var(--accent-soft);
    border-radius: 100px;
}

/* ══════════════════════════════════════════════════════════════
   API TABLE
   ══════════════════════════════════════════════════════════════ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg);
    scrollbar-width: thin;
    scrollbar-color: var(--surface) transparent;
}

.api-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.api-table th,
.api-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.api-table th {
    background: var(--surface);
    font-weight: 600;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    position: sticky;
    top: 0;
}

.api-table tr:last-child td { border-bottom: none; }

.api-table tr:hover td {
    background: rgba(239, 68, 68, 0.03);
}

.api-table td {
    color: var(--text-muted);
}

.api-table code {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--silver);
}

.api-method {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-right: 6px;
}

.api-method.get { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.api-method.post { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.api-method.ws { background: rgba(239, 68, 68, 0.12); color: #f87171; }

.auth-none {
    color: var(--text-dim);
    font-size: 12px;
}
.auth-token {
    color: #f59e0b;
    font-size: 12px;
    font-weight: 600;
}
.auth-session {
    color: #22c55e;
    font-size: 12px;
    font-weight: 600;
}
.auth-ticket {
    color: #f87171;
    font-size: 12px;
    font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   SECURITY
   ══════════════════════════════════════════════════════════════ */
.security-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.security-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: all 0.35s;
    position: relative;
    overflow: hidden;
}
.security-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s;
}
.security-card:hover::after { opacity: 1; }
.security-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.security-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.security-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.security-card p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ══════════════════════════════════════════════════════════════
   COMPARISON TABLE
   ══════════════════════════════════════════════════════════════ */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.compare-table th,
.compare-table td {
    padding: 14px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.compare-table th {
    background: var(--surface);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.compare-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--text);
}

.compare-table td {
    color: var(--text-muted);
}

.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:hover td { background: rgba(255, 255, 255, 0.01); }

.highlight-col {
    background: rgba(239, 68, 68, 0.06) !important;
    color: var(--text) !important;
}

.compare-table th.highlight-col {
    color: var(--accent-hover) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* ══════════════════════════════════════════════════════════════
   CTA
   ══════════════════════════════════════════════════════════════ */
.cta-container {
    text-align: center;
    position: relative;
    padding: 60px 24px;
}

.cta-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: var(--accent);
    filter: blur(150px);
    opacity: 0.12;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.cta-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    position: relative;
}

.cta-sub {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 32px;
    position: relative;
}

.cta-install {
    display: inline-flex;
    margin: 0 auto;
    position: relative;
}

/* ══════════════════════════════════════════════════════════════
   LEGAL & FOOTER
   ══════════════════════════════════════════════════════════════ */
.legal-section {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.legal-links a {
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 500;
    transition: color 0.2s;
}
.legal-links a:hover { color: var(--text-muted); }

.legal-sep {
    color: var(--text-dim);
    font-size: 12px;
    opacity: 0.5;
}

#footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
}

.footer-crow { opacity: 0.7; }
.footer-brand { font-weight: 600; color: var(--text-muted); }
.footer-sep { opacity: 0.3; }
.footer-copy a { color: var(--text-dim); }
.footer-copy a:hover { color: var(--accent); }
.footer-license { font-size: 12px; }

.footer-right {
    display: flex;
    gap: 20px;
}

.footer-right a {
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}
.footer-right a:hover { color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

/* Tablet */
/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .security-grid {
        grid-template-columns: 1fr;
    }

    .arch-diagram {
        flex-direction: column;
        gap: 12px;
    }

    .arch-connector {
        transform: rotate(90deg);
        padding: 4px 0;
    }

    .arch-node {
        min-width: 140px;
        padding: 20px 18px;
    }

    .compare-table { font-size: 13px; }
    .compare-table th,
    .compare-table td { padding: 10px 12px; }

    /* Make tables horizontally scrollable */
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
    }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    /* Global mobile spacing */
    .container { padding: 0 16px; }

    /* Sections mobile */
    .section { padding: 48px 0; }
    .section-title { font-size: clamp(24px, 7vw, 32px); }
    .section-sub { font-size: 14px; margin-bottom: 28px; }

    /* Features mobile */
    .features-grid { grid-template-columns: 1fr; gap: 14px; }
    .feature-card { padding: 20px 16px; }

    /* Steps mobile */
    .step-card { gap: 14px; padding: 20px 16px; }
    .step-number { width: 32px; height: 32px; font-size: 14px; }

    /* Code blocks mobile */
    .code-block {
        border-radius: var(--radius-sm);
        overflow-x: auto;
    }
    .code-block pre {
        font-size: 12px;
        white-space: pre;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .code-header { padding: 8px 12px; font-size: 11px; }
    .code-body { padding: 12px; }

    /* Architecture mobile */
    .arch-node { min-width: unset; width: 100%; padding: 18px 14px; }
    .arch-label { font-size: 13px; }
    .arch-icon svg { width: 28px; height: 28px; }

    /* Tables mobile — scrollable with min-width to prevent squishing */
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }
    .api-table { font-size: 12px; min-width: 520px; }
    .api-table th,
    .api-table td { padding: 8px 10px; }
    .api-method { font-size: 10px; padding: 2px 6px; }

    .compare-table { font-size: 12px; min-width: 480px; }
    .compare-table th,
    .compare-table td { padding: 8px 8px; }

    /* Security mobile */
    .security-grid { gap: 12px; }
    .security-card { padding: 20px 16px; }
    .security-card h3 { font-size: 16px; }

    /* CTA mobile */
    .cta-section { padding: 48px 16px; }
    .cta-section h2 { font-size: clamp(24px, 7vw, 32px); }

    /* Footer mobile */
    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    .footer-left { flex-wrap: wrap; justify-content: center; }
    .footer-right { justify-content: center; }

    /* Legal */
    .legal-links { gap: 6px; flex-wrap: wrap; justify-content: center; }
    .legal-links a { font-size: 11.5px; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — Very small screens
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
    .container { padding: 0 12px; }
    .section-title { font-size: 22px; }

    .feature-card h3 { font-size: 15px; }
    .feature-card p { font-size: 13px; }

    .step-card { padding: 16px 12px; }

    .arch-node { padding: 14px 10px; }
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--surface);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* ── Selection ───────────────────────────────────────────────── */
::selection {
    background: var(--accent-glow);
    color: var(--text);
}

/* ── Focus styles for accessibility ──────────────────────────── */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    /* crow-container removed — canvas animation handled inline */
    .reveal { opacity: 1; transform: none; }
    .fade-in { opacity: 1; transform: none; }
}
