/* ==========================================================================
   senggack.com — anti-design / bento-box / handwritten / high-contrast
   ========================================================================== */

:root {
    --black: #0A0A0A;
    --white: #FAFAFA;
    --paper: #F5F0E8;
    --gray-50: #808080;
    --gray-25: #404040;
    --red: #E63946;

    --font-kr: "Nanum Pen Script", "Noto Sans KR", serif;
    --font-latin: "Caveat", "Space Mono", cursive;
    --font-body: "Noto Sans KR", "Space Mono", sans-serif;
    --font-mono: "Space Mono", "Noto Sans KR", monospace;

    --gap: 2px;
    --scroll: 0;
}

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

html, body {
    background: var(--black);
    color: var(--black);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
}

/* ==========================================================================
   Masthead
   ========================================================================== */

.masthead {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem 2rem 1.2rem;
    background: var(--white);
    border-bottom: 2px solid var(--black);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--black);
}

.mast-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mast-logo {
    font-family: var(--font-latin);
    font-weight: 700;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
}

.mast-dot {
    color: var(--red);
}

.mast-tag {
    color: var(--gray-25);
    font-size: 0.7rem;
}

.mast-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    font-size: 0.7rem;
    color: var(--black);
}

/* ==========================================================================
   Bento Grid
   ========================================================================== */

.bento {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: var(--gap);
    background: var(--black);
    padding: 0;
    border-top: 0;
    border-bottom: 2px solid var(--black);
}

.cell {
    position: relative;
    background: var(--white);
    padding: 1.4rem 1.5rem 1.6rem;
    overflow: hidden;
    min-height: 180px;
    will-change: transform;
    transition: background 320ms ease;
}

.cell-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-25);
    margin-bottom: 1rem;
}

.cell-meta.meta-light {
    color: var(--gray-50);
    mix-blend-mode: difference;
}

.cell-meta.meta-invert {
    color: var(--white);
}

/* ----- Cell A : The Question ----- */

.cell-a {
    grid-column: span 2;
    grid-row: span 2;
    background: var(--white);
    display: flex;
    flex-direction: column;
    min-height: 560px;
    padding: 1.6rem 1.8rem 1.8rem;
}

.cell-a-inner {
    flex: 1;
    display: grid;
    grid-template-rows: 1fr auto auto;
    position: relative;
}

.saeng {
    font-family: var(--font-kr);
    font-weight: 400;
    font-size: clamp(10rem, 22vw, 22rem);
    line-height: 0.82;
    color: var(--black);
    align-self: center;
    justify-self: start;
    margin-left: -0.6rem;
    margin-top: -0.2rem;
    transform-origin: 30% 60%;
    transition: transform 420ms cubic-bezier(.2,.7,.2,1);
    user-select: none;
}

.saeng:hover {
    transform: rotate(-2.5deg) translate(4px, -6px);
}

.saeng-sub {
    font-family: var(--font-latin);
    font-weight: 700;
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    line-height: 1.02;
    color: var(--black);
    margin-top: 0.6rem;
    max-width: 18ch;
}

.saeng-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--black);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-25);
}

.saeng-arrow {
    font-size: 1.2rem;
    color: var(--black);
}

/* ----- Cell B : Fragment ----- */

.cell-b {
    grid-column: span 1;
    grid-row: span 1;
    background: var(--black);
    color: var(--white);
}

.cell-b .cell-meta {
    color: var(--white);
    opacity: 0.55;
}

.fragment-inner {
    height: calc(100% - 2rem);
    display: flex;
    align-items: flex-end;
}

.fragment-text {
    font-family: var(--font-latin);
    font-weight: 700;
    font-size: clamp(3rem, 6.2vw, 6rem);
    line-height: 0.9;
    color: var(--white);
    white-space: nowrap;
    /* intentionally too large: cropped */
    margin-left: -2rem;
    margin-bottom: -0.4rem;
}

/* ----- Cell C : Void ----- */

.cell-c {
    grid-column: span 1;
    grid-row: span 1;
    background: var(--white);
    border-inside: 1px solid var(--black);
}

.void-inner {
    position: absolute;
    inset: 0.8rem;
    border: 1px solid var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--gray-50);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.void-dot {
    font-size: 3rem;
    line-height: 0.3;
    color: var(--black);
}

.void-label {
    font-size: 0.64rem;
}

/* ----- Cell D : Pattern 01 ----- */

.cell-d {
    grid-column: span 2;
    grid-row: span 1;
}

.pattern-inner {
    position: absolute;
    inset: 0;
    padding: 0.9rem 1.2rem;
    display: flex;
    align-items: flex-end;
}

.pattern-01 {
    background-color: var(--white);
    background-image:
        radial-gradient(circle at 20% 50%, transparent 38px, var(--black) 38px, var(--black) 40px, transparent 40px),
        radial-gradient(circle at 50% 50%, transparent 52px, var(--black) 52px, var(--black) 54px, transparent 54px),
        radial-gradient(circle at 80% 50%, transparent 38px, var(--black) 38px, var(--black) 40px, transparent 40px),
        repeating-linear-gradient(90deg, transparent 0 48px, var(--black) 48px 49px);
}

