/* monopole.cloud — Luxury Brutalist Cloud Infrastructure */
/* Colors: #FF6B2C (Tungsten Orange), #0D0D0D, #1A1A1A, #2D2D2D, #2A2A2A, #222222, #6B8F71 (Patina Green), #E8E0D4 (Bone), #B8B0A4, #FFB347 (Amber), #CC5520 */
/* Fonts: Space Grotesk 300/500/700, IBM Plex Sans 400, IBM Plex Mono 300 */

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

:root {
    --tungsten-orange: #FF6B2C;
    --dark-orange: #CC5520;
    --amber: #FFB347;
    --patina-green: #6B8F71;
    --bone: #E8E0D4;
    --stone: #B8B0A4;
    --obsidian: #0D0D0D;
    --charcoal: #1A1A1A;
    --concrete-dark: #222222;
    --concrete: #2A2A2A;
    --concrete-light: #2D2D2D;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--tungsten-orange) var(--obsidian);
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    background-color: var(--obsidian);
    color: var(--bone);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Concrete Texture Mixin --- */
.concrete-texture {
    background:
        repeating-conic-gradient(#2A2A2A 0% 25%, #2D2D2D 0% 50%) 0 0 / 4px 4px,
        linear-gradient(175deg, rgba(255,255,255,0.02) 0%, transparent 60%);
}

/* --- Utility Classes --- */
.mono-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--stone);
}

.mono-label--dim {
    color: rgba(184, 176, 164, 0.4);
}

.mono-label--green {
    color: var(--patina-green);
}

.mono-label--amber {
    color: var(--amber);
}

/* --- Section Base --- */
.section {
    min-height: 100vh;
    padding: clamp(2rem, 5vw, 6rem);
    position: relative;
    display: flex;
    flex-direction: column;
}

.section__header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: clamp(2rem, 4vw, 4rem);
}

.section__number {
    font-size: 0.65rem;
    color: var(--tungsten-orange);
    border: 1px solid rgba(255, 107, 44, 0.3);
    padding: 0.25rem 0.5rem;
}

.section__title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: -0.03em;
    color: var(--bone);
    text-transform: uppercase;
}

.section__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 107, 44, 0.4), transparent);
}

/* ============================================
   SECTION 1: HERO
   ============================================ */
.section--hero {
    justify-content: center;
    align-items: center;
    background-color: var(--obsidian);
    position: relative;
    overflow: hidden;
}

.section--hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-conic-gradient(#2A2A2A 0% 25%, #2D2D2D 0% 50%) 0 0 / 4px 4px,
        linear-gradient(175deg, rgba(255,255,255,0.02) 0%, transparent 60%);
    opacity: 0.5;
}

.hero__grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5rem;
    max-width: 1000px;
    width: 100%;
}

.hero__card {
    background:
        repeating-conic-gradient(#2A2A2A 0% 25%, #2D2D2D 0% 50%) 0 0 / 4px 4px,
        linear-gradient(175deg, rgba(255,255,255,0.02) 0%, transparent 60%);
    border: 1px solid rgba(255, 107, 44, 0.15);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    position: relative;
}

.hero__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--tungsten-orange), transparent);
}

.hero__card--main {
    grid-column: 1 / -1;
}

.hero__title-wrap {
    overflow: hidden;
}

.hero__title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 8vw, 7rem);
    letter-spacing: -0.03em;
    line-height: 0.95;
    text-transform: uppercase;
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.15em;
}

.hero__title-line {
    color: var(--bone);
    clip-path: inset(0 100% 0 0);
    animation: clipReveal 0.8s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.hero__title-line--accent {
    color: var(--tungsten-orange);
    animation-delay: 0.3s;
}

@keyframes clipReveal {
    to {
        clip-path: inset(0 0 0 0);
    }
}

.hero__subtitle {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 107, 44, 0.15);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards 0.8s;
}

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

.hero__card--topology {
    position: relative;
    min-height: 200px;
}

.hero__card--topology canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.card-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: rgba(184, 176, 164, 0.4);
    position: absolute;
    bottom: 1rem;
    left: 1.5rem;
}

.hero__card--metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.5rem;
}

