/* ============================================================
   yesan.xyz — styles.css
   Colors: #e8e8ec (Fog Gray), #4a4a5a (Slate), #7ba7c4 (Blue),
           #8aab8f (Sage), #d4a0a0 (Blush), #2a2a35 (Charcoal),
           #f5f5f8 (Cloud White), #c8c8d0 (Mid Gray), #f0f0f5
   Fonts: Zilla Slab 700, Noto Sans KR 400, Cutive Mono
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #e8e8ec;
    color: #4a4a5a;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 1rem;
    line-height: 1.75;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    color: #2a2a35;
    line-height: 1.15;
}

.mono {
    font-family: 'Cutive Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

em {
    font-style: italic;
    color: #2a2a35;
}

p {
    margin-bottom: 1.1rem;
}

p:last-child {
    margin-bottom: 0;
}

/* --- Hero: The Mist --- */
#hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(160deg, #e8e8ec 0%, #c8c8d0 100%);
    overflow: hidden;
    display: flex;
    align-items: flex-start;
}

.watercolor-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.blob {
    position: absolute;
    border-radius: 40% 60% 55% 45% / 60% 40% 45% 55%;
    pointer-events: none;
}

.blob-1 {
    width: 340px;
    height: 280px;
    background: #7ba7c4;
    opacity: 0.28;
    top: 8%;
    left: 55%;
    transform: rotate(-18deg);
    filter: blur(45px);
}

.blob-2 {
    width: 260px;
    height: 220px;
    background: #8aab8f;
    opacity: 0.32;
    top: 35%;
    left: 62%;
    transform: rotate(25deg);
    filter: blur(38px);
    border-radius: 55% 45% 40% 60% / 45% 55% 60% 40%;
}

.blob-3 {
    width: 200px;
    height: 240px;
    background: #d4a0a0;
    opacity: 0.22;
    top: 60%;
    left: 35%;
    transform: rotate(-8deg);
    filter: blur(50px);
    border-radius: 60% 40% 50% 50% / 40% 60% 50% 50%;
}

.blob-4 {
    width: 180px;
    height: 160px;
    background: #7ba7c4;
    opacity: 0.20;
    top: 15%;
    left: 10%;
    transform: rotate(12deg);
    filter: blur(40px);
    border-radius: 50% 50% 60% 40% / 55% 45% 40% 60%;
}

.blob-5 {
    width: 300px;
    height: 200px;
    background: #8aab8f;
    opacity: 0.18;
    top: 75%;
    left: 65%;
    transform: rotate(-30deg);
    filter: blur(55px);
    border-radius: 45% 55% 50% 50% / 60% 40% 45% 55%;
}

.blob-6 {
    width: 150px;
    height: 180px;
    background: #d4a0a0;
    opacity: 0.25;
    top: 45%;
    left: 18%;
    transform: rotate(15deg);
    filter: blur(35px);
}

#hero-text {
    position: relative;
    z-index: 2;
    padding: 40vh 0 0 15%;
}

#domain-title {
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 700;
    color: #2a2a35;
    letter-spacing: -0.02em;
    margin-bottom: 0.6rem;
}

.domain-en {
    color: #2a2a35;
}

.domain-dot {
    color: #7ba7c4;
}

.domain-tld {
    color: #4a4a5a;
    opacity: 0.6;
}

#domain-subtitle {
    font-size: 1rem;
    color: #4a4a5a;
    margin-bottom: 0.4rem;
    letter-spacing: 0.08em;
}

#hero-meaning {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.85rem;
    color: #4a4a5a;
    opacity: 0.65;
    letter-spacing: 0.04em;
}

#scroll-line {
    position: absolute;
    left: calc(15% + 3px);
    top: calc(40% + 7rem);
    width: 1px;
    height: 120px;
    background: linear-gradient(to bottom, #4a4a5a, transparent);
    opacity: 0.4;
    z-index: 2;
}

/* --- Changsal SVG Background Pattern --- */
.changsal-bg {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='40' height='40' fill='none'/%3E%3Cpath d='M0 20 H40 M20 0 V40 M0 0 L40 40 M40 0 L0 40' stroke='%234a4a5a' stroke-width='0.5' stroke-opacity='0.05'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Broken-Grid Sections --- */
.broken-grid-section {
    position: relative;
    padding: 5rem 0;
    overflow: hidden;
}

.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 1.5rem;
    row-gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

/* Section 1: About */
#about .cell-heading {
    grid-column: 2 / 7;
    grid-row: 1;
    z-index: 2;
}

