/* ==========================================================================
   GAMJA — shared components: buttons, header, menu, preloader, cursor,
   companion, section index, toast, form fields
   ========================================================================== */

/* ---------- buttons ---------- */
.btn {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    height: 58px;
    padding: 0 10px 0 28px;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.005em;
    white-space: nowrap;
    overflow: hidden;
    transition: color .45s var(--ease-out), border-color .45s var(--ease-out), box-shadow .45s var(--ease-out);
    will-change: transform;
}
.btn__fill {
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    transform: translateY(101%);
    transition: transform .6s var(--ease-out);
}
.btn:hover .btn__fill, .btn:focus-visible .btn__fill { transform: translateY(0); }
.btn__label { position: relative; display: block; overflow: hidden; line-height: 1.3; }
.btn__label > span { display: block; transition: transform .55s var(--ease-out); }
.btn__label::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 100%;
    transition: transform .55s var(--ease-out);
}
.btn:hover .btn__label > span, .btn:hover .btn__label::after { transform: translateY(-100%); }
.btn__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.05rem;
    transition: transform .55s var(--ease-out), background-color .45s;
}
.btn:hover .btn__icon { transform: rotate(-45deg); }

.btn--primary {
    background: linear-gradient(180deg, #f02438, #c8111f);
    color: var(--cream);
    box-shadow: 0 10px 30px -10px rgba(227, 24, 45, .8), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn--primary .btn__fill { background: var(--cream); }
.btn--primary .btn__icon { background: rgba(0, 0, 0, .22); }
.btn--primary:hover { color: var(--ink); box-shadow: 0 16px 40px -12px rgba(227, 24, 45, .9); }
.btn--primary:hover .btn__icon { background: var(--red); color: var(--cream); }

.btn--ghost {
    border: 1px solid var(--line-2);
    background: rgba(244, 234, 216, .03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--cream);
}
.btn--ghost .btn__fill { background: var(--red); }
.btn--ghost .btn__icon { background: rgba(244, 234, 216, .08); }
.btn--ghost:hover { border-color: var(--red); }
.btn--ghost:hover .btn__icon { background: rgba(0, 0, 0, .2); }

/* ---------- header ---------- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px var(--gutter) 0;
    pointer-events: none;
    transition: transform .6s var(--ease-out);
}
.site-header.is-hidden { transform: translateY(-130%); }
.site-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
}
.site-header__bar > * { pointer-events: auto; }
.site-header__progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    pointer-events: none;
}
.site-header__progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--red-deep), var(--red-hot));
    box-shadow: var(--glow-sm);
    transform-origin: left;
    transform: scaleX(0);
}

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo__mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--char);
    box-shadow: 0 0 0 1px var(--line-2), 0 6px 20px -8px rgba(227, 24, 45, .7);
    transition: transform .5s var(--ease-back);
}
.logo__mark img { width: 100%; height: 100%; object-fit: cover; }
.logo:hover .logo__mark { transform: rotate(-8deg) scale(1.06); }
.logo__word { font-family: var(--f-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -.04em; }
.logo__kr { font-family: var(--f-kr); font-size: .95rem; color: var(--red-hot); transform: translateY(1px); }
.logo--lg .logo__mark { width: 52px; height: 52px; border-radius: 15px; }
.logo--lg .logo__word { font-size: 1.7rem; }
.logo--lg .logo__kr { font-size: 1.3rem; }

.nav {
    position: relative;
    display: none;
    align-items: center;
    padding: 5px;
    border-radius: 999px;
    background: rgba(18, 14, 15, .6);
    border: 1px solid var(--line);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.nav__pill {
    position: absolute;
    top: 5px;
    left: 0;
    height: calc(100% - 10px);
    width: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(227, 24, 45, .95), rgba(160, 12, 25, .95));
    box-shadow: 0 0 18px rgba(227, 24, 45, .45);
    opacity: 0;
}
.nav__link {
    position: relative;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 650;
    color: var(--muted);
    letter-spacing: .005em;
    transition: color .3s;
}
.nav__link:hover, .nav__link.is-active { color: var(--cream); }

.site-header__actions { display: flex; align-items: center; gap: 10px; }
.header-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 700;
    border: 1px solid var(--line-2);
    background: rgba(18, 14, 15, .55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: background-color .35s, border-color .35s;
}
.header-cta:hover { background: var(--red); border-color: var(--red); }
.header-cta__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sprout); box-shadow: 0 0 10px var(--sprout); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(.7); } }

.menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    height: 46px;
    padding: 0 8px 0 18px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: rgba(18, 14, 15, .55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    font-size: .85rem;
    font-weight: 700;
}
.menu-toggle__lines { position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--red); }
.menu-toggle__lines i { position: absolute; left: 9px; right: 9px; height: 2px; border-radius: 2px; background: var(--cream); transition: transform .5s var(--ease-out), top .5s var(--ease-out); }
.menu-toggle__lines i:first-child { top: 12px; }
.menu-toggle__lines i:last-child { top: 18px; right: 13px; }
.menu-open .menu-toggle__lines i:first-child { top: 15px; transform: rotate(45deg); }
.menu-open .menu-toggle__lines i:last-child { top: 15px; right: 9px; transform: rotate(-45deg); }

@media (min-width: 1240px) {
    .nav { display: flex; }
    .menu-toggle { display: none; }
}
@media (max-width: 560px) {
    .header-cta { display: none; }
    .logo__kr { display: none; }
    .site-header { padding-top: 12px; }
}

/* ---------- fullscreen menu ---------- */
.menu {
    position: fixed;
    inset: 0;
    z-index: 95;
    visibility: hidden;
    pointer-events: none;
}
.menu.is-open { visibility: visible; pointer-events: auto; }
.menu__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(70vmax 60vmax at 90% 0%, rgba(122, 10, 20, .8), transparent 60%),
        linear-gradient(180deg, #120709, var(--ink));
    clip-path: circle(0% at calc(100% - 60px) 38px);
}
.menu__inner {
    position: relative;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 40px;
    height: 100%;
    padding: calc(var(--header-h) + 40px) var(--gutter) 40px;
    max-width: 1600px;
    margin: 0 auto;
    overflow-y: auto;
}
.menu__list { display: flex; flex-direction: column; justify-content: center; }
.menu__link {
    display: flex;
    align-items: baseline;
    gap: 18px;
    padding: 4px 0;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
.menu__num { font-size: .75rem; font-weight: 700; color: var(--red-hot); letter-spacing: .12em; min-width: 24px; }
.menu__label {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: clamp(2rem, 4.6vh, 3.6rem);
    letter-spacing: -.045em;
    line-height: 1.1;
    transition: transform .5s var(--ease-out), color .3s;
}
.menu__kr { font-family: var(--f-kr); font-size: 1.1rem; color: var(--dim); opacity: 0; transform: translateX(-10px); transition: .4s var(--ease-out); }
.menu__link:hover .menu__label { transform: translateX(14px); color: var(--red-hot); }
.menu__link:hover .menu__kr { opacity: 1; transform: none; }
.menu__aside { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 12px; }
.menu__gamja { width: min(260px, 60%); filter: drop-shadow(0 30px 40px rgba(227, 24, 45, .35)); }
.menu__tag { font-family: var(--f-kr); font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; }
.menu__tag-en { color: var(--muted); }
.menu__socials { display: flex; gap: 10px; margin-top: 10px; }
.menu__socials a, .footer__socials a {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--line-2);
    font-size: 1.05rem;
    transition: background-color .3s, border-color .3s, transform .4s var(--ease-back);
}
.menu__socials a:hover, .footer__socials a:hover { background: var(--red); border-color: var(--red); transform: translateY(-3px); }
@media (max-width: 860px) {
    .menu__inner { grid-template-columns: 1fr; align-content: start; }
    .menu__aside { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .menu__gamja { width: 110px; }
    .menu__tag { font-size: 1.8rem; }
}

/* ---------- preloader ---------- */
.preloader {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: radial-gradient(50vmax 40vmax at 50% 55%, #1a0508, var(--ink) 70%);
}
html.no-js .preloader { display: none; }
.preloader__center { display: flex; flex-direction: column; align-items: center; text-align: center; }
/* transformed for the whole of the preloader's life, so promote it up front
   rather than letting the exit hop pay for the layer mid-animation */
.preloader__stage { position: relative; will-change: transform; }

/* Gamja himself loads in: he starts drained of colour and comes back to life
   as the assets land, so the artwork doubles as the progress bar. The two
   layers are the same file, so the colour pass costs no extra request. */
.preloader__potato { position: relative; width: clamp(148px, 23vw, 196px); }
.preloader__pose { display: block; width: 100%; }
.preloader__pose img { width: 100%; height: auto; }
.preloader__pose--dim { filter: grayscale(1) brightness(.74); opacity: .85; }
/* Colour washes up over the grey pass from his sneakers to his sprout. --wet is
   the height already reached; the 18% feather above it keeps the boundary soft
   instead of a hard waterline. It starts below the artwork so 0% is pure grey,
   and ends past the top so 100% lands on the untouched image. */
.preloader__pose--lit {
    position: absolute; inset: 0; --wet: -18%;
    filter: drop-shadow(0 4px 18px rgba(217, 162, 74, .28));
    -webkit-mask-image: linear-gradient(to top, #000 var(--wet), transparent calc(var(--wet) + 18%));
    mask-image: linear-gradient(to top, #000 var(--wet), transparent calc(var(--wet) + 18%));
}
.preloader__glow {
    position: absolute; left: 50%; bottom: -6%; width: 116%; height: 26%; transform: translateX(-50%);
    background: radial-gradient(closest-side, rgba(227, 24, 45, .42), transparent 72%);
    opacity: 0; filter: blur(3px);
}

/* the ground it is planted in doubles as the progress track */
.preloader__soil { position: relative; width: clamp(180px, 30vw, 240px); height: 3px; margin-top: 0; border-radius: 99px; background: rgba(122, 74, 34, .38); overflow: hidden; }
.preloader__soil-fill { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--red-deep), var(--gold-2), var(--red-deep)); box-shadow: 0 0 14px rgba(217, 162, 74, .7); transform: scaleX(0); transform-origin: 50% 50%; }
.preloader__count { margin-top: 24px; font-family: var(--f-display); font-weight: 800; font-size: clamp(2.5rem, 6.4vw, 4.2rem); letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.preloader__count sup { font-size: .35em; color: var(--red-hot); margin-left: 4px; vertical-align: top; position: relative; top: .3em; }
.preloader__words { position: relative; height: 1.4em; margin-top: 10px; font-family: var(--f-kr); font-size: 1.5rem; width: 100%; }
.preloader__words span { position: absolute; inset: 0; }
.preloader__words [data-preloader-word="b"] { opacity: 0; color: var(--red-hot); }
.preloader__hint { margin-top: 18px; font-size: .75rem; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }

/* ---------- cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 300; pointer-events: none; display: none; }
html.has-cursor .cursor { display: block; }
.cursor__dot, .cursor__ring { position: absolute; top: 0; left: 0; border-radius: 50%; will-change: transform; }
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--red-hot); box-shadow: 0 0 10px var(--red); }
.cursor__ring {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 1px solid rgba(244, 234, 216, .35);
    transition: width .45s var(--ease-out), height .45s var(--ease-out), margin .45s var(--ease-out), background-color .35s, border-color .35s;
}
.cursor__label { font-size: .62rem; font-weight: 800; letter-spacing: .16em; color: var(--cream); opacity: 0; transform: scale(.6); transition: .35s var(--ease-out); }
.cursor.is-link .cursor__ring { width: 58px; height: 58px; margin: -29px 0 0 -29px; border-color: var(--red); background: rgba(227, 24, 45, .1); }
.cursor.is-poke .cursor__ring, .cursor.is-drag .cursor__ring { width: 74px; height: 74px; margin: -37px 0 0 -37px; background: var(--red); border-color: var(--red); box-shadow: var(--glow); }
.cursor.is-poke .cursor__label, .cursor.is-drag .cursor__label { opacity: 1; transform: none; }
/* drag hovers readable card backs: keep the ring see-through */
.cursor.is-drag .cursor__ring { background: rgba(227, 24, 45, .12); border-color: var(--red-hot); box-shadow: 0 0 18px rgba(227, 24, 45, .35); backdrop-filter: none; }
.cursor.is-drag .cursor__label { color: var(--red-hot); text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }
.cursor.is-poke .cursor__dot, .cursor.is-drag .cursor__dot { opacity: 0; }
.cursor.is-down .cursor__ring { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
.cursor.is-hidden { opacity: 0; }

/* ---------- poke bubble (spawned by JS) ---------- */
.poke-bubble {
    position: fixed;
    z-index: 250;
    pointer-events: none;
    padding: 8px 14px;
    border-radius: 16px 16px 16px 4px;
    background: var(--cream);
    color: var(--ink);
    font-weight: 800;
    font-size: .9rem;
    white-space: nowrap;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6);
}
.poke-burst { position: fixed; z-index: 249; pointer-events: none; width: 10px; height: 10px; }
.poke-burst i { position: absolute; left: 0; top: 0; width: 10px; height: 10px; border-radius: 0 60% 0 60%; background: var(--sprout); }
.poke-burst i:nth-child(3n) { background: var(--red-hot); border-radius: 50%; width: 7px; height: 7px; }
.poke-burst i:nth-child(4n) { background: var(--gold-2); border-radius: 50%; width: 6px; height: 6px; }

/* ---------- companion ---------- */
.companion {
    position: fixed;
    left: max(14px, calc(var(--gutter) - 20px));
    bottom: 14px;
    z-index: 80;
    width: 96px;
    transform: translateY(160%);
    pointer-events: none;
}
.companion.is-visible { pointer-events: auto; }
.companion__body { position: relative; display: block; width: 100%; aspect-ratio: 5 / 7; }
.companion__pose { position: absolute; inset: auto 0 0 0; opacity: 0; transform-origin: 50% 100%; }
.companion__pose img { width: 100%; height: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55)); }
.companion__pose.is-active { opacity: 1; }
.companion__shadow { position: absolute; left: 18%; right: 18%; bottom: -4px; height: 10px; border-radius: 50%; background: radial-gradient(closest-side, rgba(227, 24, 45, .45), transparent); }
.companion__bubble {
    position: absolute;
    left: 70%;
    bottom: 88%;
    padding: 9px 14px;
    border-radius: 16px 16px 16px 4px;
    background: var(--cream);
    color: var(--ink);
    font-weight: 800;
    font-size: .85rem;
    white-space: nowrap;
    opacity: 0;
    transform-origin: 0% 100%;
    transform: scale(.6) translateY(6px);
    box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .7);
    pointer-events: none;
}
@media (max-width: 767px) {
    .companion { width: 66px; left: 10px; bottom: 10px; }
    .companion__bubble { font-size: .75rem; padding: 7px 11px; }
}

/* ---------- section index ---------- */
.section-index {
    position: fixed;
    right: 10px;
    top: 50%;
    z-index: 70;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transform: translateY(-50%);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--dim);
    font-variant-numeric: tabular-nums;
    opacity: 0;
    transition: opacity .5s;
}
.section-index.is-visible { opacity: 1; }
.section-index__num { color: var(--cream); }
.section-index__track { position: relative; width: 1px; height: 90px; background: var(--line-2); overflow: hidden; }
.section-index__track span { position: absolute; inset: 0; background: var(--red-hot); transform-origin: top; transform: scaleY(0); box-shadow: var(--glow-sm); }
.section-index__name { writing-mode: vertical-rl; text-transform: uppercase; letter-spacing: .24em; margin-top: 6px; color: var(--muted); }
@media (min-width: 1280px) { .section-index { display: flex; } }

/* ---------- toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 260;
    padding: 12px 20px;
    border-radius: 999px;
    background: var(--cream);
    color: var(--ink);
    font-weight: 800;
    font-size: .9rem;
    transform: translate(-50%, 160%);
    opacity: 0;
    visibility: hidden;
    transition: transform .6s var(--ease-back), opacity .3s, visibility .3s;
    pointer-events: none;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- "yet to confirm" marker ---------- */
/* Resets the inherited heading/label type so it reads the same wherever it sits. */
.tbc {
    display: inline-block;
    font-family: var(--f-body);
    font-size: .8rem;
    font-weight: 800;
    font-style: normal;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
    white-space: nowrap;
    vertical-align: middle;
    color: var(--red-hot);
}

/* ---------- form fields ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, fieldset legend { font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.field input {
    height: 54px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid var(--line-2);
    background: rgba(7, 5, 6, .6);
    font-weight: 600;
    transition: border-color .3s, box-shadow .3s;
}
.field input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(227, 24, 45, .15); }
fieldset { border: 0; }
