/* =============================================
   doublestandard.xyz — Neubrutalist Serenity
   ============================================= */

/* Custom Properties */
:root {
    --cream-haze: #F5F0E8;
    --pure-white: #FFFFFF;
    --deep-ink: #1A1A1A;
    --soft-lilac: #E8DAF0;
    --mint-whisper: #D4F0E0;
    --blush-cloud: #F5DDE0;
    --lemon-frost: #F5F0D0;
    --powder-blue: #D8E8F5;
    --grid-dot: #E0D8F0;

    --card-color-1: var(--soft-lilac);
    --card-color-2: var(--mint-whisper);
    --card-color-3: var(--blush-cloud);
    --card-color-4: var(--lemon-frost);
    --card-color-5: var(--powder-blue);

    --border: 3px solid #1A1A1A;
    --shadow-d1: 4px 4px 0px #1A1A1A;
    --shadow-d2: 2px 2px 0px #1A1A1A;
    --shadow-d3: 0px 0px 0px #1A1A1A;

    --font-display: 'Fira Sans', sans-serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --ease-settle: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: rgba(26, 26, 26, 0.9);
    background-color: var(--cream-haze);
    overflow-x: hidden;
}

/* =============================================
   SECTION 1: THE FIELD
   ============================================= */
#the-field {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: var(--cream-haze);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.field-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 clamp(24px, 5vw, 80px);
}

.field-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #1A1A1A;
    margin-bottom: 1rem;
}

.field-tagline {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.4rem);
    line-height: 1.6;
    color: rgba(26, 26, 26, 0.7);
    max-width: 600px;
    margin: 0 auto;
}

.scatter-cloud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.scroll-chevron {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--border);
    background: var(--pure-white);
    box-shadow: var(--shadow-d1);
    cursor: pointer;
    animation: chevron-pulse 3s ease-in-out infinite;
    transition: box-shadow 200ms var(--ease-settle), transform 200ms var(--ease-settle);
}

.scroll-chevron:hover {
    box-shadow: 6px 6px 0px #1A1A1A;
    transform: translateX(-50%) translate(-2px, -2px);
}

.scroll-chevron:active {
    box-shadow: 0px 0px 0px #1A1A1A;
    transform: translateX(-50%) translate(4px, 4px);
    transition-duration: 80ms;
}

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

/* =============================================
   SECTION 2: THE GRID
   ============================================= */
#the-grid {
    position: relative;
    background-color: var(--pure-white);
    padding: clamp(40px, 6vw, 80px) clamp(24px, 4vw, 64px);
    min-height: 100vh;
}

/* Dotted grid overlay - engineering paper effect */
#the-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            to right,
            rgba(224, 216, 240, 0.2) 0px,
            rgba(224, 216, 240, 0.2) 1px,
            transparent 1px,
            transparent 40px
        ),
        repeating-linear-gradient(
            to bottom,
            rgba(224, 216, 240, 0.2) 0px,
            rgba(224, 216, 240, 0.2) 1px,
            transparent 1px,
            transparent 40px
        );
    pointer-events: none;
    z-index: 0;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #1A1A1A;
    margin-bottom: clamp(32px, 4vw, 60px);
    position: relative;
    z-index: 1;
}

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

/* Cards */
.card {
    border: var(--border);
    padding: clamp(20px, 2.5vw, 32px);
    position: relative;
    transition: box-shadow 200ms var(--ease-settle), transform 200ms var(--ease-settle);
    opacity: 0;
    transform: translateY(30px);
    border-radius: 0;
}

.card.visible {
    opacity: 1;
    transform: translateY(0) scale(var(--card-scale, 1));
}

/* Card color rotation */
.card[data-color="1"] { background-color: var(--card-color-1); }
.card[data-color="2"] { background-color: var(--card-color-2); }
.card[data-color="3"] { background-color: var(--card-color-3); }
.card[data-color="4"] { background-color: var(--card-color-4); }
.card[data-color="5"] { background-color: var(--card-color-5); }

/* Depth layers */
.card.depth-1 {
    box-shadow: var(--shadow-d1);
    --card-scale: 1;
    z-index: 3;
}

.card.depth-2 {
    box-shadow: var(--shadow-d2);
    --card-scale: 0.98;
    z-index: 2;
}

.card.depth-3 {
    box-shadow: var(--shadow-d3);
    --card-scale: 0.96;
    border-color: #888;
    z-index: 1;
}

.card.visible.depth-2 {
    transform: translateY(0) scale(0.98);
}

.card.visible.depth-3 {
    transform: translateY(0) scale(0.96);
}

