/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: 'DM Sans', sans-serif;
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: auto;
    background-color: #F7F7F7;
    color: #3D3D3D;
}

body {
    overflow-x: hidden;
}

/* === TYPOGRAPHY === */
h1, h2, h3 {
    font-family: 'DM Sans', sans-serif;
    text-transform: uppercase;
}

h1 {
    font-weight: 500;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    letter-spacing: 0.2em;
    color: #1A1A1A;
    line-height: 1.0;
}

h2 {
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.5rem);
    letter-spacing: 0.08em;
    color: #1A1A1A;
    line-height: 1.15;
}

h3 {
    font-weight: 700;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    letter-spacing: 0.05em;
    color: #0D0D0D;
    line-height: 1.1;
}

p {
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: #3D3D3D;
}

/* === ZONE A — THE THRESHOLD === */
#zone-a {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    background-color: #F7F7F7;
    overflow: hidden;
}

.zone-a-content {
    padding-left: calc((100% - 96px) / 12 + 48px);
    width: 100%;
}

.wordmark {
    margin-bottom: 24px;
}

.title-rule {
    position: relative;
    width: calc((100% - 96px) * 9 / 12);
    height: 1px;
    background-color: #1A1A1A;
    margin-bottom: 16px;
}

.title-rule .rule-notch {
    position: absolute;
    right: 0;
    top: -3px;
    width: 6px;
    height: 6px;
    background-color: #F7F7F7;
    border-right: 1px solid #1A1A1A;
    border-bottom: 1px solid #1A1A1A;
    transform: rotate(45deg);
    transform-origin: center;
}

.subtitle {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #7A7A7A;
}

.zone-a-clip {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background-color: #1A1A1A;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

/* === ZONE B — THE GRID === */
#zone-b {
    padding: 80px 0 120px;
    background-color: #F7F7F7;
}

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    padding: 0 48px;
}

.card {
    position: relative;
    background-color: #FAFAFA;
    border: 1px solid #D4D4D4;
    padding: 32px 28px 24px;
    clip-path: polygon(24px 0, 100% 0, 100% 100%, 0 100%, 0 24px);
    cursor: pointer;
    transition: transform 280ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 200ms ease;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.card:hover {
    transform: scale(1.03);
    border-color: #1A1A1A;
    z-index: 2;
}

.card:hover .card-index {
    color: #1A1A1A;
    transition-delay: 150ms;
}

/* Card spans */
.card[data-span="4"] {
    grid-column: span 4;
}

.card[data-span="6"] {
    grid-column: span 6;
}

.card[data-span="8"] {
    grid-column: span 8;
}

.card[data-span="12"] {
    grid-column: span 12;
}

.card-index {
    position: absolute;
    top: 12px;
    right: 16px;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #B0B0B0;
    transition: color 200ms ease;
}

.card-title {
    margin-bottom: 8px;
    margin-top: 4px;
}

.card-desc {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #7A7A7A;
    flex: 1;
    margin-bottom: 16px;
}

.card-tag {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 0.625rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #9E9E9E;
    border-top: 1px solid #D4D4D4;
    padding-top: 8px;
    display: inline-block;
    align-self: flex-start;
}

/* === ZONE C — THE DETAIL PLANE === */
.overlay-dimmer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(247, 247, 247, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
    z-index: 90;
}

.overlay-dimmer.active {
    opacity: 1;
    pointer-events: auto;
}

#zone-c {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background-color: #FFFFFF;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    display: flex;
    justify-content: center;
    padding: 80px 48px;
}

#zone-c.active {
    transform: translateX(0);
}

.close-btn {
    position: absolute;
    top: 32px;
    right: 48px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 300ms ease-out;
}

.close-btn:hover {
    transform: rotate(90deg);
}

.close-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 1px;
    background-color: #1A1A1A;
}

.close-line-1 {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close-line-2 {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.detail-content {
    max-width: 720px;
    width: 100%;
}

.detail-title {
    margin-bottom: 24px;
}

.detail-rule {
    position: relative;
    width: 100%;
    height: 1px;
    background-color: #D4D4D4;
    margin-bottom: 32px;
}

.detail-rule .rule-notch {
    position: absolute;
    right: 0;
    top: -3px;
    width: 6px;
    height: 6px;
    background-color: #FFFFFF;
    border-right: 1px solid #D4D4D4;
    border-bottom: 1px solid #D4D4D4;
    transform: rotate(45deg);
    transform-origin: center;
}

.detail-description {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #3D3D3D;
    margin-bottom: 48px;
}

.detail-meta {
    display: flex;
    gap: 48px;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid #D4D4D4;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #7A7A7A;
}

.meta-value {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 0.875rem;
    color: #1A1A1A;
    letter-spacing: 0.02em;
}

.detail-body {
    font-size: 1rem;
    line-height: 1.75;
    color: #3D3D3D;
}

.detail-body p {
    margin-bottom: 1.5em;
}

/* === ZONE D — THE COLOPHON === */
#zone-d {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F7F7F7;
    overflow: hidden;
}

.zone-d-clip {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 120px;
    background-color: #1A1A1A;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.colophon-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.colophon-domain {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.6875rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #1A1A1A;
}

.colophon-copyright {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    color: #9E9E9E;
}

.colophon-link {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    color: #7A7A7A;
    text-decoration: none;
    border-bottom: 1px solid #D4D4D4;
    padding-bottom: 2px;
    transition: color 200ms ease, border-color 200ms ease;
}

.colophon-link:hover {
    color: #1A1A1A;
    border-color: #1A1A1A;
}

/* === RESPONSIVE === */

/* Tablet: 768px - 1199px */
@media (max-width: 1199px) and (min-width: 768px) {
    .grid {
        grid-template-columns: repeat(12, 1fr);
    }

    .card[data-span="4"],
    .card[data-span="6"],
    .card[data-span="8"] {
        grid-column: span 6;
    }

    .card[data-span="12"] {
        grid-column: span 12;
    }
}

/* Mobile: below 768px */
@media (max-width: 767px) {
    .grid {
        grid-template-columns: repeat(6, 1fr);
        padding: 0 24px;
    }

    .card[data-span="4"],
    .card[data-span="6"],
    .card[data-span="8"],
    .card[data-span="12"] {
        grid-column: span 6;
    }

    .zone-a-content {
        padding-left: 24px;
    }

    .title-rule {
        width: calc(100% - 48px);
    }

    #zone-c {
        padding: 60px 24px;
    }

    .close-btn {
        right: 24px;
        top: 24px;
    }

    .detail-meta {
        flex-direction: column;
        gap: 24px;
    }

    .zone-a-clip {
        width: 80px;
        height: 80px;
    }

    .zone-d-clip {
        width: 80px;
        height: 80px;
    }
}

/* === BODY LOCK (when detail panel open) === */
body.detail-open {
    overflow: hidden;
}