.pattern-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--black);
    background: var(--white);
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--black);
}

.pattern-label.light {
    color: var(--white);
    background: var(--black);
    border-color: var(--white);
}

/* ----- Cell E : Scroll (Korean calligraphy column) ----- */

.cell-e {
    grid-column: span 1;
    grid-row: span 2;
    background: var(--white);
    padding: 1.4rem 0.4rem 1.6rem;
    min-height: 560px;
}

.cell-e .cell-meta {
    padding: 0 1rem;
}

.scroll-inner {
    position: absolute;
    top: 3rem;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
}

.scroll-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    animation: scroll-up 22s linear infinite;
    font-family: var(--font-kr);
    font-size: clamp(4rem, 9vw, 7rem);
    line-height: 0.82;
    color: var(--black);
    will-change: transform;
}

.scroll-track span {
    display: block;
}

.scroll-mask-top,
.scroll-mask-bot {
    position: absolute;
    left: 0;
    right: 0;
    height: 3.2rem;
    pointer-events: none;
    z-index: 2;
}

.scroll-mask-top {
    top: 0;
    background: linear-gradient(to bottom, var(--white), rgba(250,250,250,0));
}

.scroll-mask-bot {
    bottom: 0;
    background: linear-gradient(to top, var(--white), rgba(250,250,250,0));
}

@keyframes scroll-up {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}

/* ----- Cell F : Inversion ----- */

.cell-f {
    grid-column: span 1;
    grid-row: span 1;
    background: var(--black);
    color: var(--white);
    /* borders disappear where expected */
    box-shadow: inset 0 0 0 2px var(--black);
}

.invert-inner {
    height: calc(100% - 2rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.invert-text {
    font-family: var(--font-mono); /* anti: mono instead of handwritten */
    font-weight: 700;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--white);
    text-transform: lowercase;
}

.invert-sub {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--gray-50);
    letter-spacing: 0.08em;
}

/* ----- Cell G : Manifesto ----- */

.cell-g {
    grid-column: span 2;
    grid-row: span 1;
    background: var(--paper);
}

.manifesto-inner {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    max-width: 58ch;
}

.manifesto-lead {
    font-family: var(--font-latin);
    font-weight: 700;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    line-height: 1.05;
    color: var(--black);
}

.manifesto-lead em {
    font-style: italic;
    border-bottom: 2px solid var(--black);
    padding-bottom: 0.08rem;
}

.manifesto-body {
    font-family: var(--font-body);
    font-size: clamp(0.92rem, 1vw, 1rem);
    line-height: 1.72;
    color: var(--gray-25);
}

.manifesto-body u {
    text-decoration: underline wavy var(--black);
    text-underline-offset: 3px;
}

.manifesto-sig {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--black);
    margin-top: 0.3rem;
}

.sig-red {
    color: var(--red);
    font-family: var(--font-kr);
    font-size: 1.3rem;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: -2px;
}

/* ----- Cell H : Pattern 02 ----- */

.cell-h {
    grid-column: span 1;
    grid-row: span 1;
}

.pattern-02 {
    background-color: var(--black);
    background-image:
        radial-gradient(circle, var(--white) 1.2px, transparent 1.6px),
        repeating-linear-gradient(-45deg, transparent 0 14px, rgba(250,250,250,0.18) 14px 15px);
    background-size: 14px 14px, auto;
}

/* ----- Cell I : second glyph 각 ----- */

.cell-i {
    grid-column: span 1;
    grid-row: span 2;
    background: var(--white);
    min-height: 560px;
}

.cell-i-inner {
    height: calc(100% - 2rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    text-align: right;
}

.gak {
    font-family: var(--font-kr);
    font-size: clamp(8rem, 16vw, 16rem);
    line-height: 0.85;
    color: var(--black);
    margin-right: -0.4rem;
    margin-top: 0.4rem;
    transform-origin: 70% 40%;
    transition: transform 420ms cubic-bezier(.2,.7,.2,1);
    user-select: none;
}

.gak:hover {
    transform: rotate(3deg) translate(-4px, 6px);
}

.gak-sub {
    font-family: var(--font-latin);
    font-weight: 700;
    font-size: clamp(1.6rem, 2.8vw, 2.4rem);
    line-height: 1.02;
    color: var(--black);
    max-width: 20ch;
    padding-top: 1rem;
    border-top: 1px solid var(--black);
    width: 100%;
}

/* ----- Cell J : Index ----- */

.cell-j {
    grid-column: span 2;
    grid-row: span 1;
    background: var(--white);
}

.index-title {
    font-family: var(--font-latin);
    font-weight: 700;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1;
    margin-bottom: 0.6rem;
    color: var(--black);
}

.index-list {
    list-style: none;
    border-top: 1px solid var(--black);
}

.index-list li {
    display: grid;
    grid-template-columns: 3.2rem 1fr auto;
    align-items: baseline;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--gray-50);
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: var(--black);
    transition: background 240ms ease, color 240ms ease;
}

.index-list li:hover {
    background: var(--black);
    color: var(--white);
}

