/* TradingOS — Trading Infrastructure as a Service
   Transaction Science, Inc. */

/* ── Design Tokens ── */
:root {
    /* Neutrals — warm-tinted */
    --stone-950: #0c0a09;
    --stone-900: #1c1917;
    --stone-800: #292524;
    --stone-700: #44403c;
    --stone-600: #57534e;
    --stone-500: #78716c;
    --stone-400: #a8a29e;
    --stone-300: #d6d3d1;
    --stone-200: #e7e5e4;
    --stone-100: #f5f5f4;
    --stone-50:  #fafaf9;

    /* Accent — teal for trading */
    --accent: #00c2cc;
    --accent-light: #22d3ee;
    --accent-dark: #0891b2;
    --accent-dim: rgba(0, 194, 204, 0.1);
    --accent-glow: rgba(0, 194, 204, 0.25);
    --accent-border: rgba(0, 194, 204, 0.2);

    /* Semantic — dark by default */
    --text-primary: var(--stone-100);
    --text-secondary: var(--stone-400);
    --text-muted: var(--stone-500);
    --bg-base: var(--stone-950);
    --bg-surface: var(--stone-900);
    --bg-elevated: var(--stone-800);
    --border: var(--stone-800);
    --border-subtle: var(--stone-700);
    --nav-bg: rgba(12, 10, 9, 0.85);
    --selection-color: white;

    /* Typography */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
    --max-width: 1200px;
}

/* ── Dark theme (explicit) ── */
[data-theme="dark"] {
    --text-primary: var(--stone-100);
    --text-secondary: var(--stone-400);
    --text-muted: var(--stone-500);
    --bg-base: var(--stone-950);
    --bg-surface: var(--stone-900);
    --bg-elevated: var(--stone-800);
    --border: var(--stone-800);
    --border-subtle: var(--stone-700);
    --nav-bg: rgba(12, 10, 9, 0.85);
    --selection-color: white;
}

/* ── Light theme ── */
[data-theme="light"] {
    --text-primary: var(--stone-900);
    --text-secondary: var(--stone-600);
    --text-muted: var(--stone-500);
    --bg-base: var(--stone-50);
    --bg-surface: var(--stone-100);
    --bg-elevated: var(--stone-200);
    --border: var(--stone-200);
    --border-subtle: var(--stone-300);
    --accent: #0891b2;
    --accent-light: #00c2cc;
    --accent-dark: #0e7490;
    --accent-dim: rgba(8, 145, 178, 0.08);
    --accent-glow: rgba(8, 145, 178, 0.15);
    --accent-border: rgba(8, 145, 178, 0.2);
    --nav-bg: rgba(250, 250, 249, 0.85);
    --selection-color: var(--stone-900);
}

/* ── Auto theme — follows OS preference ── */
[data-theme="auto"] {
    /* Dark by default (matches :root) */
}

@media (prefers-color-scheme: light) {
    [data-theme="auto"] {
        --text-primary: var(--stone-900);
        --text-secondary: var(--stone-600);
        --text-muted: var(--stone-500);
        --bg-base: var(--stone-50);
        --bg-surface: var(--stone-100);
        --bg-elevated: var(--stone-200);
        --border: var(--stone-200);
        --border-subtle: var(--stone-300);
        --accent: #0891b2;
        --accent-light: #00c2cc;
        --accent-dark: #0e7490;
        --accent-dim: rgba(8, 145, 178, 0.08);
        --accent-glow: rgba(8, 145, 178, 0.15);
        --accent-border: rgba(8, 145, 178, 0.2);
        --nav-bg: rgba(250, 250, 249, 0.85);
        --selection-color: var(--stone-900);
    }
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

::selection {
    background-color: rgba(0, 194, 204, 0.25);
    color: var(--selection-color);
}

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

/* ── Layout ── */

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

/* ── Header ── */

header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}
.logo-mark {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

header nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}
header nav a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}
header nav a:hover {
    color: var(--text-primary);
    opacity: 1;
}

/* ── Theme Toggle ── */

.theme-toggle {
    display: flex;
    align-items: center;
    border-radius: 100px;
    padding: 0.15rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
}

.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 100px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 0;
}
.theme-btn:hover {
    color: var(--text-primary);
}
.theme-btn.active {
    background: var(--bg-surface);
    color: var(--accent);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ── Hero ── */

.hero {
    padding: 6rem 0 5rem;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    border-radius: 100px;
    padding: 0.4rem 1.2rem;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero-sub {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.5;
}

.hero-cta {
    display: inline-flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.7rem 1.75rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    opacity: 1;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: var(--border-subtle);
}
.btn-secondary:hover {
    border-color: var(--text-muted);
    opacity: 1;
}

/* ── Tagline ── */

.tagline {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.tagline p {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}
.tagline p strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Section shared ── */

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.section-sub {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 3rem;
}

/* ── Modules grid ── */

.modules {
    padding: 5rem 0;
}

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

.module-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.75rem;
    transition: border-color 0.2s, background 0.2s;
}
.module-card:hover {
    border-color: var(--accent-border);
    background: var(--bg-elevated);
}

.module-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    border-radius: 0.5rem;
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.module-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.module-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Compliance ── */

.compliance {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
}

.standards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.standard-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    border-radius: 0.375rem;
    padding: 0.4rem 1rem;
    letter-spacing: 0.02em;
}

/* ── Customers ── */

.customers {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
}

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

.customer-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.625rem;
    background: var(--bg-surface);
    transition: border-color 0.2s;
}
.customer-card:hover {
    border-color: var(--border-subtle);
}

.customer-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

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

/* ── Architecture ── */

.architecture {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.arch-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
}

.arch-stat .num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}

.arch-stat .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ── Footer ── */

footer {
    border-top: 1px solid var(--border);
    padding: 2rem 0;
}

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

footer .brand {
    font-size: 0.85rem;
    color: var(--text-muted);
}
footer .brand a {
    color: var(--text-secondary);
    font-weight: 500;
}
footer .brand a:hover {
    color: var(--text-primary);
}

footer nav a {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-left: 1.5rem;
}
footer nav a:hover {
    color: var(--text-secondary);
}

/* ── Scrollbar ── */

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--stone-700);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--stone-600);
}

/* ── Responsive ── */

@media (max-width: 900px) {
    .modules-grid { grid-template-columns: repeat(2, 1fr); }
    .customer-grid { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 2.5rem; }
    .arch-stats { gap: 2.5rem; }
    header nav { gap: 1.25rem; }
}

@media (max-width: 600px) {
    .modules-grid { grid-template-columns: 1fr; }
    .customer-grid { grid-template-columns: 1fr; }
    .hero { padding: 4rem 0 3rem; }
    .hero h1 { font-size: 2rem; }
    .hero-sub { font-size: 1.05rem; }
    header .container { height: auto; padding: 0.75rem 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
    header nav { display: none; }
    footer .container { flex-direction: column; gap: 1rem; text-align: center; }
    footer nav a { margin-left: 0; margin-right: 1rem; }
    .arch-stats { flex-direction: column; gap: 1.5rem; }
    .hero-cta { flex-direction: column; align-items: center; }
}
