/* ============================================
   munj.uk — Neubrutalist Earth-Tone Design
   ============================================ */

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

:root {
    --parchment: #F5F0E8;
    --earth-dark: #1A1810;
    --clay-warm: #B8947A;
    --sage-muted: #8A9878;
    --marble-white: #E8E4DC;
    --foxed-amber: #C8A860;
    --leather-brown: #5A4838;
    --deep-brown: #3A3228;
    --base-unit: 24px;
}

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

body {
    background-color: var(--parchment);
    color: var(--earth-dark);
    font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
    font-weight: 400;
    font-size: clamp(16px, 1.1vw, 18px);
    line-height: 1.85;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Viewport Border (Neubrutalist Frame) --- */
.viewport-border {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
}

.border-svg {
    width: 100%;
    height: 100%;
}

.border-rect {
    stroke-dasharray: 398;
    stroke-dashoffset: 398;
    animation: drawBorder 1000ms ease-out forwards;
}

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

/* --- First Statement (Hero 100vh) --- */
.first-statement {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--parchment);
}

.first-statement-inner {
    text-align: center;
    padding: var(--base-unit);
}

.domain-title {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 120px);
    letter-spacing: 0em;
    color: var(--earth-dark);
    margin-bottom: 0.2em;
    line-height: 1.1;
}

.domain-title .char-group {
    display: inline-block;
    opacity: 0;
}

.domain-title .char-group.revealed {
    animation: charFadeIn 300ms ease-out forwards;
}

@keyframes charFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.korean-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: 500;
    font-size: clamp(28px, 4vw, 60px);
    color: var(--earth-dark);
    opacity: 0;
    margin-bottom: 0.3em;
    transition: opacity 600ms ease-out;
}

.korean-title.visible {
    opacity: 1;
}

.meaning-subtitle {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-style: normal;
    font-size: clamp(14px, 1.2vw, 18px);
    color: var(--clay-warm);
    opacity: 0;
    transition: opacity 600ms ease-out;
}

.meaning-subtitle.visible {
    opacity: 1;
}

.meaning-subtitle em {
    font-style: italic;
}

/* --- Priority Stack (Content Section) --- */
.priority-stack {
    max-width: 720px;
    margin: 0 auto;
    padding: calc(var(--base-unit) * 2) var(--base-unit);
}

/* --- Neubrutalist Cards --- */
.neubrutalist-card {
    position: relative;
    border: 3px solid var(--earth-dark);
    box-shadow: 4px 4px 0 var(--earth-dark);
    background-color: var(--parchment);
    padding: 20px;
    margin-bottom: 48px;
    border-radius: 0;
    transition: box-shadow 200ms ease, transform 200ms ease;
    overflow: hidden;
}

.neubrutalist-card:hover {
    box-shadow: 8px 8px 0 var(--earth-dark);
    transform: translate(-2px, -2px);
}

/* Card rotations via nth-child */
.neubrutalist-card:nth-child(7n+1) {
    transform: rotate(0.4deg);
}
.neubrutalist-card:nth-child(7n+2) {
    transform: rotate(-0.3deg);
}
.neubrutalist-card:nth-child(7n+3) {
    transform: rotate(0.6deg);
}
.neubrutalist-card:nth-child(7n+4) {
    transform: rotate(-0.5deg);
}
.neubrutalist-card:nth-child(7n+5) {
    transform: rotate(0.3deg);
}
.neubrutalist-card:nth-child(7n+6) {
    transform: rotate(-0.7deg);
}
.neubrutalist-card:nth-child(7n+7) {
    transform: rotate(0.8deg);
}

.neubrutalist-card:hover {
    box-shadow: 8px 8px 0 var(--earth-dark);
    transform: translate(-2px, -2px) rotate(0deg);
}

/* --- Skeleton Loading State --- */
.card-skeleton-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--parchment);
    padding: 20px;
    z-index: 2;
    transition: opacity 400ms ease-out;
}

.neubrutalist-card.revealed .card-skeleton-overlay {
    opacity: 0;
    pointer-events: none;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 12px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        var(--marble-white) 25%,
        #d8d4cc 37%,
        var(--marble-white) 63%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-line-title {
    height: 22px;
    width: 60%;
    margin-bottom: 18px;
}

.skeleton-line-short {
    width: 40%;
}

.skeleton-line-full {
    width: 100%;
}

.skeleton-line-medium {
    width: 75%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* --- Card Content --- */
.card-content {
    position: relative;
    z-index: 1;
}

.card-label {
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sage-muted);
    display: block;
    margin-bottom: 8px;
}

.card-title {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: clamp(22px, 3vw, 32px);
    letter-spacing: 0em;
    color: var(--earth-dark);
    margin-bottom: 12px;
    line-height: 1.3;
}

.card-text {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(16px, 1.1vw, 18px);
    line-height: 1.85;
    color: var(--earth-dark);
    margin-bottom: 12px;
}

.card-text:last-child {
    margin-bottom: 0;
}

.card-text em {
    font-style: italic;
}

/* --- Flowing Curves Dividers --- */
.flowing-curves-divider {
    width: 100%;
    overflow: hidden;
    padding: 16px 0;
    cursor: default;
}

.flowing-curves-divider svg {
    display: block;
    width: 100%;
    height: 60px;
}

.curve-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 0ms;
}