#about .cell-body {
    grid-column: 5 / 12;
    grid-row: 1;
    z-index: 1;
    padding-top: 4rem;
    background: #f5f5f8;
    padding: 2rem 1.5rem 1.5rem;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.06);
    margin-top: 3rem;
}

#about .paper-layer {
    grid-column: 1 / 5;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    opacity: 0.5;
    transform: rotate(-1.5deg);
    background: #f0f0f5;
    padding: 1rem 1.2rem;
    box-shadow: 1px 1px 5px rgba(0,0,0,0.05);
}

/* Section 2: Idea */
#idea .cell-heading-right {
    grid-column: 7 / 12;
    grid-row: 1;
    z-index: 2;
    text-align: right;
}

#idea .cell-body-left {
    grid-column: 2 / 9;
    grid-row: 1;
    z-index: 1;
    padding-top: 3.5rem;
    background: #f5f5f8;
    padding: 2rem 1.5rem 1.5rem;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.06);
    margin-top: 2.5rem;
}

#idea .rotated-block {
    grid-column: 8 / 13;
    grid-row: 2;
    transform: rotate(1.8deg);
    background: #f0f0f5;
    padding: 1.2rem 1.5rem;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.07);
    margin-top: -1rem;
}

.tally-list {
    list-style: none;
    margin-top: 0.8rem;
}

.tally-list li {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
    font-family: 'Cutive Mono', monospace;
    font-size: 0.85rem;
    color: #4a4a5a;
}

.tally-dash {
    flex: 1;
    color: #c8c8d0;
    letter-spacing: 0.1em;
}

/* Section 3: Space */
#space .cell-heading {
    grid-column: 2 / 6;
    grid-row: 1;
    z-index: 2;
}

#space .cell-body {
    grid-column: 5 / 11;
    grid-row: 1;
    z-index: 1;
    padding-top: 3.5rem;
    background: #f5f5f8;
    padding: 2rem 1.5rem 1.5rem;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.06);
    margin-top: 3rem;
}

#space .overlapping-accent {
    grid-column: 10 / 13;
    grid-row: 1 / 3;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.accent-square {
    width: 80px;
    height: 80px;
    background: #7ba7c4;
    opacity: 0.25;
    transform: rotate(12deg);
    border-radius: 4px;
}

.accent-text {
    font-size: 0.75rem;
    color: #4a4a5a;
    opacity: 0.55;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 0.15em;
}

/* Section 4: Fragments */
#fragments .cell-heading-right {
    grid-column: 7 / 12;
    grid-row: 1;
    z-index: 2;
    text-align: right;
}

.fragments-grid {
    grid-column: 1 / 13;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.fragment-card {
    background: #f5f5f8;
    padding: 1.5rem;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.06);
}

.fragment-card-offset {
    margin-top: 3rem;
    transform: rotate(1.2deg);
    background: #f0f0f5;
}

.fragment-card-low {
    margin-top: 1.5rem;
    transform: rotate(-0.8deg);
}

.fragment-num {
    display: block;
    font-size: 0.8rem;
    color: #7ba7c4;
    margin-bottom: 0.8rem;
    letter-spacing: 0.12em;
}

/* --- Cell Headings Shared --- */
.cell-heading h2,
.cell-heading-right h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin-bottom: 0.3rem;
    color: #2a2a35;
}

.cell-label {
    display: block;
    font-size: 0.75rem;
    color: #4a4a5a;
    opacity: 0.5;
    margin-top: 0.2rem;
    letter-spacing: 0.1em;
}

