/* sim-ai.xyz - Deco Glitch Royale */
:root {
    --deep-foundation: #1a0f0a;
    --chamber-ground: #2d1f17;
    --terracotta: #8b4513;
    --gilded: #c5943a;
    --desert-sand: #d4a76a;
    --glitch-green: #5b8c5a;
    --glitch-red: #c44536;
    --sandstone: #e8d5c4;
    --font-display: "Poiret One", cursive;
    --font-secondary: "Josefin Sans", sans-serif;
    --font-body: "Crimson Pro", serif;
    --font-hud: "Share Tech Mono", monospace;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--deep-foundation);
    color: var(--desert-sand);
    font-family: var(--font-body);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Scan Lines Overlay */
#scanlines {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        transparent, transparent 2px,
        rgba(26,15,10,0.08) 2px, rgba(26,15,10,0.08) 4px
    );
    animation: scanScroll 30s linear infinite;
}

@keyframes scanScroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(100px); }
}

/* HUD Frame */
#hud-frame {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 900;
}

.hud-border {
    position: absolute;
    background: var(--terracotta);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-border-top, .hud-border-bottom {
    left: 30px; right: 30px;
    height: 1px;
}
.hud-border-top { top: 30px; }
.hud-border-bottom { bottom: 30px; }
.hud-border-left, .hud-border-right {
    top: 30px; bottom: 30px;
    width: 1px;
}
.hud-border-left { left: 30px; }
.hud-border-right { right: 30px; }

/* HUD state classes applied by JS */
body.hud-complex .hud-border {
    box-shadow: 0 0 0 1px var(--terracotta), 0 0 0 3px transparent, 0 0 0 4px var(--terracotta);
}
body.hud-max .hud-border {
    box-shadow: 0 0 0 1px var(--gilded), 0 0 0 3px transparent, 0 0 0 4px var(--gilded), 0 0 0 6px transparent, 0 0 0 7px var(--terracotta);
}
body.hud-minimal .hud-border {
    background: var(--terracotta);
    box-shadow: none;
}
body.hud-corrupted .hud-border {
    background: var(--glitch-green);
    box-shadow: none;
}

/* HUD Corners */
.hud-corner {
    position: absolute;
    width: 60px; height: 60px;
    z-index: 901;
}
.hud-corner-tl { top: 5px; left: 5px; }
.hud-corner-tr { top: 5px; right: 5px; }
.hud-corner-bl { bottom: 5px; left: 5px; }
.hud-corner-br { bottom: 5px; right: 5px; }

/* Rosette Mini (HUD corners) */
.rosette-mini {
    position: relative;
    width: 50px; height: 50px;
    animation: rosetteBreathe 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes rosetteBreathe {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.6; }
    50% { transform: scale(1.05) rotate(2deg); opacity: 0.8; }
}

.rosette-ring {
    position: absolute;
    border: 1px solid var(--terracotta);
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.rosette-ring:nth-child(1) { width: 48px; height: 48px; }
.rosette-ring:nth-child(2) { width: 32px; height: 32px; }
.rosette-ring:nth-child(3) { width: 16px; height: 16px; }

.rosette-arm {
    position: absolute;
    width: 1px; height: 24px;
    background: var(--terracotta);
    top: 50%; left: 50%;
    transform-origin: 0 0;
}
.rosette-arm:nth-child(4) { transform: rotate(0deg) translateY(-24px); }
.rosette-arm:nth-child(5) { transform: rotate(30deg) translateY(-24px); }
.rosette-arm:nth-child(6) { transform: rotate(60deg) translateY(-24px); }
.rosette-arm:nth-child(7) { transform: rotate(90deg) translateY(-24px); }
.rosette-arm:nth-child(8) { transform: rotate(120deg) translateY(-24px); }
.rosette-arm:nth-child(9) { transform: rotate(150deg) translateY(-24px); }

body.hud-max .rosette-mini {
    animation: rosetteMax 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes rosetteMax {
    0%, 100% { transform: scale(1.1) rotate(0deg); opacity: 0.9; }
    50% { transform: scale(1.2) rotate(5deg); opacity: 1; }
}

body.hud-corrupted .rosette-ring { border-color: var(--glitch-green); }
body.hud-corrupted .rosette-arm { background: var(--glitch-red); }

/* HUD Data Readouts */
.hud-data {
    position: absolute;
    font-family: var(--font-hud);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--gilded);
    opacity: 0.5;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hud-data-tl { top: 40px; left: 40px; }
.hud-data-tr { top: 40px; right: 40px; text-align: right; align-items: flex-end; }
.hud-data-bl { bottom: 40px; left: 40px; }
.hud-data-br { bottom: 40px; right: 40px; text-align: right; align-items: flex-end; }
.hud-label { font-size: 0.6rem; opacity: 0.6; }
.hud-value { font-size: 0.8rem; }

/* HUD Progress */
.hud-progress {
    position: absolute;
    right: 32px;
    top: 80px;
    bottom: 80px;
    width: 2px;
    background: rgba(139, 69, 19, 0.2);
}
.hud-progress-bar {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0%;
    background: var(--gilded);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chamber Base */
.chamber {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chamber-alpha { min-height: 100vh; background: var(--deep-foundation); }
#chamber-beta { min-height: 120vh; background: var(--chamber-ground); }
#chamber-gamma { min-height: 80vh; background: var(--deep-foundation); animation: gammaOscillate 10s ease-in-out infinite; }
#chamber-delta { min-height: 140vh; background: var(--chamber-ground); }
#chamber-omega { min-height: 100vh; background: var(--deep-foundation); }

@keyframes gammaOscillate {
    0%, 100% { background-color: var(--deep-foundation); }
    50% { background-color: var(--chamber-ground); }
}

.chamber-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 50px;
}

/* Chamber Patterns */
.chamber-pattern {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

.pattern-diamond {
    background-image: repeating-linear-gradient(
        45deg, transparent, transparent 40px,
        rgba(197, 148, 58, 0.03) 40px, rgba(197, 148, 58, 0.03) 41px
    ), repeating-linear-gradient(
        -45deg, transparent, transparent 40px,
        rgba(197, 148, 58, 0.03) 40px, rgba(197, 148, 58, 0.03) 41px
    );
}

.pattern-circles {
    background-image: radial-gradient(circle at 50px 50px, rgba(197, 148, 58, 0.03) 20px, transparent 20px),
        radial-gradient(circle at 100px 100px, rgba(197, 148, 58, 0.02) 15px, transparent 15px);
    background-size: 120px 120px;
}

.pattern-pyramid {
    background-image: repeating-conic-gradient(
        from 0deg at 50% 50%,
        transparent 0deg, transparent 88deg,
        rgba(197, 148, 58, 0.04) 88deg, rgba(197, 148, 58, 0.04) 90deg
    );
    background-size: 60px 60px;
}

/* Lens Flare */
.lens-flare {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0, 0, 0.2, 1);
}

.lens-flare.active {
    opacity: 1;
}

#flare-alpha {
    width: 300px; height: 300px;
    top: 50%; left: 50%;
    transform: translate(-50%, -10%);
    background: radial-gradient(circle, rgba(197,148,58,0.25) 0%, rgba(197,148,58,0.1) 30%, rgba(197,148,58,0.05) 50%, transparent 70%),
        radial-gradient(circle at 40% 40%, rgba(197,148,58,0.15) 0%, transparent 50%),
        radial-gradient(circle at 60% 60%, rgba(197,148,58,0.1) 0%, transparent 40%);
}

#flare-omega {
    width: 400px; height: 400px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(197,148,58,0.3) 0%, rgba(197,148,58,0.15) 25%, rgba(197,148,58,0.05) 50%, transparent 70%),
        radial-gradient(circle at 35% 45%, rgba(196,69,54,0.1) 0%, transparent 40%),
        radial-gradient(circle at 65% 55%, rgba(91,140,90,0.1) 0%, transparent 40%);
}

.flare-gamma-left {
    width: 200px; height: 200px;
    top: 20%; left: 5%;
    background: radial-gradient(circle, rgba(197,148,58,0.2) 0%, rgba(197,148,58,0.05) 50%, transparent 70%);
    animation: flareAsyncL 7.3s ease-in-out infinite;
}
.flare-gamma-right {
    width: 200px; height: 200px;
    bottom: 20%; right: 5%;
    background: radial-gradient(circle, rgba(197,148,58,0.2) 0%, rgba(197,148,58,0.05) 50%, transparent 70%);
    animation: flareAsyncR 5.1s ease-in-out infinite;
}
@keyframes flareAsyncL { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.8; } }
@keyframes flareAsyncR { 0%, 100% { opacity: 0.8; } 50% { opacity: 0.3; } }

