.g4-page {
    --g4-ink: #40374b;
    --g4-rose: #c85478;
    --g4-rose-dark: #a33c61;
    --g4-gold: #b99157;
    --g4-line: #eadbd7;
    color: var(--g4-ink);
    background: #fffbf7;
    font-size: 17px;
    line-height: 1.8;
    overflow-x: clip;
}

.g4-page::before {
    background:
        radial-gradient(ellipse at 8% 10%, #fce6e9 0, transparent 35%),
        radial-gradient(ellipse at 93% 38%, #fff1dc 0, transparent 38%),
        radial-gradient(ellipse at 10% 83%, #f6ebf2 0, transparent 35%);
}

.g4-page .mod-main, .g4-page .mod-footer { width: min(1280px, calc(100% - 64px)); }
.g4-page .mod-main { padding-top: 128px; }
.g4-page .mod-nav { background: #fffdf9ed; border-color: #fff; }
.g4-page .mod-nav-links .nav-active { background: #b95779; }
.g4-page .breadcrumb { color: #786c7b; margin-bottom: 18px; }
.g4-page a:focus-visible { outline-color: var(--g4-rose); }
.g4-page .mod-footer { margin-top: 20px; border-top: 1px solid var(--g4-line); }

.g4-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    align-items: center;
    gap: 40px;
    min-height: 710px;
    padding: 54px 60px;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid #eadbd0;
    border-radius: 30px;
    background:
        radial-gradient(circle at 96% 5%, #ffffff 0 5%, transparent 5.2%),
        radial-gradient(circle at 0 100%, #ffedeb 0, transparent 48%),
        linear-gradient(115deg, #fffdf9 13%, #fdf3ed 56%, #f2dfe3 100%);
    box-shadow: 0 19px 52px #9568771f;
}

.g4-hero::before, .g4-hero::after {
    content: "✿";
    position: absolute;
    z-index: -1;
    font-size: 145px;
    line-height: 1;
    color: #efb7bf65;
    pointer-events: none;
}
.g4-hero::before { top: -45px; left: -38px; transform: rotate(20deg); }
.g4-hero::after { right: -20px; bottom: -65px; color: #eecda07a; transform: rotate(-20deg); }
.g4-hero-copy { position: relative; z-index: 2; min-width: 0; }
.g4-kicker, .g4-label { color: var(--g4-rose-dark); font: 800 .78rem/1.5 Inter, sans-serif; letter-spacing: .16em; }
.g4-kicker { display: inline-flex; align-items: center; gap: 10px; padding: 7px 15px; border-radius: 30px; color: white; background: #b95678; letter-spacing: .1em; }
.g4-kicker span { color: #fff0b8; }
.g4-japanese-title { margin-top: 23px; color: #493a4a; font: 700 clamp(1.95rem, 3vw, 2.95rem)/1.44 "Noto Sans JP", sans-serif; letter-spacing: -.055em; text-wrap: balance; }
.g4-japanese-title span { font-size: .76em; white-space: nowrap; }
.g4-english-title { margin-top: 13px; color: #7a7184; font: 700 .95rem/1.6 Inter, sans-serif; }
.g4-english-title strong { color: #c85379; }
.g4-hero h1 { margin-top: 29px; color: #654e63; font-size: clamp(2.55rem, 4vw, 4.2rem); font-weight: 800; line-height: 1.25; letter-spacing: -.065em; text-wrap: balance; }
.g4-hero h1 em { color: #d04c78; font-style: normal; }
.g4-hero-intro { max-width: 590px; margin-top: 20px; color: #655c6a; font-size: 1.07rem; }
.g4-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.g4-button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 49px; padding: 11px 23px; border: 1px solid #c34c72; border-radius: 12px; color: #fff; background: #ca5479; box-shadow: 0 8px 18px #bc587b38; text-decoration: none; font-size: .97rem; font-weight: 800; line-height: 1.4; transition: transform .2s ease, box-shadow .2s ease; }
.g4-button:hover { transform: translateY(-2px); color: white; box-shadow: 0 12px 22px #bc587b48; }
.g4-button--outline { border-color: #d4aab5; color: #a33c61; background: #fffdf9; box-shadow: none; }
.g4-button--outline:hover { color: #a33c61; box-shadow: 0 8px 18px #bc587b26; }
.g4-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.g4-hero-tags span { padding: 4px 12px; border: 1px solid #dfc7c7; border-radius: 8px; background: #fffdf9c9; color: #8e5971; font: 700 .79rem/1.5 Inter, sans-serif; }
.g4-hero-art { position: relative; justify-self: center; width: min(100%, 480px); min-width: 0; }
.g4-hero-print { width: 100%; padding: 12px 12px 26px; border: 1px solid #f0e3dc; background: #fff; box-shadow: 0 22px 35px #6b526140; transform: rotate(2deg); }
.g4-hero-print img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; }
.g4-hero-seal { position: absolute; top: -29px; right: -30px; display: grid; place-content: center; width: 116px; height: 116px; border: 3px double #ba9169; border-radius: 50%; background: #fffdf4f2; color: #ab6b78; text-align: center; font: 800 .77rem/1.3 Inter, sans-serif; letter-spacing: .07em; transform: rotate(13deg); box-shadow: 0 5px 18px #6b526127; }
.g4-hero-note { position: absolute; right: 2px; bottom: -40px; color: #b15c7d; font: 600 1.7rem/1 Caveat, cursive; transform: rotate(-6deg); }

.g4-page .g4-chapters { margin: 30px auto 68px; gap: 0; border: 1px solid #ecdfd9; background: #fffdf9ed; }
.g4-page .g4-chapters a { padding-inline: 17px; color: #756a7a; font-size: .86rem; }
.g4-page .g4-chapters a:hover, .g4-page .g4-chapters a[aria-current] { color: #bb466f; border-bottom-color: #bb466f; }
.g4-section { position: relative; margin-bottom: 86px; scroll-margin-top: 166px; }
.g4-section-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 27px; padding-bottom: 18px; border-bottom: 1px solid #dfcabc; }
.g4-section-head h2 { margin-top: 8px; color: #5a455b; font-size: clamp(1.85rem, 3vw, 2.7rem); font-weight: 800; line-height: 1.3; letter-spacing: -.04em; text-wrap: balance; }
.g4-section-head h2 span { color: #cc527a; }
.g4-section-head > p { max-width: 415px; color: #746c76; font-size: .99rem; }
.g4-section-head a { color: #b74f74; font-weight: 700; }
.g4-story-intro { max-width: 920px; margin: 0 auto 26px; color: #675e69; text-align: center; font-size: 1.08rem; }
.g4-story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.g4-story-card { min-width: 0; overflow: hidden; border: 1px solid #eadbd5; border-radius: 21px; background: #fffdf9; box-shadow: 0 10px 28px #7f536214; }
.g4-story-card figure { height: 225px; overflow: hidden; background: #f0e9e6; }
.g4-story-card img { width: 100%; height: 100%; object-fit: cover; }
.g4-story-card:first-child img { object-position: center; }
.g4-story-card:last-child img { object-position: center 25%; }
.g4-story-card > div { padding: 21px 23px 27px; }
.g4-story-card span, .g4-route span { color: #af7a83; font: 800 .7rem/1.5 Inter, sans-serif; letter-spacing: .12em; }
.g4-story-card h3 { margin-top: 7px; color: #65475b; font-size: 1.35rem; }
.g4-story-card p { margin-top: 7px; color: #6c6470; font-size: .97rem; line-height: 1.7; }

.g4-route-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }
.g4-route { min-width: 0; overflow: hidden; border: 1px solid #e7d2d2; border-radius: 18px; background: #fffdf8; box-shadow: 0 9px 24px #7f536214; }
.g4-route img { width: 100%; height: auto; aspect-ratio: 410 / 610; object-fit: cover; object-position: center top; }
.g4-route > div { min-height: 195px; padding: 17px 17px 22px; }
.g4-route h3 { margin: 7px 0 5px; color: #5b4760; font-size: 1.45rem; }
.g4-route p { color: #655f6c; font-size: .94rem; line-height: 1.67; }
.g4-route--ichika { background: #fff9eb; }
.g4-route--nino { background: #fef2f6; }
.g4-route--miku { background: #f0f6fb; }
.g4-route--yotsuba { background: #f4faee; }
.g4-route--itsuki { background: #fff3ef; }

.g4-together { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 30px; padding: 34px; border: 1px solid #ead5d3; border-radius: 23px; background: linear-gradient(120deg, #fffaf4, #fef0ee); box-shadow: 0 12px 30px #7f536215; }
.g4-together-copy { padding: 10px 16px; }
.g4-ticket { color: #b44c70; font: 800 .74rem/1.5 Inter, sans-serif; letter-spacing: .15em; }
.g4-together h3 { margin: 12px 0 17px; color: #60465b; font-size: clamp(1.6rem, 2.4vw, 2.25rem); line-height: 1.35; }
.g4-together-copy > p:not(.g4-quote) { margin-top: 15px; color: #655d69; }
.g4-quote { margin-top: 24px; padding-left: 17px; border-left: 3px solid #d993ab; color: #ad466c; font-size: 1.12rem; font-weight: 800; }
.g4-together figure { padding: 10px 10px 14px; background: #fff; box-shadow: 0 11px 27px #6b52612e; transform: rotate(1.2deg); }
.g4-together figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.g4-together figcaption { padding-top: 7px; color: #a96a81; text-align: center; font: 600 1.3rem Caveat, cursive; }
.g4-extra { display: grid; grid-template-columns: 1.04fr .96fr; align-items: center; gap: 28px; margin-top: 19px; padding: 17px; border: 1px solid #eadbd5; border-radius: 23px; background: #fffdf9; }
.g4-extra img { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; object-fit: cover; }
.g4-extra > div { padding: 14px; }
.g4-extra h3 { margin: 9px 0; color: #60465b; font-size: 1.5rem; }
.g4-extra p { color: #655d69; }

.g4-screenshot-frame { padding: 18px; border: 1px solid #e5d7d2; border-radius: 24px; background: #fcf7f3; }
.g4-screenshot-track { scrollbar-color: #d7a5b7 #f3e9e5; }
.g4-screenshot-track .screenshot-item { flex-basis: min(68vw, 420px); }
.g4-screenshot-frame .screenshot-card { border: 6px solid #fff; border-radius: 7px; box-shadow: 0 9px 18px #6551611c; }
.g4-screenshot-frame .screenshot-card img { aspect-ratio: 16 / 9; object-fit: cover; background: #f4e9e5; }
.g4-screenshot-frame .screenshot-caption { color: #755b68; font-weight: 700; }
.g4-screenshot-frame .screenshot-caption > :last-child { color: #b34e72; }
.g4-page .gallery-button { color: #a94469; border-color: #dfc3b4; }
.g4-page .screenshot-lightbox { background: #fffaf5; border-color: #dfc3a4; }

.g4-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.g4-info-card { min-width: 0; padding: 32px 34px; border: 1px solid #e9d8d2; border-radius: 22px; background: #fffdf9; box-shadow: 0 9px 25px #7f536210; }
.g4-info-card h3 { margin-bottom: 17px; color: #63465b; font-size: 1.52rem; }
.g4-info-card dl { margin: 0; }
.g4-info-card dl > div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid #f0e5e1; }
.g4-info-card dt { color: #766b75; }
.g4-info-card dd { margin: 0; color: #5e475a; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.g4-info-card code { font: 700 .86rem/1.6 Inter, monospace; overflow-wrap: anywhere; }
.g4-info-note { margin-top: 18px; color: #a34567; font-size: .94rem; font-weight: 700; }
.g4-install-card { background: #fdf1f0; scroll-margin-top: 165px; }
.g4-install-card ol { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.g4-install-card li { display: flex; align-items: flex-start; gap: 14px; }
.g4-install-card li > span { flex: 0 0 34px; display: grid; place-items: center; height: 34px; border-radius: 50%; background: #c85d7d; color: white; font: 800 .72rem Inter, sans-serif; }
.g4-install-card li p { color: #675e69; }
.g4-install-card li strong { color: #60465b; }
.g4-install-path { display: block; margin-top: 23px; padding: 13px 14px; border: 1px solid #e6cfce; border-radius: 11px; background: white; color: #8e4665; font: 700 .77rem/1.6 Inter, monospace; overflow-wrap: anywhere; }

.g4-download { min-height: 276px; margin-bottom: 0; padding: 50px 55px; overflow: hidden; border: 1px solid #ead4d0; border-radius: 25px; background: radial-gradient(circle at 93% 18%, #fff 0 4%, transparent 4.2%), linear-gradient(105deg, #fffdf7, #f9e7e7 68%, #f0d9e1); box-shadow: 0 12px 28px #7f536219; }
.g4-download::after { content: "✿"; position: absolute; right: 20px; bottom: -58px; color: #efb8c073; font-size: 215px; line-height: 1; transform: rotate(-20deg); pointer-events: none; }
.g4-download > div { position: relative; z-index: 1; max-width: 760px; }
.g4-download h2 { margin: 7px 0; color: #62475d; font-size: clamp(1.85rem, 3vw, 2.55rem); letter-spacing: -.04em; }
.g4-download p:not(.g4-label) { color: #6c616d; }
.g4-download .g4-button { margin-top: 21px; }
.g4-download-help { margin-top: 10px; font-size: .88rem; }
.g4-download-note { position: absolute; z-index: 1; right: 38px; bottom: 20px; color: #b76585; font: 600 1.6rem Caveat, cursive; transform: rotate(-5deg); }

@media (max-width: 1050px) {
    .g4-hero { grid-template-columns: 1fr 1fr; gap: 28px; padding: 44px; }
    .g4-japanese-title { font-size: clamp(1.65rem, 2.8vw, 2.4rem); }
    .g4-route-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .g4-route > div { min-height: 160px; }
}

@media (max-width: 760px) {
    .g4-page { font-size: 16px; }
    .g4-page .mod-main, .g4-page .mod-footer { width: calc(100% - 32px); }
    .g4-page .mod-main { padding-top: 155px; }
    .g4-hero { grid-template-columns: 1fr; gap: 42px; padding: 36px 30px 56px; }
    .g4-hero-copy { max-width: 630px; }
    .g4-japanese-title { font-size: clamp(1.9rem, 5.6vw, 2.8rem); }
    .g4-hero h1 { font-size: clamp(2.45rem, 6.8vw, 3.65rem); }
    .g4-hero-art { width: min(85%, 430px); }
    .g4-page .g4-chapters { justify-content: flex-start; width: 100%; margin-bottom: 58px; overflow-x: auto; white-space: nowrap; }
    .g4-page .g4-chapters a { flex: 0 0 auto; }
    .g4-section { margin-bottom: 70px; }
    .g4-section-head { display: block; }
    .g4-section-head > p { max-width: 630px; margin-top: 10px; }
    .g4-story-grid { grid-template-columns: 1fr; gap: 14px; }
    .g4-story-card { display: grid; grid-template-columns: 43% 57%; }
    .g4-story-card figure { height: 100%; min-height: 195px; }
    .g4-story-card > div { align-self: center; }
    .g4-route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g4-route > div { min-height: 170px; }
    .g4-together { grid-template-columns: 1fr; }
    .g4-extra { grid-template-columns: 1fr; }
    .g4-info-grid { grid-template-columns: 1fr; }
    .g4-screenshot-track .screenshot-item { flex-basis: min(78vw, 390px); }
}

@media (max-width: 560px) {
    .g4-page .mod-main { padding-top: 160px; }
    .g4-hero { padding: 28px 20px 52px; border-radius: 22px; }
    .g4-japanese-title { font-size: clamp(1.56rem, 7.7vw, 2.1rem); }
    .g4-japanese-title span { white-space: normal; font-size: .82em; }
    .g4-english-title { font-size: .82rem; }
    .g4-hero h1 { font-size: clamp(2.15rem, 9vw, 3rem); }
    .g4-hero-intro { font-size: 1rem; }
    .g4-hero-art { width: min(82%, 340px); }
    .g4-hero-print { padding: 7px 7px 20px; }
    .g4-hero-seal { top: -25px; right: -15px; width: 80px; height: 80px; font-size: .51rem; }
    .g4-hero-note { right: -12px; bottom: -29px; font-size: 1.3rem; }
    .g4-page .g4-chapters { top: 128px; padding: 3px; }
    .g4-page .g4-chapters a { padding: 10px 13px; font-size: .78rem; }
    .g4-section, .g4-install-card { scroll-margin-top: 192px; }
    .g4-section-head h2 { font-size: clamp(1.7rem, 7vw, 2.15rem); }
    .g4-story-intro { text-align: left; font-size: 1rem; }
    .g4-story-card { grid-template-columns: 1fr; }
    .g4-story-card figure { height: 195px; min-height: 0; }
    .g4-story-card > div { padding: 17px 19px 21px; }
    .g4-route-grid { grid-template-columns: 1fr; gap: 12px; }
    .g4-route { display: grid; grid-template-columns: 41% 59%; }
    .g4-route img { height: 100%; min-height: 190px; aspect-ratio: auto; }
    .g4-route > div { align-self: center; min-height: 0; padding: 14px; }
    .g4-route h3 { font-size: 1.27rem; }
    .g4-route p { font-size: .9rem; }
    .g4-together { padding: 20px; }
    .g4-together-copy { padding: 2px; }
    .g4-extra { padding: 12px; }
    .g4-info-card { padding: 25px 21px; }
    .g4-info-card dl > div { display: block; }
    .g4-info-card dd { margin-top: 2px; text-align: left; }
    .g4-screenshot-frame { padding: 10px; }
    .g4-screenshot-track .screenshot-item { flex-basis: 88%; }
    .g4-download { padding: 38px 25px 66px; }
    .g4-download-note { right: 20px; bottom: 17px; font-size: 1.3rem; }
}

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

/* Wedding invitation artwork: paper, folded envelope, florals and gold details. */
.g4-page {
    --g4-rose: #c94269;
    --g4-rose-dark: #a9355d;
    --g4-gold: #bd925c;
    --g4-line: #e5d0b7;
    background-color: #fffaf3;
    background-image:
        radial-gradient(#caaa8918 .6px, transparent .8px),
        radial-gradient(ellipse at 5% 13%, #f8e0d9 0, transparent 30%),
        radial-gradient(ellipse at 95% 58%, #fce9e3 0, transparent 29%);
    background-size: 10px 10px, auto, auto;
}
.g4-page::before {
    background:
        linear-gradient(90deg, #f4c8bd29, transparent 12%, transparent 88%, #f4c8bd29),
        radial-gradient(ellipse at 12% 7%, #ffffff8c, transparent 36%);
}
.g4-page .mod-nav { border: 1px solid #e8d7cb; box-shadow: 0 7px 28px #88645219; }
.g4-page .mod-nav-links .nav-active { background: #c64e73; }
.g4-page .breadcrumb { color: #8f7377; }

.g4-hero {
    min-height: 745px;
    gap: 26px;
    padding: 64px 70px 76px;
    border: 1px solid #ddc4a5;
    border-radius: 10px;
    background:
        radial-gradient(ellipse at 86% 10%, #fff9f2, transparent 34%),
        radial-gradient(ellipse at 8% 95%, #fce5dc, transparent 45%),
        linear-gradient(128deg, #fffefb 0%, #fffaf1 56%, #fbeee6 100%);
    box-shadow: 0 20px 48px #8d675322, inset 0 0 0 9px #fff9f2, inset 0 0 0 10px #d9ba9566;
}
.g4-hero::before, .g4-hero::after {
    content: "";
    position: absolute;
    z-index: 2;
    width: min(34vw, 440px);
    height: min(34vw, 440px);
    background: url('/mod-fansub/gotoubun4/img/web/floral-corner.webp') left top / contain no-repeat;
    pointer-events: none;
    opacity: .9;
}
.g4-hero::before { top: -55px; left: -60px; transform: scale(.73); transform-origin: top left; }
.g4-hero::after { right: -64px; bottom: -65px; transform: rotate(180deg) scale(.83); transform-origin: center; }
.g4-envelope-fold {
    position: absolute;
    z-index: 0;
    inset: auto 0 0;
    height: 48%;
    overflow: hidden;
    background: linear-gradient(0deg, #f7e4d6b5, #fffdf04d);
    clip-path: polygon(0 18%, 50% 73%, 100% 18%, 100% 100%, 0 100%);
    pointer-events: none;
}
.g4-envelope-fold::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -47%;
    width: 106%;
    height: 112%;
    border: 2px solid #caa47470;
    background: linear-gradient(175deg, #fffdf9, #fff8ee);
    box-shadow: 0 3px 11px #a777521f;
    transform: translateX(-50%) rotate(45deg) scale(.72);
}
.g4-wax-seal {
    position: absolute;
    z-index: 1;
    top: 55%;
    left: 46%;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 5px double #e9b1a7;
    border-radius: 50%;
    color: #ffe8d7;
    background: radial-gradient(circle at 32% 28%, #e9949f, #bb5267 72%);
    font-size: 27px;
    box-shadow: 0 5px 13px #935a4d4a;
}
.g4-wedding-rings, .g4-wedding-rings::after {
    position: absolute;
    display: block;
    width: 42px;
    height: 42px;
    border: 5px solid #cda45d;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px #fff4cd, 0 3px 4px #75563d2e;
}
.g4-wedding-rings { right: 13%; bottom: 12%; transform: rotate(-18deg); }
.g4-wedding-rings::after { content: ""; left: 23px; top: -8px; transform: rotate(26deg); }
.g4-hero-copy, .g4-hero-art { z-index: 3; }
.g4-kicker {
    border: 1px solid #dab7a5;
    color: #a23d60;
    background: #fffaf0e8;
    box-shadow: 0 3px 8px #94745712;
}
.g4-kicker span { color: #bb8a49; }
.g4-japanese-title {
    margin-top: 25px;
    color: #3d3038;
    font-family: "Noto Serif JP", serif;
    font-size: clamp(2rem, 3.5vw, 3.6rem);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .015em;
    text-shadow: 0 2px 1px #ffffff;
}
.g4-japanese-title span { color: #aa405b; font-size: .67em; letter-spacing: .02em; }
.g4-english-title {
    margin-top: 13px;
    color: #9c6578;
    font: 600 1.55rem/1.1 Caveat, cursive;
}
.g4-english-title strong { color: #b44a6c; font-weight: 600; }
.g4-hero h1 {
    margin-top: 31px;
    color: #bd3f68;
    font-family: "Noto Serif Thai", Georgia, serif;
    font-size: clamp(2.6rem, 4.1vw, 4.6rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -.05em;
}
.g4-hero h1 em { color: #cf4e73; }
.g4-mobile-break { display: none; }
.g4-hero-intro { max-width: 520px; color: #655259; font-size: 1.06rem; }
.g4-button { border-radius: 999px; background: linear-gradient(135deg, #dc6988, #bd4269); }
.g4-button--outline { border-color: #cfa99c; color: #a23d60; background: #fff9f4e8; }
.g4-hero-tags span { border-color: #d9b8a7; border-radius: 999px; background: #fff9f2; color: #9b5470; }
.g4-hero-print {
    position: relative;
    padding: 13px;
    border: 5px solid #cba66d;
    outline: 2px solid #f7e4bb;
    outline-offset: -12px;
    background: #fff9ef;
    box-shadow: 0 16px 35px #78503e45, 0 0 0 9px #fff6e8;
    transform: rotate(1.2deg);
}
.g4-hero-print img { border: 1px solid #cba66d; }
.g4-hero-seal { top: -46px; right: -30px; border-color: #cba66d; background: #fffaf0; color: #b45977; }
.g4-hero-note { color: #b04b70; }

.g4-page .g4-chapters {
    margin-top: 18px;
    border: 1px solid #e3ccaf;
    border-radius: 999px;
    background: #fffdf8f0;
    box-shadow: 0 7px 20px #a279541b;
}
.g4-page .g4-chapters a { color: #84636d; }
.g4-section { isolation: isolate; }
.g4-section:not(.g4-download)::after {
    content: "";
    position: absolute;
    z-index: -1;
    right: -65px;
    bottom: -52px;
    width: 210px;
    height: 210px;
    background: url('/mod-fansub/gotoubun4/img/web/floral-corner.webp') left top / contain no-repeat;
    opacity: .28;
    transform: rotate(180deg);
    pointer-events: none;
}
.g4-section-head {
    position: relative;
    align-items: center;
    min-height: 105px;
    padding-left: 92px;
    padding-bottom: 14px;
    border-bottom: 1px solid #d9bb94;
}
.g4-section-head::before {
    position: absolute;
    left: 0;
    top: -13px;
    color: #c88772;
    font: 400 clamp(4.5rem, 6vw, 6rem)/1 Georgia, serif;
    letter-spacing: -.08em;
}
#story .g4-section-head::before { content: "01"; }
#routes .g4-section-head::before { content: "02"; }
#together .g4-section-head::before { content: "03"; }
#screenshots .g4-section-head::before { content: "04"; }
#about-mod .g4-section-head::before { content: "05"; }
.g4-label { color: #ba5274; font-size: .72rem; letter-spacing: .2em; }
.g4-section-head h2 {
    margin-top: 0;
    color: #bd3e67;
    font-family: "Noto Serif Thai", Georgia, serif;
    font-size: clamp(2rem, 3vw, 3.2rem);
    font-weight: 600;
    line-height: 1.3;
}
.g4-section-head h2 span { color: #bd3e67; }
.g4-section-head > p { color: #735d65; }
.g4-story-intro { margin: 2px 0 36px; text-align: left; }
.g4-story-grid { gap: 32px; }
.g4-story-card {
    position: relative;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.g4-story-card:not(:last-child)::after {
    content: "➜";
    position: absolute;
    z-index: 2;
    top: 95px;
    right: -33px;
    color: #b88c56;
    font: 36px/1 Georgia, serif;
}
.g4-story-card figure {
    height: 230px;
    padding: 6px;
    border: 1px solid #d6b68c;
    background: #fffdf9;
    box-shadow: 0 7px 18px #725b482e;
}
.g4-story-card img { border: 1px solid #ead8c1; }
.g4-story-card > div { position: relative; padding: 29px 10px 5px; }
.g4-story-card > div::before {
    content: "✿";
    position: absolute;
    top: -22px;
    left: 12px;
    display: grid;
    place-items: center;
    width: 41px;
    height: 41px;
    border: 2px solid #cba66d;
    border-radius: 50%;
    color: #ad667a;
    background: #fff9e9;
    box-shadow: 0 3px 8px #6b526127;
    font-size: 22px;
}
.g4-story-card h3 { color: #b54067; font-family: "Noto Serif Thai", Georgia, serif; font-weight: 600; }
.g4-story-card p { color: #64565c; }

.g4-route-grid { gap: 10px; }
.g4-route { border: 1px solid #d9bda4; border-radius: 7px; box-shadow: 0 7px 18px #79554725; }
.g4-route img { aspect-ratio: 410 / 615; border-bottom: 1px solid #e1c2aa; }
.g4-route > div { padding: 17px 13px 21px; text-align: center; }
.g4-route h3 { color: #b64669; font-family: "Noto Serif Thai", Georgia, serif; font-weight: 600; }
.g4-route p { color: #65565c; }

.g4-together {
    border-color: #dfc3a4;
    border-radius: 5px;
    background: #fffaf3;
    box-shadow: 0 9px 25px #79554717, inset 0 0 0 7px #fffef8;
}
.g4-together h3, .g4-extra h3 { color: #bd3e67; font-family: "Noto Serif Thai", Georgia, serif; font-weight: 600; }
.g4-together figure, .g4-extra img { border: 7px solid #fff; box-shadow: 0 10px 27px #6b52612d; }
.g4-extra { border-color: #dfc3a4; border-radius: 5px; background: #fffaf3; box-shadow: 0 8px 23px #79554716; }
.g4-extra img { border-radius: 0; transform: rotate(-1deg); }
.g4-screenshot-frame { border-color: #dfc3a4; border-radius: 5px; background: #fffdf8; box-shadow: inset 0 0 0 7px #fff4e9; }
.g4-screenshot-frame .screenshot-card { border-color: #fffaf5; border-radius: 3px; }
.g4-info-card { border-color: #e0c4aa; border-radius: 5px; box-shadow: 0 7px 20px #79554716; }
.g4-info-card:first-child { background: #fff8f6; }
.g4-install-card { background: #f3f8fc; }
.g4-info-card h3 { color: #bd3e67; font-family: "Noto Serif Thai", Georgia, serif; font-weight: 600; }
.g4-install-card h3 { color: #4d79a0; }

.g4-download {
    min-height: 345px;
    padding: 52px 55px 60px;
    border: 1px solid #d2ac80;
    border-radius: 6px;
    background: linear-gradient(170deg, #fffdf8 0%, #fff9ef 55%, #f4dccd 100%);
    box-shadow: 0 12px 30px #79554727, inset 0 0 0 8px #fffaf1;
    text-align: center;
}
.g4-download::before, .g4-download::after {
    content: "";
    position: absolute;
    z-index: 2;
    bottom: -37px;
    width: 275px;
    height: 275px;
    background: url('/mod-fansub/gotoubun4/img/web/floral-corner.webp') left top / contain no-repeat;
    opacity: .96;
    pointer-events: none;
}
.g4-download::before { left: -38px; transform: rotate(-90deg); }
.g4-download::after { right: -38px; transform: rotate(180deg); }
.g4-download-fold {
    position: absolute;
    inset: 0;
    background: linear-gradient(24deg, transparent 47.8%, #d5ae7e55 48%, transparent 48.2%), linear-gradient(-24deg, transparent 47.8%, #d5ae7e55 48%, transparent 48.2%);
    opacity: .7;
    pointer-events: none;
}
.g4-download > div { margin-inline: auto; }
.g4-download h2 { color: #b76545; font-family: "Noto Serif Thai", Georgia, serif; font-weight: 600; }
.g4-download .g4-label { color: #b34869; }
.g4-download-note { right: 50%; bottom: 16px; width: max-content; transform: translateX(50%) rotate(-3deg); }

@media (max-width: 1050px) {
    .g4-hero { min-height: 660px; padding: 52px 46px 65px; }
    .g4-hero::before, .g4-hero::after { width: 330px; height: 330px; }
    .g4-japanese-title { font-size: clamp(1.8rem, 3.3vw, 3rem); }
    .g4-hero h1 { font-size: clamp(2.3rem, 4vw, 3.6rem); }
    .g4-section:not(.g4-download)::after { right: 0; }
}
@media (max-width: 760px) {
    .g4-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 52px; padding: 46px 40px 65px; }
    .g4-hero::before { top: -15px; left: -27px; transform: scale(.6); }
    .g4-hero::after { right: -60px; bottom: -70px; transform: rotate(180deg) scale(.65); }
    .g4-envelope-fold { height: 39%; }
    .g4-hero-art { width: min(76%, 430px); }
    .g4-section-head { display: block; min-height: 0; padding-left: 82px; }
    .g4-section-head::before { top: -7px; font-size: 4.3rem; }
    .g4-story-grid { gap: 22px; }
    .g4-story-card { display: block; }
    .g4-story-card:not(:last-child)::after { content: none; }
    .g4-story-card figure { height: auto; aspect-ratio: 16 / 9; }
    .g4-route-grid { gap: 12px; }
}
@media (max-width: 560px) {
    .g4-hero { padding: 39px 23px 63px; }
    .g4-hero::before { left: -40px; top: -45px; transform: scale(.48); }
    .g4-hero::after { right: -70px; bottom: -84px; transform: rotate(180deg) scale(.52); }
    .g4-japanese-title { font-size: clamp(1.65rem, 7.2vw, 2.2rem); }
    .g4-english-title { font-size: 1.2rem; }
    .g4-hero h1 { font-size: clamp(2.12rem, 8vw, 3rem); overflow-wrap: anywhere; }
    .g4-mobile-break { display: initial; }
    .g4-hero-intro { overflow-wrap: anywhere; }
    .g4-hero-art { width: min(83%, 340px); }
    .g4-wax-seal { width: 46px; height: 46px; font-size: 19px; }
    .g4-wedding-rings { right: 12%; bottom: 8%; transform: scale(.7) rotate(-18deg); }
    .g4-section-head { padding-left: 59px; }
    .g4-section-head::before { top: -3px; font-size: 3.25rem; }
    .g4-section-head h2 { font-size: clamp(1.7rem, 6.8vw, 2.2rem); }
    .g4-story-card figure { height: auto; }
    .g4-story-card > div { padding: 27px 7px 8px; }
    .g4-route { display: grid; grid-template-columns: 41% 59%; }
    .g4-route img { height: 100%; min-height: 190px; aspect-ratio: auto; }
    .g4-route > div { text-align: left; }
    .g4-download { padding: 42px 24px 83px; }
    .g4-download::before, .g4-download::after { width: 145px; height: 145px; bottom: -18px; opacity: .75; }
    .g4-download::before { left: -30px; }
    .g4-download::after { right: -30px; }
    .g4-download-note { bottom: 12px; }
}

/* Give chapter numerals their own column so they never sit on the titles. */
.g4-section-head {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) minmax(260px, 395px);
    align-items: start;
    column-gap: 24px;
    min-height: 0;
    padding-left: 0;
}
.g4-section-head::before {
    position: static;
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    margin-top: 14px;
    font-size: 5.25rem;
    line-height: 1;
}
.g4-section-head > div { grid-column: 2; grid-row: 1; min-width: 0; }
.g4-section-head > p { grid-column: 3; grid-row: 1; align-self: center; margin: 0; }

/* Thai headings remain relaxed and legible alongside the body text. */
.g4-page {
    --g4-heading-font: "Noto Sans Thai", sans-serif;
}
.g4-hero h1,
.g4-section-head h2,
.g4-story-card h3,
.g4-route h3,
.g4-together h3,
.g4-extra h3,
.g4-info-card h3,
.g4-download h2 {
    font-family: var(--g4-heading-font);
    font-weight: 700;
    font-style: normal;
    letter-spacing: -.045em;
}
.g4-hero h1, .g4-section-head h2 { font-weight: 600; }
.g4-section-head h2 { line-height: 1.5; }

@media (min-width: 1051px) {
    .g4-hero h1 { font-size: clamp(2.35rem, 3.5vw, 3.75rem); }
}

@media (max-width: 1050px) {
    .g4-section-head { grid-template-columns: 80px minmax(0, 1fr); column-gap: 20px; }
    .g4-section-head::before { font-size: 4.3rem; }
    .g4-section-head > p { grid-column: 2; grid-row: 2; max-width: 650px; margin-top: 7px; }
}
@media (max-width: 760px) {
    .g4-section-head { display: grid; padding-left: 0; }
}
@media (max-width: 560px) {
    .g4-section-head { grid-template-columns: 60px minmax(0, 1fr); column-gap: 12px; }
    .g4-section-head::before { margin-top: 16px; font-size: 3.25rem; }
    .g4-section-head h2 { font-size: clamp(1.55rem, 6.5vw, 2.05rem); }
}
