/* ============================================
   SIMULAI.NET - Styles
   Nautical-Celestial Dark Editorial
   ============================================ */

/* === CSS Custom Properties === */
:root {
    --deep-slate: #141e2a;
    --tidal-teal: #1a3a3e;
    --coastal-sand: #c8b8a4;
    --star-cyan: #5ab8b0;
    --moon-silver: #8a9aaa;
    --wave-crest: #3a6a68;
    --deep-current: #0a1018;
    --nav-dark: #1a2e3a;
}

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

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

body {
    background-color: var(--deep-slate);
    color: var(--coastal-sand);
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.85;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    color: var(--coastal-sand);
}

h2 {
    font-size: clamp(28px, 4.5vw, 56px);
    letter-spacing: -0.02em;
}

h3 {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    font-size: clamp(18px, 2vw, 24px);
    letter-spacing: -0.01em;
}

/* === Hero Section === */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--deep-slate) 0%, #162632 85%, var(--tidal-teal) 100%);
    overflow: hidden;
}

#constellation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.constellation-star {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: var(--star-cyan);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.constellation-star.visible {
    opacity: var(--star-opacity, 0.5);
}

.constellation-line {
    position: absolute;
    height: 1px;
    background-color: var(--star-cyan);
    opacity: 0;
    transform-origin: 0 50%;
    transition: opacity 0.6s ease;
}

.constellation-line.visible {
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
}

.hero-content.animate-in {
    animation: heroFadeIn 1s ease forwards;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-size: clamp(48px, 8vw, 120px);
    letter-spacing: 0.12em;
    font-weight: 700;
    margin-bottom: 0.2em;
}

.title-main {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    color: var(--coastal-sand);
}

.title-ext {
    font-family: 'Space Mono', 'Courier New', monospace;
    color: var(--star-cyan);
    font-weight: 400;
    font-size: 0.45em;
    vertical-align: baseline;
    letter-spacing: 0;
}

.hero-subtitle {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    font-size: clamp(14px, 1.8vw, 20px);
    color: var(--moon-silver);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.5em;
}

.hero-illustration {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 800px;
    margin-top: 3rem;
    opacity: 0;
}

.hero-illustration.animate-in {
    animation: illustrationFadeIn 1s ease forwards;
}

@keyframes illustrationFadeIn {
    from { opacity: 0; }
    to { opacity: 0.7; }
}

#celestial-chart {
    width: 100%;
    height: auto;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: scrollIndicatorFadeIn 1s ease 3.2s forwards;
}

@keyframes scrollIndicatorFadeIn {
    from { opacity: 0; }
    to { opacity: 0.5; }
}

.scroll-text {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--moon-silver);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, var(--star-cyan), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 0.7; transform: scaleY(1.2); }
}

/* === Tidal Wave Dividers === */
.tidal-divider {
    width: 100%;
    line-height: 0;
    margin: -1px 0;
    position: relative;
    z-index: 1;
}

.tidal-divider svg {
    width: 100%;
    height: 60px;
    display: block;
}

/* === Editorial Sections === */
.editorial-section {
    padding: 6rem 2rem;
    position: relative;
}

.editorial-section.dark-bg {
    background-color: var(--deep-slate);
}

.editorial-section.teal-bg {
    background-color: var(--tidal-teal);
}

#about {
    background-color: var(--nav-dark);
}

#applications {
    background-color: var(--nav-dark);
}

/* === Section Labels === */
.section-label {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 12px;
    color: var(--star-cyan);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

/* === Section Headlines === */
.section-headline {
    margin-bottom: 2rem;
    max-width: 700px;
}

/* === Grid Layouts === */
.section-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
}

.section-grid.feature-sidebar {
    grid-template-columns: 2fr 1fr;
}

.section-grid.feature-sidebar.reverse {
    grid-template-columns: 1fr 2fr;
}

.section-grid.comparison-layout {
    grid-template-columns: 1fr 1fr;
}

/* === Narrow Column === */
.narrow-column {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* === Body Text === */
.body-text {
    max-width: 640px;
}

.body-text p {
    margin-bottom: 1.5em;
    color: var(--coastal-sand);
    opacity: 0.9;
}

/* === Feature Content === */
.feature-content {
    padding: 1rem 0;
}

/* === Sidebar Content === */
.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: 1rem 0;
    border-left: 1px solid rgba(90, 184, 176, 0.15);
    padding-left: 2rem;
}