/* Chamber Alpha */
.alpha-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.alpha-wordmark {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(4rem, 12vw, 8rem);
    color: var(--gilded);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    position: relative;
    z-index: 3;
}

.alpha-subtitle {
    font-family: var(--font-hud);
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--gilded);
    opacity: 0.4;
    letter-spacing: 0.5em;
    margin-top: 0.5rem;
}

.alpha-radiants {
    position: absolute;
    top: 50%; left: 50%;
    width: 500px; height: 500px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

.radiant-line {
    position: absolute;
    top: 50%; left: 50%;
    width: 1px;
    height: 250px;
    background: linear-gradient(to bottom, rgba(197,148,58,0.3), transparent);
    transform-origin: top center;
}
.radiant-line:nth-child(1) { transform: rotate(0deg); }
.radiant-line:nth-child(2) { transform: rotate(45deg); }
.radiant-line:nth-child(3) { transform: rotate(90deg); }
.radiant-line:nth-child(4) { transform: rotate(135deg); }
.radiant-line:nth-child(5) { transform: rotate(180deg); }
.radiant-line:nth-child(6) { transform: rotate(225deg); }
.radiant-line:nth-child(7) { transform: rotate(270deg); }
.radiant-line:nth-child(8) { transform: rotate(315deg); }

/* Chevron Dividers */
.chevron-divider {
    position: relative;
    height: 40px;
    overflow: hidden;
    background: transparent;
}
.chevron-divider svg {
    width: 100%;
    height: 100%;
}
.chevron-path {
    fill: none;
    stroke: var(--terracotta);
    stroke-width: 1;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: chevronFlow 2.5s linear infinite;
}
.chevron-path-2 {
    stroke: var(--gilded);
    opacity: 0.4;
    animation-delay: 0.3s;
}
.chevron-path-3 {
    stroke: var(--terracotta);
    opacity: 0.3;
    animation-delay: 0.6s;
}
@keyframes chevronFlow {
    0% { stroke-dashoffset: 800; }
    80% { stroke-dashoffset: 0; }
    80.1%, 100% { stroke-dashoffset: 0; }
}

.chevron-mini {
    height: 12px;
    margin: 1.2rem 0;
    opacity: 0.5;
}
.chevron-mini svg { width: 100%; height: 100%; }
.chevron-path-mini {
    fill: none;
    stroke: var(--terracotta);
    stroke-width: 0.5;
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: chevronFlow 3s linear infinite;
}

/* Chamber Beta */
.beta-content {
    display: flex;
    gap: 4rem;
    padding: 80px 50px;
    min-height: 120vh;
    align-items: center;
}
.beta-left {
    flex: 0 0 60%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.beta-right {
    flex: 0 0 35%;
}

/* Large Rosette */
.rosette-large {
    position: relative;
    width: 40vmin; height: 40vmin;
    animation: rosetteRotate 720s linear infinite;
}
@keyframes rosetteRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.rosette-ring-lg {
    position: absolute;
    border: 1px solid var(--gilded);
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.6;
}
.rosette-ring-lg:nth-child(1) { width: 100%; height: 100%; }
.rosette-ring-lg:nth-child(2) { width: 75%; height: 75%; }
.rosette-ring-lg:nth-child(3) { width: 50%; height: 50%; }
.rosette-ring-lg:nth-child(4) { width: 25%; height: 25%; }

.rosette-arm-lg {
    position: absolute;
    width: 1px;
    height: 50%;
    background: linear-gradient(to bottom, var(--gilded), transparent);
    top: 50%; left: 50%;
    transform-origin: top center;
    opacity: 0.4;
}
.rosette-arm-lg:nth-child(5) { transform: rotate(0deg); }
.rosette-arm-lg:nth-child(6) { transform: rotate(15deg); }
.rosette-arm-lg:nth-child(7) { transform: rotate(30deg); }
.rosette-arm-lg:nth-child(8) { transform: rotate(45deg); }
.rosette-arm-lg:nth-child(9) { transform: rotate(60deg); }
.rosette-arm-lg:nth-child(10) { transform: rotate(75deg); }
.rosette-arm-lg:nth-child(11) { transform: rotate(90deg); }
.rosette-arm-lg:nth-child(12) { transform: rotate(105deg); }
.rosette-arm-lg:nth-child(13) { transform: rotate(120deg); }
.rosette-arm-lg:nth-child(14) { transform: rotate(135deg); }
.rosette-arm-lg:nth-child(15) { transform: rotate(150deg); }
.rosette-arm-lg:nth-child(16) { transform: rotate(165deg); }

.beta-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--gilded);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.beta-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    color: var(--desert-sand);
}