.flowing-curves-divider.drawn .curve-path {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1200ms ease-out;
}

.flowing-curves-divider:hover .curve-path {
    stroke-width: 2;
}

/* --- Marble Interludes --- */
.marble-interlude {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: calc(var(--base-unit) * 4) var(--base-unit);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--marble-white);
    margin-bottom: 48px;
    overflow: hidden;
}

.marble-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(184, 148, 122, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(200, 168, 96, 0.2) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(138, 152, 120, 0.25) 0%, transparent 45%),
        radial-gradient(ellipse at 70% 60%, rgba(184, 148, 122, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse at 30% 30%, rgba(232, 228, 220, 0.5) 0%, transparent 60%);
    filter: url(#marble-filter);
    transition: opacity 800ms ease;
}

.marble-interlude.in-view .marble-texture {
    opacity: 0.15;
}

.marble-quote {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 600px;
}

.marble-quote p {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(22px, 2.5vw, 36px);
    line-height: 1.5;
    color: var(--earth-dark);
    margin-bottom: 16px;
}

.marble-quote cite {
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--clay-warm);
    font-style: normal;
}

.marble-quote cite em {
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-size: 15px;
}

/* --- Foundation Footer (100vh) --- */
.foundation-footer {
    position: relative;
    min-height: 100vh;
    background: linear-gradient(175deg, var(--deep-brown) 0%, var(--leather-brown) 50%, var(--deep-brown) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.leather-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.08;
    background:
        repeating-radial-gradient(circle at 30% 40%, rgba(245, 240, 232, 0.03) 0px, transparent 2px),
        repeating-radial-gradient(circle at 70% 60%, rgba(245, 240, 232, 0.02) 0px, transparent 3px);
    filter: url(#leather-noise);
}

.footer-inner {
    position: relative;
    z-index: 1;
    max-width: 600px;
    width: 100%;
    padding: calc(var(--base-unit) * 2);
    text-align: center;
}

.footer-stitching-top,
.footer-stitching-bottom {
    border-top: 2px dashed var(--clay-warm);
    opacity: 0.5;
    margin-bottom: calc(var(--base-unit) * 2);
}

.footer-stitching-bottom {
    border-top: none;
    border-bottom: 2px dashed var(--clay-warm);
    margin-bottom: 0;
    margin-top: calc(var(--base-unit) * 2);
}

.footer-content {
    padding: var(--base-unit) 0;
}

.footer-domain {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 700;
    font-size: clamp(32px, 5vw, 56px);
    color: var(--parchment);
    letter-spacing: 0em;
    margin-bottom: 8px;
    line-height: 1.2;
}

.footer-korean {
    font-family: 'Noto Serif KR', serif;
    font-weight: 500;
    font-size: clamp(20px, 3vw, 36px);
    color: var(--clay-warm);
    margin-bottom: 12px;
}

.footer-tagline {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(16px, 1.3vw, 20px);
    color: var(--foxed-amber);
    margin-bottom: calc(var(--base-unit) * 1.5);
}

.footer-divider {
    width: 60px;
    height: 2px;
    background-color: var(--clay-warm);
    margin: 0 auto calc(var(--base-unit) * 1.5);
    opacity: 0.6;
}

.footer-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-detail-item {
    font-family: 'EB Garamond', Georgia, serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 16px);
    color: var(--marble-white);
    line-height: 1.6;
}

.footer-label {
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sage-muted);
    margin-right: 8px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .priority-stack {
        padding: var(--base-unit) 16px;
    }

    .neubrutalist-card {
        margin-bottom: 32px;
    }

    .marble-interlude {
        padding: calc(var(--base-unit) * 2.5) 16px;
        margin-bottom: 32px;
    }

    .footer-inner {
        padding: var(--base-unit);
    }
}

@media (max-width: 480px) {
    .neubrutalist-card {
        padding: 16px;
        box-shadow: 3px 3px 0 var(--earth-dark);
    }

    .neubrutalist-card:hover {
        box-shadow: 6px 6px 0 var(--earth-dark);
        transform: translate(-1px, -1px) rotate(0deg);
    }
}
