/* ==========================================================================
   Design Token Definition System (High-Discipline Minimalist Void Archetype)
   ========================================================================== */
:root {
    --bg-void: #000000;
    --bg-carbon-base: #0B0B0C;
    --bg-carbon-elevated: #121214;
    --border-subtle: #222224;
    --border-active: #444448;
    
    --text-primary: #FFFFFF;
    --text-secondary: #8E8E93;
    --text-muted: #48484A;
    
    --accent-glow: rgba(255, 255, 255, 0.08);
    --accent-green: #30D158;
    --accent-cyan: #5AC8F5;
    
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Adjustments & Normalization */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-sans);
    background-color: var(--bg-void);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
    position: relative;
}

/* Ambient Subtle Digital Grid Layer Overlay */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

/* Typography Overrides */
h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Buttons and Clickable Interfaces */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-void);
    border: 1px solid var(--text-primary);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--text-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
    background-color: var(--bg-carbon-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    border-color: var(--border-active);
    background-color: rgba(255, 255, 255, 0.03);
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: var(--bg-carbon-base);
    border: 1px solid var(--border-subtle);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Navigation Header Architecture
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    background-color: rgba(0, 0, 0, 0.7);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.04em;
}

.logo .dot {
    color: var(--text-secondary);
}

.nav-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-right: 2rem;
    transition: var(--transition-smooth);
}

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

/* ==========================================================================
   Hero Layout and 3D Card Simulation Engine
   ========================================================================== */
.hero-section {
    padding: 8rem 0 6rem 0;
    text-align: center;
    perspective: 1200px; /* Crucial for 3D Transform Mechanics */
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    max-width: 800px;
    margin-bottom: 1.5rem;
}

.gradient-text {
    color: var(--text-secondary);
    background: linear-gradient(180deg, #FFFFFF 0%, #444446 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.125rem;
    max-width: 600px;
    margin-bottom: 4rem;
}

/* 3D Dashboard Canvas Elements */
.perspective-wrapper {
    width: 100%;
    max-width: 900px;
    perspective: 1000px;
}

.dashboard-preview {
    background-color: var(--bg-carbon-base);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    width: 100%;
    text-align: left;
    overflow: hidden;
    transform: rotateX(8deg) rotateY(0deg);
    transform-style: preserve-3d;
    transition: transform 0.1s linear, box-shadow 0.3s ease;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 255, 255, 0.01);
}

.dashboard-preview:hover {
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.9), 0 0 50px rgba(255, 255, 255, 0.03);
}

.dash-header {
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
}

.dash-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
    margin-right: 6px;
}

.dash-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 1rem;
}

.dash-body {
    padding: 2rem;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background-color: var(--bg-carbon-elevated);
    border: 1px solid var(--border-subtle);
    padding: 1rem;
    border-radius: 4px;
}

.metric-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.green-glow {
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(48, 209, 88, 0.3);
}

.mock-terminal {
    background-color: #050506;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
}

.t-purple { color: #D158FF; }
.t-dim { color: var(--text-muted); }
.t-green { color: var(--accent-green); }
.t-cyan { color: var(--accent-cyan); }

/* ==========================================================================
   Sandbox Core Interactivity Modules
   ========================================================================== */
.sandbox-section {
    padding: 6rem 0;
    border-top: 1px solid var(--border-subtle);
}

.section-header {
    max-width: 600px;
    margin-bottom: 3.5rem;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.sandbox-card {
    background-color: var(--bg-carbon-base);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 2.5rem;
    min-height: 450px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sandbox-state {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    flex-grow: 1;
}

.sandbox-state.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
}

/* File Drag Layer Configs */
.drop-zone {
    border: 1px dashed var(--border-subtle);
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: 6px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-bottom: 1.5rem;
}

.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.02);
}

.drop-icon {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.drop-prompt {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.drop-prompt code {
    font-family: var(--font-mono);
    background-color: var(--bg-carbon-elevated);
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.browse-link {
    text-decoration: underline;
    color: var(--text-primary);
}

.drop-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Text Composer Fallback Area */
.text-input-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.input-header {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

textarea {
    width: 100%;
    height: 120px;
    background-color: var(--bg-carbon-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    resize: none;
    transition: var(--transition-smooth);
}

textarea:focus {
    outline: none;
    border-color: var(--border-active);
}

.action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

/* Loading Operational System Layout */
.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 4rem 0;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: rotate-spin 0.8s linear infinite;
    margin-bottom: 1.5rem;
}

.loading-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.loading-sub {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Immutable Output Layout Context */
.success-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-top: 1rem;
}

.success-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(48, 209, 88, 0.1);
    color: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
}

.success-icon {
    width: 20px;
    height: 20px;
}

.success-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.output-url-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-carbon-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    overflow: hidden;
    padding: 0.5rem;
    margin-bottom: 3rem;
}

.url-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-green);
    background-color: rgba(48, 209, 88, 0.1);
    padding: 0.35rem 0.65rem;
    border-radius: 3px;
    margin-right: 1rem;
}

#generatedUrl {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
}

.btn-copy {
    background-color: var(--text-primary);
    color: var(--bg-void);
    border: none;
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-copy.copied {
    background-color: var(--accent-green);
    color: var(--bg-void);
}

.output-actions {
    display: flex;
    justify-content: center;
    margin-top: auto;
}

/* ==========================================================================
   Code Snippet / Integration Block Setup
   ========================================================================== */
.code-section {
    padding: 6rem 0;
    border-top: 1px solid var(--border-subtle);
}

.grid-split {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
}

.feature-checklist {
    list-style: none;
    margin-top: 2rem;
}

.feature-checklist li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.feature-checklist li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--text-primary);
    font-weight: bold;
}

/* Syntax Highlighting Container Structure */
.code-editor-block {
    background-color: var(--bg-carbon-base);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
}

.editor-header {
    display: flex;
    background-color: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 1rem;
}

.editor-tab {
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.editor-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.editor-body {
    padding: 1.5rem;
    overflow-x: auto;
}

.editor-body pre {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: #E5E5EA;
}

/* Syntax Color Definition Layers */
.keyword { color: #FF453A; }
.variable { color: #FF9F0A; }
.string { color: #30D158; }
.function { color: #0A84FF; }
.property { color: #BF5AF2; }
.comment { color: var(--text-muted); }

/* ==========================================================================
   Capabilities Architecture Layout Matrix Grid
   ========================================================================== */
.features-section {
    padding: 6rem 0 10rem 0;
    border-top: 1px solid var(--border-subtle);
}

.text-center {
    text-align: center;
    margin-right: auto;
    margin-left: auto;
}

.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.capability-card {
    background-color: var(--bg-carbon-base);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 2.5rem 2rem;
    transition: var(--transition-smooth);
}

.capability-card:hover {
    border-color: var(--border-active);
    transform: translateY(-4px);
}

.cap-icon-box {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.capability-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* ==========================================================================
   Footer Execution System
   ========================================================================== */
.site-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 4rem 0;
    background-color: #030303;
}

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

.f-logo {
    font-size: 1.1rem;
    font-weight: 800;
}

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

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Keyframe Animations System */
@keyframes rotate-spin {
    to { transform: rotate(360deg); }
}

/* Responsive Adaptive Viewports Media Queries */
@media (max-width: 968px) {
    .grid-split {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .capabilities-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .metrics-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