/* --- Watercolor Interludes --- */
.watercolor-interlude {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(90deg, #e8e8ec 0%, #f0f0f5 50%, #e8e8ec 100%);
}

.interlude-blob {
    position: absolute;
    border-radius: 40% 60% 55% 45% / 60% 40% 45% 55%;
    pointer-events: none;
}

.ib-1 {
    width: 250px;
    height: 180px;
    background: #7ba7c4;
    opacity: 0.25;
    top: -20px;
    left: 15%;
    transform: rotate(10deg);
    filter: blur(40px);
}

.ib-2 {
    width: 200px;
    height: 220px;
    background: #8aab8f;
    opacity: 0.28;
    top: 10px;
    left: 45%;
    transform: rotate(-15deg);
    filter: blur(35px);
    border-radius: 55% 45% 40% 60% / 45% 55% 60% 40%;
}

.ib-3 {
    width: 180px;
    height: 160px;
    background: #d4a0a0;
    opacity: 0.22;
    top: -10px;
    left: 70%;
    transform: rotate(20deg);
    filter: blur(42px);
}

.interlude-2 {
    background: linear-gradient(90deg, #f0f0f5 0%, #e8e8ec 50%, #f0f0f5 100%);
}

.ib-4 {
    width: 220px;
    height: 200px;
    background: #d4a0a0;
    opacity: 0.30;
    top: -15px;
    left: 5%;
    transform: rotate(-12deg);
    filter: blur(45px);
}

.ib-5 {
    width: 280px;
    height: 160px;
    background: #7ba7c4;
    opacity: 0.22;
    top: 20px;
    left: 38%;
    transform: rotate(8deg);
    filter: blur(38px);
    border-radius: 60% 40% 50% 50% / 40% 60% 50% 50%;
}

.ib-6 {
    width: 160px;
    height: 200px;
    background: #8aab8f;
    opacity: 0.26;
    top: -5px;
    left: 75%;
    transform: rotate(-22deg);
    filter: blur(50px);
}

/* --- Slide-Reveal Animations --- */
.slide-reveal {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-reveal[data-dir="left"] {
    transform: translateX(-50px);
}

.slide-reveal[data-dir="right"] {
    transform: translateX(50px);
}

.slide-reveal.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* --- Footer: The Tally --- */
#tally {
    background: #e8e8ec;
    padding: 5rem 0 3rem;
}

.tally-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 2rem;
}

.tally-rule {
    border: none;
    border-top: 1px solid #4a4a5a;
    opacity: 0.25;
    margin: 1.2rem 0;
}

.tally-rule-double {
    border-top: 3px double #4a4a5a;
    opacity: 0.2;
}

.tally-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tally-title {
    font-size: 1rem;
    color: #2a2a35;
    letter-spacing: 0.08em;
}

.tally-year {
    font-size: 0.85rem;
    color: #4a4a5a;
    opacity: 0.6;
}

.tally-entries {
    margin: 0.5rem 0;
}

.tally-entry {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    margin-bottom: 0.55rem;
}

.tally-key {
    font-size: 0.8rem;
    color: #4a4a5a;
    min-width: 72px;
    opacity: 0.7;
}

.tally-dots {
    flex: 1;
    font-family: 'Cutive Mono', monospace;
    font-size: 0.7rem;
    color: #c8c8d0;
    letter-spacing: 0.05em;
    overflow: hidden;
}

.tally-val {
    font-size: 0.8rem;
    color: #2a2a35;
    text-align: right;
    white-space: nowrap;
}

.tally-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.3rem;
}

.tally-sum {
    font-size: 0.85rem;
    color: #4a4a5a;
    opacity: 0.75;
    letter-spacing: 0.04em;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    #hero-text {
        padding: 35vh 0 0 8%;
    }

    #scroll-line {
        left: calc(8% + 3px);
    }

    .grid-12 {
        grid-template-columns: 1fr;
        padding: 0 1.5rem;
    }

    #about .cell-heading,
    #about .cell-body,
    #about .paper-layer,
    #idea .cell-heading-right,
    #idea .cell-body-left,
    #idea .rotated-block,
    #space .cell-heading,
    #space .cell-body,
    #space .overlapping-accent,
    #fragments .cell-heading-right {
        grid-column: 1 / -1;
        grid-row: auto;
        margin-top: 0;
        transform: none;
    }

    .fragments-grid {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
    }

    .fragment-card-offset,
    .fragment-card-low {
        margin-top: 0;
        transform: none;
    }

    #idea .rotated-block {
        transform: none;
    }
}

@media (max-width: 600px) {
    #hero-text {
        padding: 30vh 0 0 6%;
    }

    .broken-grid-section {
        padding: 3rem 0;
    }

    #tally {
        padding: 3rem 0 2rem;
    }
}