.hero__card--offset {
    transform: translateY(12px);
}

.metric-value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--tungsten-orange);
    letter-spacing: -0.02em;
}

.hero__scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards 1.5s;
}

.scroll-dot {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { cy: 12; }
    50% { cy: 28; }
}

/* ============================================
   SECTION 2: SERVICES / HABITAT GRID
   ============================================ */
.section--services {
    background-color: var(--charcoal);
}

.section--services::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-conic-gradient(#1F1F1F 0% 25%, #222222 0% 50%) 0 0 / 4px 4px;
    opacity: 0.5;
}

.habitat-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    flex: 1;
}

.habitat-card {
    background:
        repeating-conic-gradient(#2A2A2A 0% 25%, #2D2D2D 0% 50%) 0 0 / 4px 4px,
        linear-gradient(175deg, rgba(255,255,255,0.02) 0%, transparent 60%);
    border: 1px solid rgba(255, 107, 44, 0.1);
    padding: clamp(1.5rem, 2vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color 0.4s ease, transform 0.4s ease;
    position: relative;
}

.habitat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--tungsten-orange);
    transition: width 0.4s ease;
}

.habitat-card:hover {
    border-color: rgba(255, 107, 44, 0.4);
    transform: translateY(-4px);
}

.habitat-card:hover::after {
    width: 100%;
}

.habitat-card--large {
    grid-row: span 2;
}

.habitat-card--wide {
    grid-column: span 2;
}

.habitat-card__icon {
    width: 64px;
    height: 64px;
    opacity: 0.8;
}

.habitat-card__title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--bone);
    text-transform: uppercase;
}

.habitat-card__text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--stone);
    flex: 1;
}

.habitat-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 107, 44, 0.1);
}

/* ============================================
   SECTION 3: STATUS DASHBOARD
   ============================================ */
.section--status {
    background-color: var(--obsidian);
}

.status-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
}

.status-panel {
    background:
        repeating-conic-gradient(#2A2A2A 0% 25%, #2D2D2D 0% 50%) 0 0 / 4px 4px,
        linear-gradient(175deg, rgba(255,255,255,0.02) 0%, transparent 60%);
    border: 1px solid rgba(107, 143, 113, 0.15);
    padding: clamp(1.25rem, 2vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-panel--main {
    grid-column: 1 / -1;
}

.status-panel--narrow {
    grid-column: 1 / -1;
}

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

.status-badge {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    padding: 0.2rem 0.6rem;
    border: 1px solid;
}

.status-badge--live {
    color: var(--patina-green);
    border-color: var(--patina-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-panel__value {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--patina-green);
    letter-spacing: -0.02em;
}

.status-bar-container {
    width: 100%;
    height: 4px;
    background: var(--concrete-dark);
    border-radius: 2px;
    overflow: hidden;
}

.status-bar {
    height: 100%;
    width: 99.9997%;
    background: linear-gradient(90deg, var(--patina-green), var(--tungsten-orange));
    border-radius: 2px;
    transition: width 1s ease;
}

.status-panel__footer {
    padding-top: 0.5rem;
}

.status-panel canvas {
    width: 100%;
    height: 120px;
    display: block;
}

.node-map {
    width: 100%;
    aspect-ratio: 2 / 1;
}

.node-map svg {
    width: 100%;
    height: 100%;
}

/* Alert list */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(42, 42, 42, 0.5);
    border-left: 2px solid;
}

.alert-item--clear {
    border-color: var(--patina-green);
}

.alert-item--info {
    border-color: var(--amber);
}

.alert-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.alert-item--clear .alert-dot {
    background: var(--patina-green);
    box-shadow: 0 0 8px rgba(107, 143, 113, 0.5);
}

.alert-item--info .alert-dot {
    background: var(--amber);
    box-shadow: 0 0 8px rgba(255, 179, 71, 0.5);
}

/* ============================================
   SECTION 4: ARCHITECTURE BLUEPRINT
   ============================================ */
.section--architecture {
    background-color: var(--charcoal);
}

.blueprint-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    flex: 1;
    justify-content: center;
}

.blueprint-layer {
    width: 100%;
    max-width: 900px;
    background:
        repeating-conic-gradient(#2A2A2A 0% 25%, #2D2D2D 0% 50%) 0 0 / 4px 4px,
        linear-gradient(175deg, rgba(255,255,255,0.02) 0%, transparent 60%);
    border: 1px solid rgba(255, 107, 44, 0.1);
    padding: clamp(1.5rem, 2vw, 2.5rem);
}

.blueprint-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--tungsten-orange);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 107, 44, 0.15);
}

