/* ===== loophole.dev - Corrupted Corporate Paradise ===== */

:root {
    --desktop-bg: #1A1D25;
    --window-bg: #C0C8D0;
    --window-body: #E8ECF0;
    --titlebar: #2A2D35;
    --text-dark: #2A2D35;
    --text-muted: #5A6070;
    --accent-lavender: #9B8BA0;
    --border-light: #B0B8C4;
    --surface-light: #D8DDE4;
    --highlight: #8892A0;
    --teal-accent: #6B9DAD;
}

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

body {
    background: var(--desktop-bg);
    color: var(--text-dark);
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Boot Screen ===== */
#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--desktop-bg);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 3rem;
    transition: opacity 0.5s ease;
}

#boot-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

#boot-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--teal-accent);
    white-space: pre-line;
    line-height: 1.8;
}

.boot-line {
    display: block;
    opacity: 0;
    animation: bootFadeIn 0.15s forwards;
}

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

/* ===== Desktop ===== */
#desktop {
    position: relative;
    padding: 2rem;
    padding-bottom: 60px;
    min-height: 100vh;
}

/* ===== Win95 Window ===== */
.win95-window {
    background: var(--window-body);
    border: 2px solid var(--border-light);
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
    margin-bottom: 4rem;
    max-width: 900px;
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.win95-window.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Z-pattern layout */
.z-section { margin-left: auto; margin-right: auto; }
.z-odd { margin-left: 5vw; }
.z-even { margin-left: auto; margin-right: 5vw; }

.window-titlebar {
    background: var(--titlebar);
    color: var(--window-body);
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
}

.window-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.window-controls {
    display: flex;
    gap: 3px;
}

.win-btn {
    width: 14px;
    height: 14px;
    background: var(--border-light);
    border: 1px solid var(--highlight);
    display: inline-block;
}

.win-close {
    background: var(--accent-lavender);
}

.window-body {
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    min-height: 250px;
}

.window-statusbar {
    background: var(--surface-light);
    border-top: 1px solid var(--border-light);
    padding: 2px 8px;
    display: flex;
    justify-content: space-between;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== Z-Pattern Positions ===== */
.z-top-left { grid-column: 1; grid-row: 1; }
.z-top-right { grid-column: 2; grid-row: 1; }
.z-bottom-left { grid-column: 1; grid-row: 2; }
.z-bottom-right { grid-column: 2; grid-row: 2; }

/* ===== Typography ===== */
h1 {
    font-family: 'Work Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--titlebar);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

h2 {
    font-family: 'Work Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--titlebar);
    margin-bottom: 1rem;
}

p {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
}

.small-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legal-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.clause-number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--accent-lavender);
    margin-bottom: 0.3rem;
}

.fine-print {
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== Glitch Text ===== */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-text:hover::before {
    color: var(--accent-lavender);
    animation: glitch1 0.3s infinite;
    opacity: 0.8;
}

.glitch-text:hover::after {
    color: var(--teal-accent);
    animation: glitch2 0.3s infinite;
    opacity: 0.6;
}

@keyframes glitch1 {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -1px); }
    60% { transform: translate(-1px, -2px); }
    80% { transform: translate(1px, 1px); }
    100% { transform: translate(0); }
}

@keyframes glitch2 {
    0% { transform: translate(0); }
    20% { transform: translate(2px, -2px); }
    40% { transform: translate(-2px, 1px); }
    60% { transform: translate(1px, 2px); }
    80% { transform: translate(-1px, -1px); }
    100% { transform: translate(0); }
}

.small-glitch {
    font-size: 1.5rem;
    font-weight: 700;
    display: inline-block;
}

/* ===== Corrupted Text ===== */
.corrupted {
    position: relative;
}

.corrupted::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: repeating-linear-gradient(
        90deg,
        var(--accent-lavender) 0px,
        var(--accent-lavender) 4px,
        transparent 4px,
        transparent 8px
    );
    animation: scanline 2s linear infinite;
}

@keyframes scanline {
    from { transform: translateX(-8px); }
    to { transform: translateX(0px); }
}

/* ===== Desktop Icons ===== */
.desktop-icons {
    display: flex;
    gap: 3rem;
    justify-content: center;
    padding: 3rem 0;
}

.desktop-icon {
    text-align: center;
    cursor: default;
}

.icon-graphic {
    font-size: 2.5rem;
    margin-bottom: 0.3rem;
    filter: saturate(0.3);
}

.icon-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    color: var(--border-light);
    display: block;
}

/* ===== Exploit List ===== */
.exploit-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exploit-entry {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: var(--surface-light);
    border: 1px solid var(--border-light);
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
}

.exploit-id {
    color: var(--accent-lavender);
    font-weight: 600;
    min-width: 50px;
}

.exploit-name {
    flex: 1;
    color: var(--text-dark);
}

.exploit-status {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: var(--titlebar);
    color: var(--window-body);
}

.exploit-status:nth-child(3) {
    background: var(--text-muted);
}

/* ===== Taskbar ===== */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 36px;
    background: var(--window-bg);
    border-top: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    padding: 0 4px;
    z-index: 500;
    gap: 4px;
}

.start-button {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    background: var(--surface-light);
    border: 2px outset var(--border-light);
    padding: 2px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-dark);
}

.start-icon {
    color: var(--accent-lavender);
}

.taskbar-items {
    display: flex;
    gap: 2px;
    flex: 1;
}

.taskbar-item {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    padding: 2px 10px;
    background: var(--surface-light);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    cursor: default;
}

.taskbar-item.active {
    border-style: inset;
    background: var(--window-body);
}

.taskbar-clock {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-dark);
    padding: 0 8px;
    border-left: 1px solid var(--border-light);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .window-body {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.5rem;
    }

    .z-top-left, .z-top-right,
    .z-bottom-left, .z-bottom-right {
        grid-column: 1;
    }

    .z-odd, .z-even {
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .desktop-icons {
        gap: 1.5rem;
    }

    .taskbar-items {
        display: none;
    }
}
