.sejongyang-page {
    --ink: #2d1714;
    --wine: #531d1d;
    --wine-deep: #321013;
    --red: #bc2b20;
    --gold: #dba93e;
    --gold-light: #f4d887;
    --paper: #fff8e8;
    --cream: #f7e9ca;
    --muted: #79655b;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 10%, rgba(219, 169, 62, 0.18), transparent 28rem),
        radial-gradient(circle at 88% 34%, rgba(188, 43, 32, 0.12), transparent 34rem),
        #f2e7d3;
    color: var(--ink);
}

.sejongyang-page .topnav {
    position: relative;
    z-index: 10;
}

.pet-main {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 56px 0 80px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
    gap: clamp(36px, 7vw, 92px);
    align-items: center;
    min-height: 620px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 14px;
    color: #97651c;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.sejongyang-page h1 {
    margin: 0;
    color: var(--wine-deep);
    font-family: ui-serif, Georgia, "AppleMyungjo", serif;
    font-size: clamp(5rem, 11vw, 8.4rem);
    font-weight: 760;
    line-height: 0.9;
    letter-spacing: -0.09em;
}

.lede {
    max-width: 650px;
    margin: 30px 0 0;
    color: #5b423a;
    font-family: ui-serif, Georgia, "AppleMyungjo", serif;
    font-size: clamp(1.2rem, 2.1vw, 1.65rem);
    line-height: 1.65;
    word-break: keep-all;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.badges li {
    padding: 7px 11px;
    border: 1px solid rgba(83, 29, 29, 0.17);
    border-radius: 999px;
    background: rgba(255, 248, 232, 0.6);
    color: #68443b;
    font-size: 0.8rem;
    font-weight: 700;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 32px;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0 20px;
    cursor: pointer;
    font: inherit;
    font-size: 0.94rem;
    font-weight: 750;
    text-decoration: none;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: var(--wine);
    color: #fff8e8;
    box-shadow: 0 12px 28px rgba(83, 29, 29, 0.18);
}

.button-primary:hover {
    background: #6a2420;
    color: #fff;
}

.button-secondary {
    border-color: rgba(83, 29, 29, 0.22);
    background: rgba(255, 248, 232, 0.7);
    color: var(--wine);
}

.microcopy {
    max-width: 580px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.55;
    word-break: keep-all;
}

.pet-demo {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(244, 216, 135, 0.34);
    border-radius: 38px;
    padding: 18px 18px 20px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.07), transparent 42%),
        linear-gradient(160deg, #641f20, var(--wine-deep));
    box-shadow: 0 26px 70px rgba(83, 29, 29, 0.22);
}

.pet-demo::before,
.pet-demo::after {
    position: absolute;
    border: 1px solid rgba(244, 216, 135, 0.13);
    border-radius: 50%;
    content: "";
}

.pet-demo::before {
    top: -90px;
    left: -110px;
    width: 250px;
    height: 250px;
}

.pet-demo::after {
    right: -80px;
    bottom: -110px;
    width: 250px;
    height: 250px;
}

.preview-toolbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #eddac7;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold-light);
    box-shadow: 0 0 0 5px rgba(244, 216, 135, 0.12);
}

.preview-state {
    margin-left: auto;
    color: var(--gold-light);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.76rem;
    letter-spacing: 0;
}

.sprite-stage {
    display: grid;
    min-height: 465px;
    place-items: center;
}

.pet-sprite {
    width: min(78%, 320px);
    aspect-ratio: 192 / 208;
    background-image: url("spritesheet.webp");
    background-position: 0 0;
    background-repeat: no-repeat;
    background-size: 800% 1100%;
    filter: drop-shadow(0 22px 18px rgba(0, 0, 0, 0.28));
    transform: translateZ(0);
}

.preview-note {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #c9aaa1;
    font-size: 0.78rem;
    text-align: center;
}

.mood-section {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 32px;
    margin: 62px 0 26px;
}

.sejongyang-page h2 {
    max-width: none;
    margin: 0;
    color: var(--wine-deep);
    font-family: ui-serif, Georgia, "AppleMyungjo", serif;
    font-size: clamp(1.8rem, 3.4vw, 2.8rem);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.045em;
}

.mood-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.mood-button {
    min-height: 40px;
    border: 1px solid rgba(83, 29, 29, 0.18);
    border-radius: 999px;
    padding: 0 14px;
    background: transparent;
    color: #72594f;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
}

.mood-button:hover,
.mood-button.is-active {
    border-color: var(--wine);
    background: var(--wine);
    color: #fff8e8;
}

.details {
    display: grid;
    grid-template-columns: 0.82fr 1.18fr;
    gap: 18px;
}

.story-card,
.install-card {
    border: 1px solid rgba(83, 29, 29, 0.12);
    border-radius: 28px;
    padding: clamp(26px, 4vw, 42px);
}

.story-card {
    background: rgba(255, 248, 232, 0.7);
}

.install-card {
    background: #f7e7bd;
}

.story-card > p:not(.section-kicker),
.install-card > p:not(.section-kicker) {
    margin: 20px 0 0;
    color: #6e554b;
    font-size: 1rem;
    line-height: 1.75;
    word-break: keep-all;
}

.text-link {
    display: inline-block;
    margin-top: 22px;
    color: #8d521b;
    font-weight: 750;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.prompt-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    margin-top: 24px;
    border: 1px solid rgba(83, 29, 29, 0.17);
    border-radius: 17px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.56);
}

.prompt-box code {
    overflow-wrap: anywhere;
    color: #5a3c35;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.6;
}

.copy-button {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--wine);
    color: #fff8e8;
    cursor: pointer;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 750;
    white-space: nowrap;
}

.file-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 18px;
}

.file-links a {
    color: #885225;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    text-underline-offset: 3px;
}

.pet-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid rgba(83, 29, 29, 0.1);
    padding: 22px 20px 28px;
    color: #79665b;
    font-size: 0.78rem;
}

.pet-footer a {
    color: #6d4941;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(219, 169, 62, 0.72);
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .hero-copy {
        padding-top: 10px;
    }

    .pet-demo {
        max-width: 560px;
        width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
    }

    .mood-section {
        display: block;
    }

    .mood-controls {
        justify-content: flex-start;
        margin-top: 22px;
    }
}

@media (max-width: 700px) {
    .pet-main {
        width: min(100% - 26px, 1160px);
        padding-top: 38px;
    }

    .sejongyang-page h1 {
        font-size: clamp(4.2rem, 22vw, 6rem);
    }

    .sprite-stage {
        min-height: 370px;
    }

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

    .prompt-box {
        grid-template-columns: 1fr;
    }

    .copy-button {
        justify-self: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .button {
        transition: none;
    }
}
