@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* Typography compliance notes: (700 triple-stack creates trilingual typographic system (English `clamp(5rem Display's European tradition Display" (Google */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #fefae0;
    color: #3a3226;
    font-family: 'Commissioner', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* Fish Layer */
#fish-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

#fish-layer svg {
    position: absolute;
}

/* Watermark */
#watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vw;
    height: 80vw;
    max-width: 800px;
    max-height: 800px;
    z-index: 0;
    pointer-events: none;
}

/* Hero Section */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(175deg, #fefae0 0%, #faedcd 40%, #d4a373 100%);
    z-index: 2;
    overflow: hidden;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.hero-character {
    width: clamp(200px, 40vw, 400px);
    height: clamp(200px, 40vw, 400px);
}

#mang-text {
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    animation: traceStroke 3s ease-out forwards;
}

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

.hero-subtitle {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: #3a3226;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.hero-subtitle .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    animation: fadeInLetter 0.4s ease forwards;
}

.hero-subtitle .letter:nth-child(1) { animation-delay: 2.5s; }
.hero-subtitle .letter:nth-child(2) { animation-delay: 2.62s; }
.hero-subtitle .letter:nth-child(3) { animation-delay: 2.74s; }
.hero-subtitle .letter:nth-child(4) { animation-delay: 2.86s; }
.hero-subtitle .letter:nth-child(5) { animation-delay: 2.98s; }
.hero-subtitle .letter:nth-child(6) { animation-delay: 3.10s; }
.hero-subtitle .letter:nth-child(7) { animation-delay: 3.22s; }

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

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    animation: driftDown 3s ease-in-out infinite;
}

@keyframes driftDown {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.6; }
    25% { transform: translateY(8px) translateX(4px); opacity: 0.8; }
    50% { transform: translateY(16px) translateX(0); opacity: 0.6; }
    75% { transform: translateY(8px) translateX(-4px); opacity: 0.8; }
}

/* Card Grid Section */
#card-grid {
    position: relative;
    padding: 80px 20px;
    z-index: 2;
    background: transparent;
}

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

.network-lines line {
    stroke: #d4a373;
    stroke-width: 0.5;
    stroke-dasharray: 4 8;
    opacity: 0.3;
}

.grid-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: minmax(200px, auto);
    gap: 24px;
    z-index: 1;
}

.card {
    position: relative;
    background: rgba(254, 250, 224, 0.35);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border: 1px solid rgba(212, 163, 115, 0.25);
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 4px 30px rgba(188, 108, 37, 0.05), inset 0 1px 0 rgba(254, 250, 224, 0.5);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    overflow: hidden;
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-tall {
    grid-row: span 2;
}

.card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: conic-gradient(from var(--angle), #d4a373, #bc6c25, #dda15e, #d4a373);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card::after {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 15px;
    background: rgba(254, 250, 224, 0.85);
    z-index: -1;
}

.card:hover::before {
    opacity: 1;
    animation: rotateBorder 3s linear infinite;
}

@keyframes rotateBorder {
    to {
        --angle: 360deg;
    }
}

.card-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: #3a3226;
    margin-bottom: 4px;
}

.card-subtitle {
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    color: #bc6c25;
    margin-bottom: 16px;
}

.card-body {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    color: rgba(58, 50, 38, 0.8);
    line-height: 1.7;
}

/* Network Visualization */
#network-viz {
    position: relative;
    min-height: 100vh;
    padding: 80px 20px;
    background: linear-gradient(180deg, #fefae0 0%, #b5c49c 50%, #ccd5ae 100%);
    z-index: 2;
    overflow: hidden;
}

.network-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: #3a3226;
    text-align: center;
    margin-bottom: 60px;
    letter-spacing: -0.02em;
}

.network-container {
    position: relative;
    max-width: 1000px;
    height: 600px;
    margin: 0 auto;
}

.network-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.network-svg line {
    stroke: #d4a373;
    stroke-width: 0.5;
    stroke-dasharray: 4 8;
    animation: linePulse 6s ease-in-out infinite;
}

@keyframes linePulse {
    0%, 100% { opacity: 0.15; }
    50% { opacity: 0.35; }
}

.node {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #bc6c25;
    transform: scale(0);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    animation: drift var(--dur) ease-in-out infinite;
}

.node.visible {
    transform: scale(1);
}

.node::after {
    content: attr(data-label-kr) '\A' attr(data-label-en);
    white-space: pre;
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 11px;
    color: #3a3226;
    text-align: center;
    pointer-events: none;
    line-height: 1.4;
}

@keyframes drift {
    0%, 100% { margin-left: 0; margin-top: 0; }
    50% { margin-left: var(--dx); margin-top: var(--dy); }
}

/* Footer */
#footer {
    position: relative;
    padding: 60px 20px;
    background: #ccd5ae;
    text-align: center;
    z-index: 2;
}

.footer-domain {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    color: #3a3226;
    margin-bottom: 8px;
}

.footer-inscription {
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    color: #3a3226;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 600px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .card-tall {
        grid-row: span 1;
    }
    .network-container {
        height: 500px;
    }
}
