:root {
    --navy: #071b36;
    --blue: #145bd4;
    --cyan: #71e0ed;
    --paper: #f2f6fa;
    --ink: #172a42;
    --muted: #52647b
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Tahoma, "Noto Sans Thai", Arial, sans-serif;
    line-height: 1.9
}

a {
    color: var(--blue);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 3px solid #00b4d3;
    outline-offset: 5px
}

header {
    background: var(--navy);
    border-bottom: 1px solid #244362
}

.header-wrap {
    max-width: 1300px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 21px 40px
}

.header-wrap img,
footer img {
    display: block;
    max-width: 100%;
    height: auto
}

.header-link {
    color: #c2e4ff;
    font-size: 14px
}

.header-link span {
    margin-left: 18px
}

.img-fit{
    display: block;
    max-width: 100%;
    height: auto;
}

.progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--cyan);
    z-index: 20
}

.hero {
    background: var(--navy);
    color: white;
    position: relative;
    overflow: hidden
}

.hero-inner {
    max-width: 1300px;
    margin: auto;
    padding: 42px 40px 72px;
    position: relative
}

.breadcrumb {
    font-size: 12px;
    color: #9cbdd9;
    display: flex;
    gap: 14px;
    align-items: center
}

.breadcrumb a {
    color: var(--cyan)
}

h1 {
    font-size: clamp(28px, 3.3vw, 48px);
    line-height: 1.5;
    font-weight: 700;
    max-width: 960px;
    margin: 30px 0 28px;
    letter-spacing: -.5px
}

.intro {
    max-width: 940px;
    color: #cfdeed;
    font-size: 16px;
    position: relative;
    z-index: 1
}

.intro p {
    margin: 14px 0
}

.hero-decoration {
    position: absolute;
    right: -135px;
    bottom: -175px;
    width: 430px;
    height: 430px;
    transform: rotate(-22deg);
    opacity: .2;
    pointer-events: none
}

.hero-decoration span {
    position: absolute;
    inset: 0;
    border: 1px solid var(--cyan);
    border-radius: 90px
}

.hero-decoration span:nth-child(2) {
    inset: 45px
}

.hero-decoration span:nth-child(3) {
    inset: 90px;
    background: #145bd4
}

.reading-layout {
    max-width: 1300px;
    margin: auto;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 64px;
    padding: 60px 40px 100px
}

.toc {
    position: sticky;
    top: 30px;
    max-height: calc(100vh - 60px);
    overflow: auto;
    border-top: 3px solid var(--blue);
    padding-top: 17px
}

.toc summary {
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between
}

.toc ul {
    padding: 0;
    list-style: none;
    margin: 20px 0
}

.toc li {
    border-bottom: 1px solid #d8e3ed
}

.toc a {
    display: block;
    font-size: 13px;
    line-height: 1.7;
    padding: 13px 0;
    color: var(--muted)
}

.toc a.active {
    color: var(--blue);
    font-weight: bold
}

article {
    min-width: 0
}

article section {
    padding: 0 0 38px;
    margin-bottom: 38px;
    border-bottom: 1px solid #d0dce8
}

h2 {
    font-size: clamp(22px, 2vw, 29px);
    line-height: 1.6;
    margin: 0 0 24px;
    display: flex;
    gap: 18px;
    align-items: baseline
}

.section-number {
    color: #418bd7;
    font: 500 13px Arial;
    flex: none;
    padding-top: 12px
}

h3 {
    font-size: 19px;
    line-height: 1.7;
    margin: 32px 0 14px;
    border-left: 3px solid #21acbd;
    padding-left: 16px
}

article p {
    margin: 16px 0;
    font-size: 16px
}

article ul,
.intro ul {
    padding: 20px 26px 20px 46px;
    background: #e7eff7;
    border-radius: 4px;
    margin: 22px 0
}

article li {
    padding: 5px 0 5px 7px
}

li::marker {
    color: #1688b7
}

.intro ul {
    background: #163353
}

footer {
    background: var(--navy);
    color: #a8bfd5;
    padding: 58px 40px 28px
}

.footer-inner {
    max-width: 1220px;
    margin: auto
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 35px
}

.footer-brand a {
    color: var(--cyan)
}

footer nav ul {
    padding: 30px 0;
    list-style: none;
    border-top: 1px solid #28425c;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px 35px
}

footer nav a {
    color: #dbe7f3;
    font-size: 14px
}

.copyright {
    border-top: 1px solid #28425c;
    padding-top: 25px;
    font-size: 12px;
    line-height: 1.8
}

.back-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    border: 1px solid #67cddb;
    border-radius: 50%;
    background: var(--navy);
    color: white;
    width: 46px;
    height: 46px;
    font-size: 24px;
    cursor: pointer
}

.skip {
    position: fixed;
    top: -100px;
    left: 20px;
    background: white;
    padding: 10px;
    z-index: 100
}

.skip:focus {
    top: 10px
}

@media(max-width:950px) {
    .reading-layout {
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 30px;
        padding: 40px 25px
    }

    .hero-inner {
        padding: 35px 25px 50px
    }

    .header-wrap {
        padding: 18px 25px
    }
}

@media(max-width:700px) {
    .header-wrap {
        padding: 17px 20px
    }

    .header-wrap img {
        width: 120px
    }

    .header-link {
        font-size: 12px
    }

    .hero-inner {
        padding: 30px 20px 40px
    }

    h1 {
        font-size: 29px;
        margin-top: 22px
    }

    .intro {
        font-size: 15px
    }

    .reading-layout {
        display: block;
        padding: 30px 20px 55px
    }

    .toc {
        position: static;
        max-height: 360px;
        padding: 15px 18px;
        background: #e4edf6;
        margin-bottom: 36px
    }

    .toc ul {
        margin-top: 12px
    }

    .toc a {
        font-size: 14px
    }

    h2 {
        font-size: 22px;
        gap: 12px
    }

    h3 {
        font-size: 18px
    }

    article p {
        font-size: 15px
    }

    article ul {
        padding: 16px 18px 16px 36px
    }

    footer {
        padding: 38px 20px 25px
    }

    footer nav ul {
        grid-template-columns: 1fr 1fr;
        gap: 15px 20px
    }

    .footer-brand img {
        width: 125px
    }

    .back-top {
        right: 14px;
        bottom: 14px;
        width: 40px;
        height: 40px
    }
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }
}