:root {
    color-scheme: light;
    --paper: #f2efe7;
    --navy: #0b2942;
    --red: #b30b16;
    --ink: #192f3d;
    --rule: #c6c5ba;
    --sans: "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
    --gutter: clamp(1rem, 4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 1rem/1.7 var(--sans);
}
h1, h2, h3, p, figure, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 3px;
}
.page-width {
    width: min(calc(100% - var(--gutter) - var(--gutter)), 72rem);
    margin-inline: auto;
}
.skip-link {
    position: absolute;
    z-index: 2;
    top: 0.5rem;
    left: var(--gutter);
    padding: 0.5rem 1rem;
    transform: translateY(-180%);
    background: var(--navy);
    color: #fff;
}
.skip-link:focus { transform: none; }
.masthead { background: #fffcf5; }
.masthead-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.5rem;
}
.brand, .primary-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
}
.brand img {
    display: block;
    width: clamp(9.875rem, 24vw, 13.5rem);
    max-width: 100%;
    height: auto;
}
.site-description {
    color: #566674;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}
.primary-nav {
    background: var(--navy);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 500;
}
.primary-nav-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 clamp(0.8125rem, 3vw, 2.125rem);
}
.primary-nav a { white-space: nowrap; }
.primary-nav a:hover, .utility-nav a:hover {
    text-decoration: underline;
    text-underline-offset: 0.22em;
}
.primary-nav a:focus-visible, .colophon a:focus-visible { outline-color: #fff; }
.primary-nav a:focus-visible { outline-offset: -2px; }

main.page-width {
    display: flex;
    flex: 1 0 auto;
    flex-direction: column;
    justify-content: center;
    gap: clamp(1.125rem, 2vw, 1.5rem);
    padding-block-start: clamp(1.0625rem, 2.5vw, 1.875rem);
}
.cover {
    --cover-ground: #c7cdc3;
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: center;
    min-height: clamp(15rem, 25vw, 20rem);
    padding: clamp(1.5rem, 3.5vw, 2.875rem) clamp(1.375rem, 4vw, 3.25rem);
    overflow: hidden;
    border: 1px solid #d6d2c7;
    border-inline-start: 7px solid var(--red);
    background-color: var(--cover-ground);
    background-image:
        linear-gradient(90deg, transparent 35%, var(--cover-ground) 72%),
        linear-gradient(90deg, #50645418 1px, transparent 1px),
        linear-gradient(#50645418 1px, transparent 1px);
    background-size: 100% 100%, 1.5rem 1.5rem, 1.5rem 1.5rem;
    background-position: left bottom;
    box-shadow: 0 3px 0 -1px #fdfbf5, 0 4px 0 -1px #c9c4b6, 2px 8px 14px #433c2814;
}
.cover::before {
    content: "";
    position: absolute;
    z-index: -2;
    right: 1.5%;
    bottom: 0;
    width: 68%;
    aspect-ratio: 1440 / 612;
    background: url("../img/home-origami-camel.webp") center / cover no-repeat;
    transform: scaleX(-1);
    filter: brightness(1.04);
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 60%, transparent),
                linear-gradient(to bottom, transparent, #000 18%);
    mask-composite: intersect;
}
.cover::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(100deg, #fcfaf2 2%, #faf8f0f5 30%, #f5f2e59c 51%, #f4f1e22b 66%, transparent 79%);
}
.cover-copy { max-width: 57%; }
.utility-nav h2 {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1.5;
}
.cover h1 {
    margin-bottom: 0.34em;
    font-size: clamp(1.875rem, 4.6vw, 3.625rem);
    font-weight: 500;
    font-feature-settings: "palt";
    line-height: 1.26;
    letter-spacing: 0.012em;
}
.cover-line { display: block; }
.cover-accent { color: var(--red); }
.cover-intro {
    max-width: 33em;
    color: #495c66;
    line-height: 1.8;
    line-break: strict;
    word-break: keep-all;
    overflow-wrap: anywhere;
    text-wrap: balance;
}
.reference-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-height: 2.75rem;
    margin-top: 0.875rem;
    padding: 0.45rem 1rem;
    background: var(--navy);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
}
.reference-link:hover { background: #17384f; text-decoration: underline; text-underline-offset: 0.22em; }
.arrow {
    position: relative;
    display: inline-block;
    flex: none;
    width: 1.125rem;
    height: 1px;
    background: currentColor;
}
.arrow::after {
    content: "";
    position: absolute;
    top: -3px;
    right: 0;
    width: 7px;
    height: 7px;
    border: solid currentColor;
    border-width: 1px 1px 0 0;
    transform: rotate(45deg);
}
.reference-feature {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    border-top: 3px solid var(--navy);
    border-bottom: 1px solid var(--rule);
    background: #fbfaf6;
}
.reference-main, .glossary { padding: clamp(1rem, 2vw, 1.5rem); }
.reference-main h2 {
    color: var(--navy);
    font-size: clamp(1.375rem, 2.65vw, 2rem);
    font-weight: 600;
    font-feature-settings: "palt";
    line-height: 1.35;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.reference-feature p {
    margin-top: 0.5rem;
    color: #465962;
    font-size: 0.9375rem;
    line-height: 1.8;
    line-break: strict;
}
.glossary {
    display: grid;
    align-content: center;
    justify-items: start;
    border-inline-start: 1px solid var(--rule);
    background: #e8ede9;
}
.glossary h3 {
    color: var(--navy);
    font-size: 1.25rem;
    font-weight: 600;
}
.glossary .index-link { margin-top: 0.25rem; }

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0 1rem;
    min-height: 3.5rem;
    padding-block: 0.375rem;
    border-top: 2px solid var(--navy);
}
.section-heading h2 {
    font-size: clamp(1.25rem, 2.1vw, 1.65rem);
    font-weight: 600;
    line-height: 1.4;
    font-feature-settings: "palt";
}
.index-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.75rem;
    padding-inline-end: 0.1875rem;
    color: var(--navy);
    font-size: 0.875rem;
    font-weight: 500;
}
.index-link .arrow { width: 0.875rem; color: var(--red); }
.entry-link:hover .entry-title, .index-link:hover {
    color: var(--red);
    text-decoration: underline;
    text-underline-offset: 0.22em;
}
.resources {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
    gap: clamp(1.5rem, 3.5vw, 2.75rem);
}
.resource-list {
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--rule);
}
.resource-list > li { border-bottom: 1px solid var(--rule); }
.lesson-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: #fbfaf6;
}
.lesson-list > li:nth-child(even) { border-inline-start: 1px solid var(--rule); }
.lesson-list .entry-link {
    height: 100%;
    padding: 0.875rem clamp(1rem, 1.75vw, 1.375rem);
}
.lesson-list .entry-link:hover { background: #f4f2e9; }
.entry-link { display: block; padding-block: 0.6rem; }
.entry-title {
    color: var(--navy);
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: underline;
    text-decoration-color: #b4b3a8;
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
}
.entry-link p {
    margin-top: 0.125rem;
    color: #465962;
    font-size: 0.875rem;
    line-height: 1.75;
}

@media (max-width: 48rem) {
    .resources { grid-template-columns: 1fr; gap: 1.25rem; }
    .reference-feature { grid-template-columns: 1fr; }
    .glossary { border-inline-start: 0; border-top: 1px solid var(--rule); }
}

.home-ad {
    width: min(calc(100% - var(--gutter) - var(--gutter)), 45.5rem);
    margin: 0.75rem auto 1rem;
}
.ad-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    min-height: 3rem;
    border: 1px dashed #cbceca;
    background: #f2f2ed;
}
.ad-label { color: #586460; font-size: 0.75rem; letter-spacing: 0.12em; text-align: center; }
.colophon { border-top: 4px solid #334e61; background: var(--navy); color: #f6f4ea; }
.colophon-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 0.76fr) minmax(0, 1fr);
    align-items: start;
    gap: 0.625rem clamp(1rem, 4vw, 2.75rem);
    padding-block: clamp(1.125rem, 2vw, 1.625rem);
}
.publisher .brand img { width: clamp(9.1875rem, 19vw, 11.4375rem); filter: brightness(0) invert(1); }
.publisher small { display: block; font-size: 0.8125rem; line-height: 1.6; }
.publisher small, .utility-nav h2 { color: #bfd1d9; }
.utility-nav { display: flex; flex-direction: column; align-items: flex-start; }
.utility-nav h2 { margin-bottom: 0.375rem; }
.utility-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

@media (max-width: 38.75rem) {
    .masthead-inner { padding-block: 0.25rem; }
    .primary-nav { font-size: 0.875rem; }
    .primary-nav-inner { column-gap: clamp(0.5rem, 2.5vw, 1rem); }
    main.page-width { padding-block-start: 1rem; gap: 1rem; }
    .cover {
        min-height: 0;
        padding-block-end: clamp(7rem, 34vw, 10.5rem);
    }
    .cover::before { right: 0; width: min(100%, 28rem); }
    .cover::after {
        background: linear-gradient(156deg, #fcfaf2 10%, #faf8eff5 31%, #f5f2e49c 47%, #f3f0e020 68%, transparent 81%);
    }
    .cover-copy { max-width: none; }
    .cover h1 { font-size: clamp(1.5625rem, 8vw, 2.625rem); }
    .lesson-list { grid-template-columns: 1fr; }
    .lesson-list > li:nth-child(even) { border-inline-start: 0; }
    .colophon-inner { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
    .publisher { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1rem; }
}
@media (max-width: 28.75rem) {
    .site-description { display: none; }
}
@media (max-width: 38.75rem), (pointer: coarse) {
    .utility-nav a { min-height: 2.75rem; }
}
