/* ===========================================================
   bada.systems
   Aesthetic: corporate gradient SaaS meets ocean data
   =========================================================== */

:root {
    --primary-dark: #0a1628;
    --primary-teal: #008080;
    --gradient-mid: #0d4f6e;
    --surface: #f7f8fa;
    --surface-dark: #1a2332;
    --text-dark: #1a1a2e;
    --text-light: #c8dae8;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    --font-display: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: "Fira Code", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background: var(--surface);
    line-height: 1.65;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===========================================================
   HERO -- The System Map
   =========================================================== */

#hero {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a1628 0%, #0d4f6e 50%, #008080 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
}

#hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 128, 128, 0.25), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(13, 79, 110, 0.35), transparent 50%);
    pointer-events: none;
    z-index: 1;
}

#hero-flow-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

#hero-flow-lines .flow-line {
    fill: none;
    stroke: rgba(0, 128, 128, 0.4);
    stroke-width: 1.5;
    stroke-dasharray: 20 10;
    animation: flow 4s linear infinite;
}

#hero-flow-lines .flow-line:nth-child(2) { animation-duration: 6s; stroke: rgba(200, 218, 232, 0.25); }
#hero-flow-lines .flow-line:nth-child(3) { animation-duration: 5s; stroke: rgba(0, 128, 128, 0.35); }
#hero-flow-lines .flow-line:nth-child(4) { animation-duration: 7s; stroke: rgba(200, 218, 232, 0.2); }
#hero-flow-lines .flow-line:nth-child(5) { animation-duration: 4.5s; stroke: rgba(0, 128, 128, 0.45); }
#hero-flow-lines .flow-line:nth-child(6) { animation-duration: 8s; stroke: rgba(200, 218, 232, 0.18); }
#hero-flow-lines .flow-line:nth-child(7) { animation-duration: 5.5s; stroke: rgba(0, 128, 128, 0.3); }

@keyframes flow {
    from { stroke-dashoffset: 30; }
    to { stroke-dashoffset: 0; }
}

#hero-content {
    position: relative;
    z-index: 5;
    max-width: 880px;
    text-align: center;
    color: var(--text-light);
    padding: 0 16px;
}

#hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: #ffffff;
    margin-bottom: 24px;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.3);
}

#hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-light);
    max-width: 640px;
    margin: 0 auto 40px;
    opacity: 0.92;
}

#hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: #0a1628;
    background: #ffffff;
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#hero-cta::after {
    content: "->";
    font-family: var(--font-mono);
    transition: transform 0.2s ease;
}

#hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    background: #f7f8fa;
}

#hero-cta:hover::after {
    transform: translateX(4px);
}

/* ===========================================================
   WAVE DIVIDER
   =========================================================== */

.wave-divider {
    position: relative;
    line-height: 0;
    margin-top: -1px;
}

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

.wave-divider--dark-to-light {
    background: linear-gradient(180deg, #008080 0%, #0d4f6e 100%);
}

.wave-divider--light-to-dark {
    background: var(--surface);
}

.wave-divider--dark-to-footer {
    background: var(--surface-dark);
}

/* ===========================================================
   SECTION SHARED
   =========================================================== */

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-dark);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 12px;
}

.section-heading--light {
    color: #ffffff;
}

.section-sub {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: rgba(26, 26, 46, 0.65);
    margin-bottom: 56px;
    max-width: 580px;
}

.section-sub--light {
    color: rgba(200, 218, 232, 0.85);
}

/* ===========================================================
   ARCHITECTURE GRID
   =========================================================== */

#architecture {
    position: relative;
    background: var(--surface);
    overflow: hidden;
}

#architecture::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(0, 128, 128, 0.18) 2px, transparent 2px);
    background-size: 48px 48px;
    background-position: 0 0;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

#architecture .section-inner {
    position: relative;
    z-index: 1;
}

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

.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 28px 24px 24px;
    border-top: 3px solid var(--primary-teal);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.card[data-status="active"] {
    border-top-color: var(--success);
}

.card[data-status="warning"] {
    border-top-color: var(--warning);
}

