/* ==========================================================
   gunsul.studio -- Bauhaus Functional + Architectural Blueprint
   ========================================================== */

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

:root {
    --bg: #fafafa;
    --blueprint: #2c5f8a;
    --red: #d63031;
    --blue: #0066cc;
    --yellow: #fdcb6e;
    --text: #1a1a1a;
    --grid-line: #e0e0e0;
    --dark: #2d3436;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    color: var(--text);
    background: var(--bg);
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* --- Grid Overlay --- */
.grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(
            90deg,
            var(--grid-line) 0,
            var(--grid-line) 1px,
            transparent 1px,
            transparent calc(100% / 12)
        );
    opacity: 0.03;
}

/* --- Hero: The Architect's Desk --- */
#hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 40px;
}

.hero-inner {
    display: flex;
    align-items: center;
    gap: 60px;
    max-width: 1200px;
    width: 100%;
}

.blueprint-container {
    flex: 1.2;
    max-width: 700px;
}

#blueprint-svg {
    width: 100%;
    height: auto;
}

.bp-line {
    stroke: #2c5f8a;
    stroke-width: 0.5;
    fill: none;
}

.bp-dim {
    stroke: #2c5f8a;
    stroke-width: 0.3;
    fill: none;
    stroke-dasharray: 4, 2;
}

.bp-annotation {
    font-family: 'Architects Daughter', cursive;
    font-size: 10px;
    fill: #2c5f8a;
}

/* Blueprint unrolling animation */
.bp-line,
.bp-dim {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: unroll 2s ease-out forwards;
}

@keyframes unroll {
    to {
        stroke-dashoffset: 0;
    }
}

.bp-annotation {
    opacity: 0;
    animation: fadeAnnotation 0.5s ease-out 1.8s forwards;
}

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

.hero-title {
    flex: 0.8;
    text-align: left;
}

.studio-name {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--text);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.studio-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    color: var(--blueprint);
    margin-top: 8px;
    letter-spacing: 0.05em;
}

.studio-tagline {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--dark);
    margin-top: 24px;
    line-height: 1.75;
}

/* --- Z-Pattern Grid --- */
#z-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 2 / 1;
}

.z-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    position: relative;
}

.z-red {
    background: var(--red);
    color: #fafafa;
}

.z-blue {
    background: var(--blue);
    color: #fafafa;
}

.z-yellow {
    background: var(--yellow);
    color: var(--text);
}

.z-black {
    background: var(--text);
    color: #fafafa;
}

.z-shape {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
}

.bauhaus-shape {
    width: 100%;
    height: 100%;
}

.z-heading {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.25rem, 3vw, 2rem);
    margin-bottom: 12px;
}

.z-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.75;
    max-width: 380px;
    opacity: 0.9;
}

.z-yellow .z-heading,
.z-yellow .z-text {
    color: var(--text);
}

/* --- Project Ribbon --- */
#project-ribbon {
    position: relative;
    z-index: 1;
    padding: 80px 0 60px;
    background: var(--bg);
    overflow: hidden;
}

.section-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.25rem, 3vw, 2rem);
    text-align: center;
    color: var(--text);
    margin-bottom: 40px;
}

.ribbon-track {
    overflow: hidden;
    width: 100%;
}

.ribbon-inner {
    display: flex;
    gap: 0;
    animation: ribbonScroll 30s linear infinite;
    width: max-content;
}

@keyframes ribbonScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.ribbon-item {
    flex-shrink: 0;
    width: 280px;
    padding: 0 12px;
    text-align: center;
    cursor: pointer;
}

.ribbon-thumb {
    background: #f0f0f0;
    border: 1px solid var(--grid-line);
    aspect-ratio: 3 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: filter 0.4s ease, border-color 0.4s ease;
    filter: grayscale(100%);
}

.ribbon-thumb svg {
    width: 85%;
    height: 85%;
}

.ribbon-item:hover .ribbon-thumb {
    filter: grayscale(0%);
}

.ribbon-item[data-color="red"]:hover .ribbon-thumb {
    filter: grayscale(0%) sepia(40%) hue-rotate(-10deg) saturate(2);
    border-color: var(--red);
}

.ribbon-item[data-color="blue"]:hover .ribbon-thumb {
    filter: grayscale(0%) sepia(40%) hue-rotate(180deg) saturate(2);
    border-color: var(--blue);
}

.ribbon-item[data-color="yellow"]:hover .ribbon-thumb {
    filter: grayscale(0%) sepia(40%) hue-rotate(10deg) saturate(2);
    border-color: var(--yellow);
}

.ribbon-label {
    display: block;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    margin-top: 12px;
}

/* --- Process Strip --- */
#process {
    position: relative;
    z-index: 1;
    padding: 80px 40px;
    background: var(--bg);
}

.process-strip {
    display: flex;
    justify-content: center;
    align-items: stretch;
    max-width: 1100px;
    margin: 0 auto;
}

.process-step {
    width: 200px;
    padding: 32px;
    text-align: center;
    position: relative;
}

.step-red {
    background: var(--red);
    color: #fafafa;
}

.step-blue {
    background: var(--blue);
    color: #fafafa;
}

.step-yellow {
    background: var(--yellow);
    color: var(--text);
}

.step-dark {
    background: var(--dark);
    color: #fafafa;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.2rem;
}

.step-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
}

.step-icon svg {
    width: 100%;
    height: 100%;
}

.step-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.step-desc {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.9;
}

.step-yellow .step-number,
.step-yellow .step-title,
.step-yellow .step-desc {
    color: var(--text);
}

.process-connector {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.process-connector::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--text);
}

/* --- Footer --- */
#footer {
    position: relative;
    z-index: 1;
    background: var(--text);
    color: #fafafa;
    padding: 60px 40px;
    text-align: center;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.footer-logo {
    font-family: 'Archivo Black', sans-serif;
    font-size: 1.5rem;
    color: #fafafa;
}

.footer-kr {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--blueprint);
}

.footer-shapes {
    margin-bottom: 24px;
}

.footer-bauhaus {
    width: 120px;
    height: 40px;
}

.footer-copy {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.8rem;
    color: #e0e0e0;
    opacity: 0.7;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .hero-inner {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .hero-title {
        text-align: center;
    }

    .blueprint-container {
        max-width: 100%;
    }

    #z-grid {
        aspect-ratio: auto;
    }

    .z-cell {
        padding: 30px 20px;
    }

    .process-strip {
        flex-wrap: wrap;
        gap: 0;
    }

    .process-connector {
        display: none;
    }

    .process-step {
        width: 50%;
    }
}

@media (max-width: 600px) {
    #hero {
        padding: 20px;
        min-height: auto;
        padding-top: 60px;
        padding-bottom: 60px;
    }

    #z-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .z-cell {
        padding: 40px 24px;
    }

    .process-step {
        width: 100%;
    }

    .ribbon-item {
        width: 220px;
    }

    .footer-brand {
        flex-direction: column;
        gap: 4px;
    }
}
