/* ============================================================
   AISIBLE OS — The Agentic Nerve Center
   ============================================================
   A living interface. Dark, atmospheric, alive.
   The website IS the operating system.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Design Tokens ─────────────────────────────────────────── */
:root {
    /* Depth layers */
    --void: #06070B;
    --surface-0: #0C0E16;
    --surface-1: #12151F;
    --surface-2: #1A1E2C;
    --surface-3: #232839;

    /* Borders */
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --border-active: rgba(232,168,56,0.3);

    /* Text */
    --text: #E2E8F0;
    --text-2: #94A3B8;
    --text-3: #64748B;
    --text-4: #475569;

    /* Accent — Amber (intelligence, energy) */
    --amber: #E8A838;
    --amber-bright: #F5BD4F;
    --amber-dim: rgba(232,168,56,0.12);
    --amber-glow: rgba(232,168,56,0.06);

    /* Secondary — Cyan (data, connections) */
    --cyan: #22D3EE;
    --cyan-dim: rgba(34,211,238,0.10);

    /* Semantic */
    --emerald: #34D399;
    --emerald-dim: rgba(52,211,153,0.12);
    --rose: #FB7185;
    --rose-dim: rgba(251,113,133,0.12);

    /* Typography */
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-heading: 'Syne', system-ui, sans-serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Spacing */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 24px;
    --sp-6: 32px;
    --sp-7: 48px;
    --sp-8: 64px;
    --sp-9: 96px;
    --sp-10: 128px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration: 0.6s;
    --duration-fast: 0.3s;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) var(--void);
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--void);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ambient background — gradient mesh + grid */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(232,168,56,0.04) 0%, transparent 70%),
        radial-gradient(ellipse 60% 60% at 80% 20%, rgba(34,211,238,0.025) 0%, transparent 60%),
        radial-gradient(ellipse 50% 80% at 50% 100%, rgba(232,168,56,0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Subtle grid overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 30%, transparent 80%);
}

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

img { max-width: 100%; display: block; }

a {
    color: var(--amber);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--amber-bright); }

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

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

/* ─── Layout ────────────────────────────────────────────────── */
.page {
    position: relative;
    z-index: 1;
}

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

@media (max-width: 768px) {
    .container { padding: 0 var(--sp-5); }
}

.section {
    padding: var(--sp-10) 0;
}

.section-sm {
    padding: var(--sp-9) 0;
}

/* ─── System Bar (Navigation) ───────────────────────────────── */
.system-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: rgba(6,7,11,0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 var(--sp-6);
    z-index: 1000;
    font-family: var(--font-heading);
}

.system-bar-logo {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.04em;
}

.system-bar-logo img {
    width: 22px;
    height: 22px;
    border-radius: 4px;
}

.system-bar-logo span {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
}

/* Agent status indicators in system bar */
.system-bar-agents {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-left: var(--sp-6);
    padding-left: var(--sp-6);
    border-left: 1px solid var(--border);
}

.agent-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--emerald);
    animation: pulse-dot 3s ease-in-out infinite;
}

.agent-dot:nth-child(2) { animation-delay: 0.5s; background: var(--amber); }
.agent-dot:nth-child(3) { animation-delay: 1s; }
.agent-dot:nth-child(4) { animation-delay: 1.5s; background: var(--cyan); }
.agent-dot:nth-child(5) { animation-delay: 2s; }

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

.system-bar-status {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
    margin-left: var(--sp-3);
}

.system-bar-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--sp-7);
}

.system-bar-nav a {
    color: var(--text-3);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color var(--duration-fast) var(--ease-out);
    position: relative;
}

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

.system-bar-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--amber);
}

.system-bar-cta {
    margin-left: var(--sp-5);
    padding: 6px 16px;
    background: var(--amber);
    color: var(--void);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: none;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.system-bar-cta:hover {
    background: var(--amber-bright);
    color: var(--void);
    box-shadow: 0 0 20px var(--amber-dim);
}

/* ─── Typography ────────────────────────────────────────────── */
.display {
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 120px);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--text);
}

.display em, .display i {
    font-style: italic;
    color: var(--amber);
}

h1, .h1 {
    font-family: var(--font-heading);
    font-size: clamp(36px, 5vw, 72px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

h2, .h2 {
    font-family: var(--font-heading);
    font-size: clamp(28px, 3.5vw, 48px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

h3, .h3 {
    font-family: var(--font-heading);
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 600;
    line-height: 1.3;
}

h4, .h4 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
}

.body-lg {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-2);
}

.mono {
    font-family: var(--font-mono);
}

.label {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--amber);
}

.label-muted {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-4);
}