.card[data-status="critical"] {
    border-top-color: var(--error);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(10, 22, 40, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-dot.status--active { background: var(--success); }
.status-dot.status--warning { background: var(--warning); }
.status-dot.status--critical { background: var(--error); }

.status-dot::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%   { transform: scale(1);   opacity: 1; }
    50%  { transform: scale(1.8); opacity: 0; }
    100% { transform: scale(1.8); opacity: 0; }
}

.card-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 400;
    color: rgba(26, 26, 46, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card-icon {
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(0, 128, 128, 0.06);
    border-radius: 10px;
}

.card[data-status="warning"] .card-icon {
    background: rgba(245, 158, 11, 0.08);
}

.card[data-status="critical"] .card-icon {
    background: rgba(239, 68, 68, 0.08);
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.card-desc {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(26, 26, 46, 0.72);
    margin-bottom: 18px;
}

.card-code {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--gradient-mid);
    background: rgba(0, 128, 128, 0.06);
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 2px solid var(--primary-teal);
    word-break: break-all;
}

.card[data-status="warning"] .card-code {
    color: #92580d;
    background: rgba(245, 158, 11, 0.08);
    border-left-color: var(--warning);
}

.card[data-status="critical"] .card-code {
    color: #a02828;
    background: rgba(239, 68, 68, 0.08);
    border-left-color: var(--error);
}

/* ===========================================================
   FLOW DIAGRAM
   =========================================================== */

#flow-diagram {
    background: var(--surface-dark);
    position: relative;
    overflow: hidden;
}

#flow-diagram::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(0, 128, 128, 0.08), transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(13, 79, 110, 0.15), transparent 50%);
    pointer-events: none;
}

#flow-diagram .section-inner {
    position: relative;
    z-index: 1;
}

#flow-diagram-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 24px 0;
    background: rgba(10, 22, 40, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(0, 128, 128, 0.2);
}

#flow-svg {
    width: 100%;
    min-width: 900px;
    height: auto;
    display: block;
}

.flow-connector {
    fill: none;
    stroke: var(--primary-teal);
    stroke-width: 2;
    stroke-dasharray: 20 10;
    opacity: 0.7;
    animation: flow 3s linear infinite;
}

.flow-node rect {
    fill: rgba(13, 79, 110, 0.5);
    stroke: var(--primary-teal);
    stroke-width: 1.5;
    transition: fill 0.3s ease, stroke 0.3s ease;
}

.flow-node:hover rect {
    fill: rgba(0, 128, 128, 0.3);
    stroke: #ffffff;
}

.flow-node-label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    fill: #ffffff;
}

.flow-node-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    fill: var(--text-light);
    opacity: 0.85;
}

.flow-node-dot.status--active   { fill: var(--success); }
.flow-node-dot.status--warning  { fill: var(--warning); }
.flow-node-dot.status--critical { fill: var(--error); }

.flow-node-dot {
    animation: svg-pulse 2s ease-in-out infinite;
    transform-origin: center;
    transform-box: fill-box;
}

@keyframes svg-pulse {
    0%, 100% { opacity: 1; r: 4; }
    50%      { opacity: 0.5; r: 5.2; }
}

/* ===========================================================
   FOOTER
   =========================================================== */

#site-footer {
    background: var(--primary-dark);
    color: var(--text-light);
    padding: 48px 24px 32px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: rgba(200, 218, 232, 0.6);
}

.footer-links {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.footer-links a {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: none;
    opacity: 0.78;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--primary-teal);
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */

@media (max-width: 960px) {
    #card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    #hero {
        min-height: 60vh;
        padding: 60px 20px;
    }

    #hero-title {
        font-size: clamp(2rem, 9vw, 3rem);
    }

    .section-inner {
        padding: 56px 20px;
    }

    #card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .wave-divider svg {
        height: 40px;
    }
}

/* Reveal animation for cards */
.card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.25s ease;
}

.card.in-view {
    opacity: 1;
    transform: translateY(0);
}

.card.in-view:hover {
    transform: translateY(-4px);
}

.flow-node {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.flow-node.in-view {
    opacity: 1;
    transform: translateY(0);
}