.sidebar-stat {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stat-number {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 700;
    color: var(--star-cyan);
    line-height: 1;
}

.stat-label {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    color: var(--moon-silver);
    font-weight: 400;
    line-height: 1.4;
}

/* === Pull Quotes === */
.pull-quote-section {
    padding: 5rem 2rem;
    background-color: var(--nav-dark);
}

.pull-quote-section.dark-bg {
    background-color: var(--tidal-teal);
}

.pull-quote {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    font-size: clamp(20px, 3vw, 32px);
    line-height: 1.5;
    color: var(--coastal-sand);
    border-left: 3px solid var(--star-cyan);
    padding-left: 2rem;
    margin: 0;
    font-style: normal;
    opacity: 0.9;
}

/* === Capability Cards === */
.capability-card {
    background-color: rgba(26, 58, 62, 0.3);
    border: 1px solid rgba(90, 184, 176, 0.08);
    padding: 2.5rem 2rem;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.capability-card:hover {
    border-color: rgba(90, 184, 176, 0.2);
    background-color: rgba(26, 58, 62, 0.5);
}

.capability-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
}

.capability-icon svg {
    width: 100%;
    height: 100%;
}

.capability-title {
    margin-bottom: 1rem;
    color: var(--coastal-sand);
}

.capability-desc {
    font-size: clamp(14px, 1.2vw, 16px);
    color: var(--moon-silver);
    line-height: 1.75;
}

/* === Approach Steps === */
.approach-step {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(90, 184, 176, 0.1);
}

.approach-step:last-child {
    border-bottom: none;
}

.step-number {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 14px;
    color: var(--star-cyan);
    opacity: 0.7;
    min-width: 2em;
}

.step-label {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: var(--coastal-sand);
}

/* === Metrics Grid === */
.metrics-grid {
    max-width: 1200px;
    margin: 3rem auto 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 0 2rem;
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 2rem 0;
    border-top: 1px solid rgba(90, 184, 176, 0.15);
}

.metric-value {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 700;
    color: var(--star-cyan);
    line-height: 1;
}

.metric-label {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    color: var(--moon-silver);
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.metric-bar {
    width: 100%;
    height: 3px;
    background-color: rgba(90, 184, 176, 0.1);
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    width: 0;
    background-color: var(--star-cyan);
    transition: width 2s cubic-bezier(0.25, 0.1, 0.25, 1);
    opacity: 0.6;
}

.metric-fill.animate {
    width: var(--target-width);
}

/* === Applications === */
.applications-grid {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding: 0 2rem;
}

.application-item {
    padding: 2.5rem 2rem;
    border: 1px solid rgba(90, 184, 176, 0.06);
    background-color: rgba(20, 30, 42, 0.4);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.application-item:hover {
    background-color: rgba(20, 30, 42, 0.7);
    border-color: rgba(90, 184, 176, 0.15);
}

.application-number {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 12px;
    color: var(--star-cyan);
    opacity: 0.5;
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
}

.application-title {
    margin-bottom: 1rem;
    color: var(--coastal-sand);
}

.application-desc {
    font-size: clamp(14px, 1.2vw, 16px);
    color: var(--moon-silver);
    line-height: 1.75;
}

/* === Footer === */
#footer {
    position: relative;
    background-color: var(--deep-current);
    padding: 6rem 2rem 3rem;
    overflow: hidden;
}

.footer-constellation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    margin-bottom: 1rem;
}

.footer-logo {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 36px);
    color: var(--coastal-sand);
    letter-spacing: 0.12em;
}

.footer-logo-ext {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: clamp(12px, 1.5vw, 18px);
    color: var(--star-cyan);
}

.footer-tagline {
    font-family: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--moon-silver);
    margin-bottom: 2.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.footer-links a {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 12px;
    color: var(--moon-silver);
    text-decoration: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--star-cyan);
}

.footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(90, 184, 176, 0.08);
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copyright {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 11px;
    color: var(--moon-silver);
    opacity: 0.5;
}

.footer-coordinates {
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 11px;
    color: var(--moon-silver);
    opacity: 0.4;
}

.coord-label {
    color: var(--star-cyan);
    opacity: 0.6;
    margin-right: 0.25em;
}

/* === Scroll Animation Classes === */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Interactive Constellation Tooltip === */
.constellation-tooltip {
    position: absolute;
    font-family: 'Space Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--star-cyan);
    background-color: rgba(10, 16, 24, 0.9);
    padding: 4px 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    z-index: 10;
    border: 1px solid rgba(90, 184, 176, 0.2);
}

.constellation-tooltip.visible {
    opacity: 1;
}

/* === Responsive Design === */
@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .section-grid.feature-sidebar,
    .section-grid.feature-sidebar.reverse {
        grid-template-columns: 1fr;
    }

    .section-grid.feature-sidebar.reverse .sidebar-content {
        order: -1;
    }

    .section-grid.comparison-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-content {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(90, 184, 176, 0.15);
        padding-top: 2rem;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-stat {
        min-width: 140px;
        flex: 1;
    }

    .editorial-section {
        padding: 4rem 1.5rem;
    }

    .narrow-column {
        padding: 0 1rem;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
        padding: 0 1rem;
    }

    .applications-grid {
        padding: 0 1rem;
    }

    .footer-meta {
        justify-content: center;
        text-align: center;
    }

    .hero-title {
        letter-spacing: 0.06em;
    }

    .pull-quote {
        font-size: clamp(18px, 2.5vw, 28px);
        padding-left: 1.5rem;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-content {
        flex-direction: column;
    }

    .footer-links {
        gap: 1rem;
    }
}

/* === Selection Styling === */
::selection {
    background-color: rgba(90, 184, 176, 0.3);
    color: var(--coastal-sand);
}

/* === Scrollbar Styling === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--deep-current);
}

::-webkit-scrollbar-thumb {
    background: var(--wave-crest);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--star-cyan);
}