.index-list li:hover .idx-date,
.index-list li:hover .idx-num {
    color: var(--white);
}

.idx-num {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--gray-25);
}

.idx-title {
    font-weight: 400;
}

.idx-date {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--gray-25);
    white-space: nowrap;
}

/* ----- Cell K : Pattern 03 ----- */

.cell-k {
    grid-column: span 1;
    grid-row: span 1;
}

.pattern-03 {
    background-color: var(--white);
    background-image:
        repeating-linear-gradient(45deg, transparent 0 9px, var(--black) 9px 10px),
        repeating-linear-gradient(-45deg, transparent 0 9px, var(--black) 9px 10px);
}

/* ----- Cell L : Alarm (the red) ----- */

.cell-l {
    grid-column: span 1;
    grid-row: span 1;
    background: var(--white);
    display: flex;
    flex-direction: column;
}

.alarm-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.alarm-dot {
    width: 1.4rem;
    height: 1.4rem;
    background: var(--red);
    border-radius: 0;
    margin-top: 0.2rem;
    box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.6);
    animation: heart 2.4s cubic-bezier(.2,.7,.2,1) infinite;
}

@keyframes heart {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.55); }
    14%      { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(230, 57, 70, 0.18); }
    28%      { transform: scale(1); box-shadow: 0 0 0 10px rgba(230, 57, 70, 0); }
}

.alarm-text {
    font-family: var(--font-latin);
    font-weight: 700;
    font-size: clamp(2rem, 3.4vw, 2.8rem);
    line-height: 0.95;
    color: var(--black);
    margin-top: auto;
}

.alarm-sub {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red);
    margin-top: 0.6rem;
}

/* ----- Cell M : Quote ----- */

.cell-m {
    grid-column: span 2;
    grid-row: span 1;
    background: var(--black);
    color: var(--white);
}

.cell-m .cell-meta {
    color: var(--gray-50);
}

.quote-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: calc(100% - 2rem);
}

.quote-text {
    font-family: var(--font-latin);
    font-weight: 700;
    font-size: clamp(1.8rem, 3.2vw, 2.8rem);
    line-height: 1.05;
    color: var(--white);
    max-width: 28ch;
}

.quote-attr {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-50);
    margin-top: 0.8rem;
}

/* ----- Cell N : Colophon ----- */

.cell-n {
    grid-column: span 1;
    grid-row: span 1;
    background: var(--paper);
}

.colophon-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 0.8rem;
    row-gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--gray-25);
}

.colophon-list dt {
    text-transform: uppercase;
    color: var(--black);
}

.colophon-list dd {
    color: var(--gray-25);
}

/* ==========================================================================
   Endmark / footer
   ========================================================================== */

.endmark {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem 1.2rem;
    background: var(--white);
    border-top: 2px solid var(--black);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--black);
}

.end-mid {
    display: flex;
    gap: 0.8rem;
    font-family: var(--font-kr);
    font-size: 2rem;
    line-height: 1;
    text-transform: none;
    letter-spacing: 0;
    color: var(--black);
}

.end-glyph {
    display: inline-block;
    transition: transform 420ms cubic-bezier(.2,.7,.2,1);
}

.end-glyph:hover {
    transform: translateY(-4px) rotate(-4deg);
}

.end-right {
    color: var(--gray-25);
}

/* ==========================================================================
   Cursor echo (subtle trailing dot)
   ========================================================================== */

.cursor-echo {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    background: var(--red);
    pointer-events: none;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: transform 120ms ease-out, opacity 300ms ease;
    opacity: 0;
    z-index: 1000;
}

.cursor-echo.active {
    opacity: 0.85;
}

/* ==========================================================================
   Parallax transform application
   ========================================================================== */

.cell {
    transform: translateY(calc(var(--scroll, 0) * var(--parallax, 0) * 1px));
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
    .bento {
        grid-template-columns: repeat(2, 1fr);
    }

    .cell-a,
    .cell-g,
    .cell-j,
    .cell-m,
    .cell-d {
        grid-column: span 2;
    }

    .cell-a {
        grid-row: span 2;
        min-height: 480px;
    }

    .cell-e,
    .cell-i {
        grid-column: span 1;
        grid-row: span 2;
        min-height: 460px;
    }

    .cell {
        transform: none !important;
    }

    .fragment-text {
        font-size: clamp(2.4rem, 8vw, 4rem);
        white-space: normal;
        margin-left: 0;
    }
}

@media (max-width: 620px) {
    .masthead {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .mast-right {
        align-items: flex-start;
    }

    .bento {
        grid-template-columns: 1fr;
    }

    .cell,
    .cell-a,
    .cell-b,
    .cell-c,
    .cell-d,
    .cell-e,
    .cell-f,
    .cell-g,
    .cell-h,
    .cell-i,
    .cell-j,
    .cell-k,
    .cell-l,
    .cell-m,
    .cell-n {
        grid-column: 1;
        grid-row: auto;
        min-height: 280px;
    }

    .cell-a { min-height: 420px; }
    .cell-e, .cell-i { min-height: 380px; }

    .endmark {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
}