.blueprint-blocks {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.blueprint-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.blueprint-block__inner {
    padding: 1rem;
    border: 1px solid rgba(45, 45, 45, 0.5);
    background: rgba(13, 13, 13, 0.5);
    transition: border-color 0.3s ease;
}

.blueprint-block:hover .blueprint-block__inner {
    border-color: rgba(255, 107, 44, 0.3);
}

.blueprint-connector {
    display: flex;
    justify-content: center;
    height: 60px;
}

/* ============================================
   SECTION 5: CONTACT / TERMINAL
   ============================================ */
.section--contact {
    background-color: var(--obsidian);
    justify-content: space-between;
}

.terminal-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    flex: 1;
    align-items: start;
}

.terminal {
    background: var(--charcoal);
    border: 1px solid rgba(255, 107, 44, 0.15);
    overflow: hidden;
}

.terminal__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(26, 26, 26, 0.8);
    border-bottom: 1px solid rgba(255, 107, 44, 0.1);
}

.terminal__dots {
    display: flex;
    gap: 6px;
}

.terminal__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.terminal__dot--red { background: #CC5520; }
.terminal__dot--yellow { background: #FFB347; }
.terminal__dot--green { background: #6B8F71; }

.terminal__body {
    padding: 1.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    line-height: 2;
    color: var(--stone);
}

.terminal__line {
    display: flex;
    gap: 0.75rem;
    opacity: 0;
    animation: terminalFadeIn 0.3s ease forwards;
}

.terminal__line:nth-child(1) { animation-delay: 0.2s; }
.terminal__line:nth-child(2) { animation-delay: 0.6s; }
.terminal__line:nth-child(3) { animation-delay: 1.0s; }
.terminal__line:nth-child(4) { animation-delay: 1.4s; }
.terminal__line:nth-child(5) { animation-delay: 1.8s; }
.terminal__line:nth-child(6) { animation-delay: 2.2s; }

@keyframes terminalFadeIn {
    to { opacity: 1; }
}

.terminal__prompt {
    color: var(--tungsten-orange);
    white-space: nowrap;
}

.terminal__line--system {
    color: rgba(184, 176, 164, 0.5);
}

.terminal__link {
    color: var(--patina-green);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.terminal__input {
    color: var(--tungsten-orange);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 1rem;
}

.contact-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--bone);
}

/* Footer */
.site-footer {
    margin-top: auto;
    padding-top: 2rem;
}

.footer__line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 107, 44, 0.3), rgba(107, 143, 113, 0.2), transparent);
    margin-bottom: 1.5rem;
}

.footer__content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ============================================
   SCROLL ANIMATIONS (Intersection Observer)
   ============================================ */
.habitat-card,
.status-panel,
.blueprint-layer {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.habitat-card.visible,
.status-panel.visible,
.blueprint-layer.visible {
    opacity: 1;
    transform: translateY(0);
}

.habitat-card:nth-child(2) { transition-delay: 0.1s; }
.habitat-card:nth-child(3) { transition-delay: 0.2s; }
.habitat-card:nth-child(4) { transition-delay: 0.3s; }

.status-panel:nth-child(2) { transition-delay: 0.1s; }
.status-panel:nth-child(3) { transition-delay: 0.2s; }
.status-panel:nth-child(4) { transition-delay: 0.3s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero__grid {
        grid-template-columns: 1fr;
    }

    .hero__card--offset {
        transform: none;
    }

    .habitat-grid {
        grid-template-columns: 1fr;
    }

    .habitat-card--wide {
        grid-column: span 1;
    }

    .habitat-card--large {
        grid-row: span 1;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .terminal-container {
        grid-template-columns: 1fr;
    }

    .blueprint-blocks {
        flex-direction: column;
        align-items: center;
    }
}