/* Chamber Gamma */
.gamma-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 40px 50px;
    position: relative;
}

.gamma-text-layer {
    position: relative;
    margin: 0.3rem 0;
    overflow: hidden;
}

.gamma-text {
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: clamp(0.9rem, 2vw, 1.4rem);
    color: var(--gilded);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: inline-block;
}

.gamma-layer-1 { transform: translateX(-15px); }
.gamma-layer-2 { transform: translateX(25px); opacity: 0.7; }
.gamma-layer-3 { transform: translateX(-5px); opacity: 0.85; }
.gamma-layer-4 { transform: translateX(40px); opacity: 0.6; }
.gamma-layer-5 { transform: translateX(-30px); opacity: 0.75; }
.gamma-layer-6 { transform: translateX(10px); opacity: 0.9; }
.gamma-layer-7 { transform: translateX(-20px); opacity: 0.65; }

/* Chamber Delta */
.delta-content {
    display: flex;
    gap: 2rem;
    padding: 80px 50px;
    min-height: 140vh;
    align-items: flex-start;
}

.delta-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.delta-col-1 { padding-top: 0; }
.delta-col-2 { padding-top: 15vh; }
.delta-col-3 { padding-top: 30vh; }

.delta-card {
    position: relative;
    padding: 2rem;
    border: 1px solid rgba(139, 69, 19, 0.4);
    border-top: 2px solid var(--gilded);
    background: rgba(26, 15, 10, 0.5);
}

