/* ============================================
   aiice.io - Retro-Futuristic Command Center
   Sci-fi archaeology / Warm-earthy palette
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Color Palette */
    --canyon-floor: #2C1E14;
    --sunbaked-clay: #8B5E3C;
    --obsidian-soil: #1A110B;
    --amber-phosphor: #D4943A;
    --oxidized-copper: #5E8C7A;
    --parchment: #F2E6D4;
    --dust-mote: #B8A690;
    --telemetry-red: #C45B3E;

    /* Typography */
    --font-primary: 'Jost', sans-serif;
    --font-secondary: 'Outfit', sans-serif;

    /* Sizing */
    --nav-width: 48px;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    font-weight: 300;
    font-size: 1.125rem;
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: var(--parchment);
    background-color: var(--obsidian-soil);
    overflow-x: hidden;
    cursor: default;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Animations --- */
@keyframes bounce-in {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateY(-8px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounce-in-left {
    0% {
        opacity: 0;
        transform: translateX(-60px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateX(8px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes bounce-in-right {
    0% {
        opacity: 0;
        transform: translateX(60px) scale(0.95);
    }
    60% {
        opacity: 1;
        transform: translateX(-8px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes blob-morph {
    0%, 100% {
        border-radius: 42% 58% 37% 63% / 55% 45% 62% 38%;
    }
    50% {
        border-radius: 58% 42% 63% 37% / 45% 55% 38% 62%;
    }
}

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

@keyframes float-drift {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(15px, -10px);
    }
    50% {
        transform: translate(-10px, 15px);
    }
    75% {
        transform: translate(10px, 5px);
    }
}

/* --- Cursor-Following Blob --- */
.cursor-blob {
    position: fixed;
    width: 24px;
    height: 24px;
    background-color: var(--amber-phosphor);
    opacity: 0.4;
    border-radius: 42% 58% 37% 63% / 55% 45% 62% 38%;
    pointer-events: none;
    z-index: 9999;
    animation: blob-morph 8s ease-in-out infinite;
    transition: none;
    will-change: transform;
    mix-blend-mode: screen;
}

/* --- Fixed Vertical Navigation --- */
.nav-strip {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--nav-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(26, 17, 11, 0.6), rgba(44, 30, 20, 0.6));
    backdrop-filter: blur(4px);
}

.nav-indicator {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-family: var(--font-secondary);
    font-weight: 500;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dust-mote);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-indicator.active {
    color: var(--amber-phosphor);
}

.nav-indicator::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    white-space: nowrap;
    font-family: var(--font-secondary);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--parchment);
    background: var(--canyon-floor);
    padding: 6px 14px;
    border: 1px solid rgba(184, 166, 144, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-indicator:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(8px);
}

.nav-indicator:hover {
    color: var(--amber-phosphor);
}

/* --- Diagonal Ruled Lines Background Layer --- */
.ruled-lines-layer {
    position: fixed;
    top: -20%;
    left: -20%;
    width: 140%;
    height: 140%;
    pointer-events: none;
    z-index: 0;
    background: repeating-linear-gradient(
        -3deg,
        transparent,
        transparent 119px,
        rgba(184, 166, 144, 0.08) 119px,
        rgba(184, 166, 144, 0.08) 120px
    );
}

/* --- Organic Blobs --- */
.blob {
    position: absolute;
    animation: blob-morph 20s ease-in-out infinite, float-drift 30s ease-in-out infinite;
    will-change: border-radius;
    pointer-events: none;
    z-index: 1;
}

.blob-xlarge {
    width: 500px;
    height: 500px;
}

.blob-large {
    width: 400px;
    height: 380px;
}

.blob-medium {
    width: 200px;
    height: 200px;
}

.blob-small {
    width: 80px;
    height: 80px;
}

/* Stratum A blobs */
.blob-a1 {
    top: 10%;
    left: 5%;
    background-color: rgba(139, 94, 60, 0.15);
    animation-delay: 0s, 0s;
}

.blob-a2 {
    top: 55%;
    right: 15%;
    background-color: rgba(94, 140, 122, 0.08);
    animation-delay: -5s, -8s;
}

.blob-a3 {
    top: 30%;
    left: 40%;
    background-color: rgba(212, 148, 58, 0.1);
    animation-delay: -10s, -15s;
}

/* Stratum B blob */
.blob-b1 {
    top: 10%;
    right: -100px;
    background-color: rgba(94, 140, 122, 0.08);
    animation-delay: -3s, -7s;
}

/* Stratum D blobs */
.blob-d1 {
    top: 20%;
    left: -50px;
    background-color: rgba(139, 94, 60, 0.12);
    animation-delay: -6s, -12s;
}

.blob-d2 {
    bottom: 15%;
    right: 10%;
    background-color: rgba(212, 148, 58, 0.08);
    animation-delay: -12s, -20s;
}

/* --- Stratum Base Styles --- */
.stratum {
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.stratum-inner {
    position: relative;
    width: 100%;
}

/* --- Bounce Target (hidden until animated) --- */
.bounce-target {
    opacity: 0;
}

.bounce-target.visible {
    animation: bounce-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.bounce-target.visible-left {
    animation: bounce-in-left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.bounce-target.visible-right {
    animation: bounce-in-right 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* --- Vintage Photo Treatment --- */
.vintage-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.photo-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: saturate(0.4) contrast(1.1) sepia(0.15);
}

.photo-grain-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#film-grain);
    opacity: 0.08;
    mix-blend-mode: overlay;
    background: rgba(184, 166, 144, 0.3);
}

.photo-grain-overlay-small {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: url(#film-grain);
    opacity: 0.08;
    mix-blend-mode: overlay;
    background: rgba(184, 166, 144, 0.3);
}

.photo-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(44, 30, 20, 0.3) 100%);
}

.photo-amber-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--amber-phosphor);
    opacity: 0.12;
    mix-blend-mode: multiply;
}

/* Photo placeholder backgrounds (CSS-generated imagery) */
.photo-telescope {
    background:
        radial-gradient(ellipse at 70% 30%, rgba(139, 94, 60, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 60%, rgba(44, 30, 20, 0.6) 0%, transparent 60%),
        linear-gradient(180deg, #3d2a1a 0%, #1a110b 60%, #0d0805 100%);
}

.photo-canyon {
    background:
        radial-gradient(ellipse at 40% 40%, rgba(139, 94, 60, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(196, 91, 62, 0.2) 0%, transparent 40%),
        linear-gradient(175deg, #5a3d28 0%, #2c1e14 40%, #1a110b 100%);
}

.photo-oscilloscope {
    background:
        radial-gradient(circle at 50% 50%, rgba(212, 148, 58, 0.3) 0%, transparent 40%),
        linear-gradient(160deg, #1a110b 0%, #2c1e14 100%);
}

.photo-dials {
    background:
        radial-gradient(circle at 30% 40%, rgba(139, 94, 60, 0.4) 0%, transparent 35%),
        radial-gradient(circle at 70% 60%, rgba(139, 94, 60, 0.3) 0%, transparent 30%),
        linear-gradient(150deg, #2c1e14 0%, #1a110b 100%);
}

.photo-mesa {
    background:
        linear-gradient(0deg, #1a110b 0%, #2c1e14 30%, #5a3d28 50%, #8b5e3c 65%, #3d2a1a 80%, #1a1510 100%);
}

.photo-reel {
    background:
        radial-gradient(circle at 35% 50%, rgba(44, 30, 20, 0.8) 15%, transparent 40%),
        radial-gradient(circle at 65% 50%, rgba(44, 30, 20, 0.8) 15%, transparent 40%),
        linear-gradient(170deg, #2c1e14 0%, #1a110b 100%);
}

.photo-nebula {
    background:
        radial-gradient(ellipse at 50% 50%, rgba(212, 148, 58, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 30% 30%, rgba(94, 140, 122, 0.1) 0%, transparent 30%),
        linear-gradient(200deg, #0d0805 0%, #1a110b 50%, #0d0805 100%);
}

.photo-concrete {
    background:
        repeating-linear-gradient(90deg, rgba(139, 94, 60, 0.1) 0px, rgba(139, 94, 60, 0.1) 2px, transparent 2px, transparent 20px),
        linear-gradient(180deg, #3d2a1a 0%, #2c1e14 100%);
}

/* --- Corner Brackets --- */
.corner-brackets {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bracket {
    position: absolute;
    width: 16px;
    height: 16px;
}

.bracket-tl {
    top: -4px;
    left: -4px;
    border-top: 2px solid var(--amber-phosphor);
    border-left: 2px solid var(--amber-phosphor);
}

.bracket-tr {
    top: -4px;
    right: -4px;
    border-top: 2px solid var(--amber-phosphor);
    border-right: 2px solid var(--amber-phosphor);
}

.bracket-bl {
    bottom: -4px;
    left: -4px;
    border-bottom: 2px solid var(--amber-phosphor);
    border-left: 2px solid var(--amber-phosphor);
}

.bracket-br {
    bottom: -4px;
    right: -4px;
    border-bottom: 2px solid var(--amber-phosphor);
    border-right: 2px solid var(--amber-phosphor);
}

/* ============================================
   STRATUM A: SURFACE
   ============================================ */
.stratum-a {
    height: 100vh;
    min-height: 600px;
    background-color: var(--canyon-floor);
    clip-path: polygon(0 0, 100% 0, 100% 96%, 0 100%);
}

.stratum-a-inner {
    height: 100%;
    overflow: hidden;
}

.stratum-a-photo {
    clip-path: polygon(55% 0, 100% 0, 100% 100%, 30% 100%);
    z-index: 1;
}

.stratum-a-band {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background-color: var(--sunbaked-clay);
    transform: rotate(-3deg);
    transform-origin: center center;
    opacity: 0.3;
    clip-path: polygon(0 30%, 100% 20%, 100% 70%, 0 80%);
    z-index: 2;
}

.stratum-a-title {
    position: absolute;
    bottom: 18%;
    left: 8%;
    z-index: 10;
    padding-left: var(--nav-width);
}

.domain-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(2.8rem, 8vw, 8rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--parchment);
    line-height: 1;
}

.title-underline {
    width: 120%;
    height: 4px;
    background: linear-gradient(to right, var(--amber-phosphor), transparent);
    margin-top: 16px;
    transform: rotate(-3deg);
    transform-origin: left center;
}

/* ============================================
   STRATUM B: SEDIMENT
   ============================================ */
.stratum-b {
    min-height: 90vh;
    background-color: var(--canyon-floor);
    transform: rotate(2deg);
    margin: -60px -40px;
    padding: 120px 40px;
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    z-index: 3;
}

.stratum-b-inner {
    transform: rotate(-2deg);
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 80px;
    padding-left: calc(80px + var(--nav-width));
}

.stratum-b-columns {
    display: flex;
    gap: 0;
    align-items: flex-start;
    position: relative;
    z-index: 2;
}

.column {
    flex: 1;
    padding: 28px 24px;
    position: relative;
}

.column-1 {
    transform: translateY(0);
}

.column-2 {
    transform: translateY(24px);
}

.column-3 {
    transform: translateY(48px);
}

.column p {
    font-family: var(--font-primary);
    font-weight: 300;
    font-size: 1rem;
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: var(--parchment);
}

.column-divider {
    width: 1px;
    align-self: stretch;
    background-color: rgba(184, 166, 144, 0.4);
    flex-shrink: 0;
}

/* ============================================
   STRATUM C: BEDROCK
   ============================================ */
.stratum-c {
    min-height: 90vh;
    background-color: var(--canyon-floor);
    transform: rotate(-4deg);
    margin: -80px -40px;
    padding: 140px 40px;
    clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 96%);
    z-index: 4;
}

.stratum-c-inner {
    transform: rotate(4deg);
    position: relative;
}

.stratum-c-photo {
    z-index: 0;
    opacity: 0.25;
}

.stratum-c-scrim {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--canyon-floor);
    opacity: 0.65;
    z-index: 1;
}

.stratum-c-content {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
    padding: 80px 24px;
    padding-left: calc(24px + var(--nav-width));
    z-index: 2;
}

.stratum-c-content .body-text {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: var(--parchment);
    margin-bottom: 2rem;
}

.pull-quote {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    line-height: 1.4;
    color: var(--amber-phosphor);
    border: none;
    margin: 2.5rem -20%;
    padding: 1.5rem 0;
    text-align: center;
    position: relative;
}

.pull-quote::before,
.pull-quote::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background-color: var(--amber-phosphor);
    opacity: 0.4;
    margin: 0 auto;
}

.pull-quote::before {
    margin-bottom: 1.2rem;
}

.pull-quote::after {
    margin-top: 1.2rem;
}

/* ============================================
   STRATUM D: FOSSIL RECORD
   ============================================ */
.stratum-d {
    min-height: 90vh;
    background-color: var(--canyon-floor);
    transform: rotate(3deg);
    margin: -80px -40px;
    padding: 140px 40px;
    clip-path: polygon(0 4%, 100% 0, 100% 96%, 0 100%);
    z-index: 5;
}

.stratum-d-inner {
    transform: rotate(-3deg);
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    padding-left: calc(24px + var(--nav-width));
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    position: relative;
    z-index: 2;
}

.specimen-card {
    position: relative;
    border: 1px solid rgba(184, 166, 144, 0.3);
    padding: 24px;
    background-color: rgba(44, 30, 20, 0.6);
}

.specimen-number {
    position: absolute;
    top: 12px;
    left: 16px;
    font-family: var(--font-secondary);
    font-weight: 500;
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--dust-mote);
    z-index: 3;
}

.specimen-photo {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 24px auto 20px;
    overflow: hidden;
}

.specimen-photo .photo-placeholder {
    border-radius: 0;
}

.specimen-desc {
    font-family: var(--font-primary);
    font-weight: 300;
    font-size: 0.9375rem;
    line-height: 1.65;
    letter-spacing: 0.02em;
    color: var(--dust-mote);
}

/* ============================================
   STRATUM E: CORE
   ============================================ */
.stratum-e {
    height: 100vh;
    min-height: 600px;
    background-color: var(--obsidian-soil);
    transform: rotate(-2deg);
    margin: -60px -40px;
    padding: 0 40px;
    clip-path: polygon(0 0, 100% 4%, 100% 100%, 0 100%);
    z-index: 6;
}

.stratum-e-inner {
    transform: rotate(2deg);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.core-statement {
    text-align: center;
    padding: 0 24px;
    z-index: 2;
}

.core-text {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    line-height: 1.3;
    letter-spacing: 0.04em;
    color: var(--parchment);
    max-width: 900px;
}

/* Constellation */
.constellation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.micro-circle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--telemetry-red);
    animation: pulse 3s ease infinite;
}

.micro-circle:nth-child(2n) {
    animation-delay: -1s;
}

.micro-circle:nth-child(3n) {
    animation-delay: -2s;
}

.micro-circle:nth-child(5n) {
    animation-delay: -0.5s;
}

.micro-circle:nth-child(7n) {
    animation-delay: -1.5s;
}

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

    .stratum-b-columns {
        flex-direction: column;
        gap: 32px;
    }

    .column-divider {
        width: 100%;
        height: 1px;
    }

    .column-1,
    .column-2,
    .column-3 {
        transform: translateY(0);
    }

    .pull-quote {
        margin-left: -5%;
        margin-right: -5%;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-width: 36px;
    }

    .nav-strip {
        width: 36px;
    }

    .nav-indicator {
        width: 28px;
        height: 28px;
        font-size: 0.6875rem;
    }

    .stratum-a-title {
        bottom: 12%;
        left: 4%;
    }

    .stratum-b-inner {
        padding: 40px 24px;
        padding-left: calc(24px + var(--nav-width));
    }

    .stratum-c-content {
        padding: 40px 16px;
        padding-left: calc(16px + var(--nav-width));
    }

    .stratum-d-inner {
        padding: 40px 16px;
        padding-left: calc(16px + var(--nav-width));
    }

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

    .specimen-photo {
        width: 120px;
        height: 120px;
    }

    .pull-quote {
        margin-left: 0;
        margin-right: 0;
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .domain-title {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .blob-xlarge {
        width: 250px;
        height: 250px;
    }

    .blob-large {
        width: 200px;
        height: 190px;
    }
}