/* Card hover states */
.card.depth-1:hover {
    box-shadow: 6px 6px 0px #1A1A1A;
    transform: translate(-2px, -2px) scale(1);
}

.card.depth-1:active {
    box-shadow: 0px 0px 0px #1A1A1A;
    transform: translate(4px, 4px) scale(1);
    transition-duration: 80ms;
}

.card.depth-2:hover {
    box-shadow: 4px 4px 0px #1A1A1A;
    transform: translate(-2px, -2px) scale(0.98);
}

.card.depth-2:active {
    box-shadow: 0px 0px 0px #1A1A1A;
    transform: translate(4px, 4px) scale(0.98);
    transition-duration: 80ms;
}

.card.depth-3:hover {
    box-shadow: 2px 2px 0px #888;
    transform: translate(-1px, -1px) scale(0.96);
}

.card.depth-3:active {
    box-shadow: 0px 0px 0px #888;
    transform: translate(2px, 2px) scale(0.96);
    transition-duration: 80ms;
}

/* Card internals */
.card-viz {
    width: 100%;
    height: 120px;
    margin-bottom: 16px;
    overflow: hidden;
}

.card-viz svg {
    width: 100%;
    height: 100%;
}

.card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #1A1A1A;
    margin-bottom: 8px;
}

.card-description {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.55;
    color: rgba(26, 26, 26, 0.8);
    margin-bottom: 16px;
}

/* Sticker labels */
.card-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    opacity: 0;
    transition: opacity 200ms var(--ease-settle);
}

.card:hover .card-tags {
    opacity: 1;
}

.sticker {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    letter-spacing: 0.03em;
    padding: 3px 12px;
    border: 2px solid #1A1A1A;
    border-radius: 999px;
    background: var(--pure-white);
    color: #1A1A1A;
    transform: rotate(var(--rotation, 0deg)) scale(0.9);
    opacity: 0;
    transition: opacity 200ms var(--ease-settle), transform 300ms var(--ease-settle);
}

.card:hover .sticker {
    opacity: 1;
    transform: rotate(var(--rotation, 0deg)) scale(1);
}

.card:hover .sticker:nth-child(1) { transition-delay: 0ms; }
.card:hover .sticker:nth-child(2) { transition-delay: 80ms; }
.card:hover .sticker:nth-child(3) { transition-delay: 160ms; }

.card-meta {
    display: flex;
    gap: 12px;
}

.meta-label {
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    letter-spacing: 0.03em;
    color: rgba(26, 26, 26, 0.55);
}

/* =============================================
   SECTION 3: THE DATA WALL
   ============================================= */
#the-data-wall {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #1A1A1A;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.network-graph {
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.network-graph.visible {
    opacity: 1;
}

.network-graph circle {
    stroke: #1A1A1A;
    stroke-width: 2px;
}

.network-graph line {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1px;
    stroke-dasharray: 4 4;
}

/* =============================================
   SECTION 4: THE CLOSE
   ============================================= */
#the-close {
    position: relative;
    width: 100%;
    min-height: 50vh;
    background-color: var(--cream-haze);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(40px, 6vw, 80px) clamp(24px, 4vw, 64px);
}

.close-content {
    width: 100%;
    max-width: 560px;
}

.close-border {
    border: var(--border);
    padding: clamp(32px, 4vw, 56px);
    background: var(--pure-white);
    box-shadow: var(--shadow-d1);
}

.close-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #1A1A1A;
    margin-bottom: 32px;
}

.contact-details {
    margin-bottom: 32px;
}

.contact-line {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.65;
    color: rgba(26, 26, 26, 0.9);
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    align-items: baseline;
}

.contact-label {
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    letter-spacing: 0.03em;
    color: rgba(26, 26, 26, 0.55);
    min-width: 80px;
    flex-shrink: 0;
}

.contact-link {
    color: #1A1A1A;
    text-decoration: none;
    border-bottom: 2px solid #1A1A1A;
    transition: border-color 200ms var(--ease-settle);
}

.contact-link:hover {
    border-color: var(--soft-lilac);
}

.contact-text {
    color: rgba(26, 26, 26, 0.9);
}

.close-footnote {
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    letter-spacing: 0.03em;
    color: rgba(26, 26, 26, 0.4);
}

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

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

/* Mobile */
@media (max-width: 640px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .card-tags {
        opacity: 1;
    }

    .sticker {
        opacity: 1;
        transform: rotate(var(--rotation, 0deg)) scale(1);
    }

    .scroll-chevron {
        bottom: 24px;
        width: 52px;
        height: 52px;
    }
}