.delta-card::before {
    content: "";
    position: absolute;
    top: -1px; left: -1px;
    width: 12px; height: 12px;
    border-top: 2px solid var(--gilded);
    border-left: 2px solid var(--gilded);
}
.delta-card::after {
    content: "";
    position: absolute;
    top: -1px; right: -1px;
    width: 12px; height: 12px;
    border-top: 2px solid var(--gilded);
    border-right: 2px solid var(--gilded);
}

.delta-card-rosette {
    position: absolute;
    top: 8px; left: 8px;
    width: 20px; height: 20px;
    border: 1px solid var(--gilded);
    border-radius: 50%;
    opacity: 0.5;
}
.delta-card-rosette::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 1px; height: 18px;
    background: var(--gilded);
    transform: translate(-50%, -50%);
    opacity: 0.5;
}
.delta-card-rosette::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 18px; height: 1px;
    background: var(--gilded);
    transform: translate(-50%, -50%);
    opacity: 0.5;
}

.delta-card-title {
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--gilded);
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.delta-card-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    color: var(--desert-sand);
}

/* Chamber Omega */
.omega-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.omega-wordmark {
    position: relative;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(4rem, 12vw, 8rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.omega-layer {
    display: block;
    position: absolute;
    top: 0; left: 0;
    width: 100%;
}
.omega-layer-green {
    color: var(--glitch-green);
    transform: translateX(-4px) translateY(2px);
    opacity: 0.7;
}
.omega-layer-red {
    color: var(--glitch-red);
    transform: translateX(4px) translateY(-2px);
    opacity: 0.7;
}
.omega-layer-main {
    position: relative;
    color: var(--gilded);
}

.omega-subtitle {
    font-family: var(--font-hud);
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--glitch-green);
    opacity: 0.5;
    letter-spacing: 0.5em;
    margin-top: 0.5rem;
}

.omega-status {
    font-family: var(--font-hud);
    font-size: 0.75rem;
    color: var(--glitch-red);
    opacity: 0.6;
    letter-spacing: 0.2em;
    margin-top: 3rem;
    animation: statusBlink 2.3s steps(1) infinite;
}
@keyframes statusBlink {
    0%, 49% { opacity: 0.6; }
    50%, 100% { opacity: 0.2; }
}

/* Glitch Effect Classes */
.glitch-active {
    animation: glitchShake 120ms steps(1) forwards;
}
@keyframes glitchShake {
    0% { transform: translateX(0); clip-path: inset(0 0 0 0); }
    20% { transform: translateX(8px); clip-path: inset(20% 0 60% 0); }
    40% { transform: translateX(-6px); clip-path: inset(40% 0 30% 0); }
    60% { transform: translateX(4px); clip-path: inset(60% 0 10% 0); }
    80% { transform: translateX(-10px); clip-path: inset(10% 0 70% 0); }
    100% { transform: translateX(0); clip-path: inset(0 0 0 0); }
}

.glitch-text {
    text-shadow: 3px 0 var(--glitch-green), -3px 0 var(--glitch-red);
}

.glitch-column {
    animation: glitchColumn 200ms steps(1) forwards;
}
@keyframes glitchColumn {
    0% { transform: translateX(0); }
    25% { transform: translateX(12px); }
    50% { transform: translateX(-8px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .beta-content { flex-direction: column; }
    .beta-left { flex: none; }
    .beta-right { flex: none; }
    .delta-content { flex-direction: column; }
    .delta-col-2, .delta-col-3 { padding-top: 0; }
    .hud-corner { width: 40px; height: 40px; }
    .rosette-mini { width: 35px; height: 35px; }
    .hud-data { font-size: 0.6rem; }
    .hud-data-tl, .hud-data-bl { left: 10px; }
    .hud-data-tr, .hud-data-br { right: 10px; }
    .hud-border-top, .hud-border-bottom { left: 10px; right: 10px; }
    .hud-border-top { top: 10px; }
    .hud-border-bottom { bottom: 10px; }
    .hud-border-left { left: 10px; }
    .hud-border-right { right: 10px; }
    .hud-border-left, .hud-border-right { top: 10px; bottom: 10px; }
    .chamber-content { padding: 40px 20px; }
    .alpha-radiants { width: 300px; height: 300px; }
    .radiant-line { height: 150px; }
}