/* ─── Panels ────────────────────────────────────────────────── */
.panel {
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.panel:hover {
    border-color: var(--border-hover);
}

.panel-glow:hover {
    border-color: var(--border-active);
    box-shadow: 0 0 40px var(--amber-glow), 0 8px 32px rgba(0,0,0,0.4);
}

.panel-glass {
    background: rgba(12,14,22,0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.panel-header {
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-body {
    padding: var(--sp-5);
}

.panel-body-lg {
    padding: var(--sp-7);
}

/* ─── Terminal ──────────────────────────────────────────────── */
.terminal {
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.terminal-header {
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

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

.terminal-dot.red { background: #FF5F57; }
.terminal-dot.yellow { background: #FEBC2E; }
.terminal-dot.green { background: #28C840; }

.terminal-title {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-4);
    margin-left: var(--sp-3);
}

.terminal-body {
    padding: var(--sp-5);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-2);
}

.t-prompt { color: var(--amber); }
.t-prompt::before { content: '> '; color: var(--text-4); }
.t-output { color: var(--text); }
.t-muted { color: var(--text-4); }
.t-success { color: var(--emerald); }
.t-warn { color: var(--amber); }
.t-error { color: var(--rose); }
.t-cyan { color: var(--cyan); }
.t-label { color: var(--amber); opacity: 0.7; }

.terminal-cursor {
    display: inline-block;
    width: 7px;
    height: 15px;
    background: var(--amber);
    opacity: 0.8;
    animation: cursor-blink 1.2s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0; }
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 12px 28px;
    background: var(--amber);
    color: var(--void);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-primary:hover {
    background: var(--amber-bright);
    color: var(--void);
    box-shadow: 0 0 24px var(--amber-dim), 0 4px 16px rgba(0,0,0,0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 12px 28px;
    background: transparent;
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid var(--border-hover);
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-secondary:hover {
    border-color: var(--text-3);
    color: var(--text);
    background: var(--surface-1);
}

/* ─── Agent Cards ───────────────────────────────────────────── */
.agent-card {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 13px;
    transition: all var(--duration-fast) var(--ease-out);
}

.agent-card:hover {
    border-color: var(--border-hover);
    background: var(--surface-2);
}

.agent-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.agent-indicator.active { background: var(--emerald); box-shadow: 0 0 8px var(--emerald-dim); }
.agent-indicator.working { background: var(--amber); animation: pulse-dot 2s ease-in-out infinite; }
.agent-indicator.idle { background: var(--text-4); }

/* ─── Grid Layouts ──────────────────────────────────────────── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-5);
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--sp-5);
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
    align-items: center;
}

.split-wide {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--sp-8);
    align-items: center;
}

.split-wide.reverse {
    grid-template-columns: 0.8fr 1.2fr;
}

@media (max-width: 900px) {
    .grid-2, .grid-3, .split, .split-wide, .split-wide.reverse {
        grid-template-columns: 1fr;
    }
}

/* ─── Hero ──────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--sp-10) 0 var(--sp-9);
    position: relative;
}

.hero-overline {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--amber);
    letter-spacing: 0.08em;
    margin-bottom: var(--sp-6);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.hero-overline .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--emerald);
    animation: pulse-dot 2s ease-in-out infinite;
}

.hero-body {
    max-width: 800px;
    margin-top: var(--sp-7);
}

.hero-body p {
    font-size: 20px;
    line-height: 1.7;
    color: var(--text-2);
}

.hero-actions {
    display: flex;
    gap: var(--sp-4);
    margin-top: var(--sp-7);
    flex-wrap: wrap;
}

/* ─── Feature Sections ──────────────────────────────────────── */
.feature-label {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--amber);
    padding: 4px 10px;
    background: var(--amber-dim);
    border-radius: 4px;
    margin-bottom: var(--sp-5);
}

.feature-text {
    color: var(--text-2);
    line-height: 1.7;
    max-width: 520px;
}

.feature-list {
    list-style: none;
    margin-top: var(--sp-5);
}

.feature-list li {
    padding: var(--sp-2) 0;
    color: var(--text-2);
    font-size: 15px;
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
}

.feature-list li::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--amber);
    flex-shrink: 0;
    margin-top: 8px;
}

/* ─── Divider ───────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
    margin: var(--sp-9) 0;
}

/* ─── Stat / Metric ─────────────────────────────────────────── */
.stat {
    text-align: center;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-3);
    margin-top: var(--sp-2);
    letter-spacing: 0.04em;
}

/* ─── Contact Modal ─────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6,7,11,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--surface-0);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-in 0.3s var(--ease-out);
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    padding: var(--sp-5);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-3);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.modal-close:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-hover);
}

.modal-body {
    padding: var(--sp-5);
}

.form-group {
    margin-bottom: var(--sp-4);
}

.form-group label {
    display: block;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    margin-bottom: var(--sp-2);
    letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color var(--duration-fast) var(--ease-out);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-dim);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.form-submit {
    width: 100%;
    padding: 12px;
    background: var(--amber);
    color: var(--void);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.form-submit:hover {
    background: var(--amber-bright);
    box-shadow: 0 0 20px var(--amber-dim);
}

.modal-success {
    text-align: center;
    padding: var(--sp-8) var(--sp-5);
}

.modal-success h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-bottom: var(--sp-2);
}

.modal-success p {
    color: var(--text-2);
}

/* ─── Reveal Animations ─────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ─── Ambient Glow Background ───────────────────────────────── */
.glow-bg {
    position: relative;
}

.glow-bg::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--amber-glow) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

/* ─── Utilities ─────────────────────────────────────────────── */
.text-amber { color: var(--amber); }
.text-cyan { color: var(--cyan); }
.text-emerald { color: var(--emerald); }
.text-rose { color: var(--rose); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-center { text-align: center; }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-7 { margin-bottom: var(--sp-7); }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .system-bar { padding: 0 var(--sp-4); }
    .system-bar-agents { display: none; }
    .system-bar-status { display: none; }
    .system-bar-nav { gap: var(--sp-4); }
    .system-bar-cta { display: none; }

    .hero { min-height: auto; padding: 160px 0 var(--sp-8); }
    .section { padding: var(--sp-8) 0; }
    .section-sm { padding: var(--sp-7) 0; }

    .display { font-size: 42px; }
}

/* ─── Reduced Motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.15s !important;
    }
    .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}
