/* ============================================================================
   TESSERIS - EXECUTIVE PRESENTATION STYLES
   ============================================================================ */

:root {
    --bg-primary: #212121;
    --bg-secondary: #2a2a2a;
    --bg-tertiary: #333333;
    --bg-hover: #3a3a3a;
    
    --border: #444444;
    --border-hover: #555555;
    
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --text-tertiary: #666666;
    
    --accent-green: #22c55e;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-amber: #f59e0b;
    --accent-teal: #14b8a6;
    
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Consolas', monospace;
    
    --container-max: 1000px;
    --section-padding: 100px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

p:last-child {
    margin-bottom: 0;
}

.lead {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.small {
    font-size: 0.875rem;
}

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

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--text-primary);
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-stagger > * {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.5s; }

.reveal-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-stagger > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Layout */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: var(--section-padding) 0;
    border-bottom: 1px solid var(--border);
}

section:last-of-type {
    border-bottom: none;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

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

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    h1 { font-size: 2rem; }
    section { padding: 60px 0; }
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: background 0.3s, border-color 0.3s;
}

.nav.scrolled {
    background: rgba(33, 33, 33, 0.95);
    border-bottom: 1px solid var(--border);
}

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

.nav__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 1.125rem;
}

.nav__logo svg {
    width: 28px;
    height: 28px;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav__link {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav__link:hover,
.nav__link.active {
    color: var(--text-primary);
}

.nav__lang {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
    font-size: 0.8rem;
}

.nav__lang-active {
    color: var(--text-primary);
    font-weight: 500;
}

.nav__lang-sep {
    color: var(--text-tertiary);
}

.nav__lang-link {
    color: var(--text-tertiary);
    transition: color 0.2s;
}

.nav__lang-link:hover {
    color: var(--text-primary);
}

.nav__menu-btn {
    display: none;
    padding: 8px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

@media (max-width: 600px) {
    .nav__links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
    }
    
    .nav__links.open {
        display: flex;
    }
    
    .nav__link {
        display: block;
        padding: 16px 24px;
        border-bottom: 1px solid var(--border);
    }
    
    .nav__menu-btn {
        display: block;
    }
}

/* Header */
.header {
    padding: 140px 0 80px;
    border-bottom: 1px solid var(--border);
}

.header__subtitle {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.header__description {
    max-width: 700px;
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-top: 20px;
}

/* Metrics */
.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin: 32px 0;
}

.metric {
    padding: 32px 24px;
    background: var(--bg-secondary);
    text-align: center;
}

.metric__value {
    font-size: 2.5rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-bottom: 8px;
}

.metric__value--highlight {
    color: var(--accent-green);
}

.metric__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

@media (max-width: 600px) {
    .metrics {
        grid-template-columns: 1fr;
    }
    
    .metric__value {
        font-size: 2rem;
    }
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
}

.card__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

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

th {
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
}

td {
    color: var(--text-secondary);
}

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

/* Section Labels */
.section-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

/* Lists */
ul.list {
    list-style: none;
    padding: 0;
}

ul.list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

ul.list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--border-hover);
    border-radius: 50%;
}

/* Financial Sliders */
.slider-group {
    margin-bottom: 28px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.slider-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.slider-value {
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--text-primary);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

/* Projection Output */
.projection-output {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
}

.projection-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.projection-row:last-child {
    border-bottom: none;
}

.projection-label {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.projection-value {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.projection-value--positive {
    color: var(--accent-green);
}

.projection-value--negative {
    color: var(--accent-amber);
}

.projection-value--large {
    font-size: 1.5rem;
}

/* Preset Buttons */
.presets {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.preset-btn {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.preset-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--text-tertiary);
}

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

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 48px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--bg-primary);
    background: var(--text-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

/* Footer */
.footer {
    padding: 48px 0;
    border-top: 1px solid var(--border);
}

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

.footer__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.footer__logo svg {
    width: 24px;
    height: 24px;
}

.footer__contact {
    text-align: right;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer__contact a {
    color: var(--text-primary);
}

.footer__built {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-style: italic;
}

@media (max-width: 600px) {
    .footer__inner {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }
    
    .footer__contact {
        text-align: center;
    }
}

/* Whitepaper Styles */
.whitepaper-nav {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 48px;
}

.whitepaper-nav__title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.whitepaper-nav__list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.whitepaper-nav__link {
    display: block;
    padding: 10px 12px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.whitepaper-nav__link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.whitepaper-nav__link span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-right: 8px;
}

@media (max-width: 600px) {
    .whitepaper-nav__list {
        grid-template-columns: 1fr;
    }
}

.whitepaper-section {
    margin-bottom: 64px;
}

.whitepaper-section h2 {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.whitepaper-section h3 {
    margin-top: 32px;
}

/* Utilities */
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.text-center { text-align: center; }
