:root {
    color-scheme: light;
    --ink: #20140e;
    --cream: #fff0c7;
    --gold: #ffd262;
    --paper: #f5d699;
    --red: #96271d;
    --blue: #123855;
    --line: 3px solid var(--ink);
    --display: Impact, "Arial Black", "DejaVu Sans", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0 auto;
    max-width: 1480px;
    min-height: 100vh;
    background: #ebce9d url(illustrations/newsprint.webp) repeat;
    background-blend-mode: multiply;
    color: var(--ink);
    font: 1rem/1.45 system-ui, sans-serif;
}
html { background: #1f1611; }
img { display: block; max-width: 100%; }
a { color: #752014; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .17em; }
button, input, select { font: inherit; }
button, .button {
    display: inline-block;
    border: 2px solid var(--ink);
    border-radius: 2px;
    box-shadow: 2px 2px 0 var(--ink);
    padding: .43rem .73rem;
    background: var(--gold);
    color: var(--ink);
    cursor: pointer;
    font-weight: 850;
    text-decoration: none;
}
button:enabled:hover, .button:hover { background: #fff0ad; }
button:disabled { opacity: .6; cursor: default; box-shadow: none; }
.secondary { background: #d2e7ee; }
:focus-visible { outline: 3px solid #2378be; outline-offset: 3px; }
[hidden] { display: none !important; }
h2, h3, p { margin: 0 0 .6rem; }
h2, h3 { line-height: 1.06; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.skip:focus { position: fixed; z-index: 5; inset: .5rem auto auto .5rem; background: var(--cream); padding: .5rem; }
.cover {
    min-height: clamp(244px, 31.5vw, 450px);
    display: grid;
    place-items: center;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 4px solid var(--ink);
    border-bottom: 0;
    color: var(--cream);
    background: #10223e url(illustrations/cover.webp) center 30% / cover no-repeat;
}
.cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, #100f22ab 0 20%, #100f2230 42%, transparent 67%);
    z-index: -1;
}
.cover-copy { text-align: center; padding: 1rem; }
.issue {
    display: inline-flex;
    border: 2px solid var(--ink);
    background: var(--gold);
    color: var(--ink);
    font-size: clamp(.53rem, 1.15vw, .75rem);
    letter-spacing: .1em;
    font-weight: 950;
    box-shadow: 3px 3px 0 #1f100b;
}
.issue span { padding: .26rem .5rem; }
.issue span + span { background: var(--red); color: white; border-left: 2px solid var(--ink); }
.cover-title {
    margin: .18em 0 .1em;
    font: italic 1000 clamp(4.15rem, 11.5vw, 10.3rem)/.79 var(--display);
    letter-spacing: -.065em;
    color: #ffbc35;
    -webkit-text-stroke: .035em #27120b;
    paint-order: stroke fill;
    text-shadow: .03em .045em 0 #a3341d, .064em .075em 0 #1c110c;
    transform: rotate(-4deg);
}
.cover-title span {
    display: block;
    margin-top: .5em;
    color: #fff0b8;
    letter-spacing: .045em;
    font-size: .228em;
    -webkit-text-stroke: .085em var(--ink);
    text-shadow: .11em .14em 0 var(--ink);
}
.cover-subtitle {
    width: max-content;
    margin: .95em auto 0;
    padding: .28em .85em;
    border: 2px solid var(--ink);
    color: var(--ink);
    background: var(--cream);
    font-weight: 950;
    font-size: clamp(.7rem, 1.35vw, .92rem);
    letter-spacing: .09em;
    transform: rotate(-2deg);
    box-shadow: 3px 3px 0 var(--ink);
}
.tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .3rem;
    padding: .42rem .6rem;
    background: #68231a url(illustrations/newsprint.webp) repeat;
    background-blend-mode: multiply;
    border: var(--line);
}
.tabs a {
    flex: 1 0 auto;
    max-width: 240px;
    padding: .42rem .65rem;
    border: 2px solid var(--ink);
    box-shadow: inset 0 0 0 1px #fbe19a;
    background: var(--paper) url(illustrations/newsprint.webp) repeat;
    background-blend-mode: multiply;
    color: var(--ink);
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: 900;
    font-size: .84rem;
    letter-spacing: .045em;
}
.tabs a:hover, .tabs a[aria-current] { background: var(--red); color: white; }
.guide { padding: clamp(.65rem, 2vw, 1.6rem); }
.panel {
    min-width: 0;
    border: var(--line);
    box-shadow: 4px 4px 0 #492b1c;
    background: var(--cream) url(illustrations/newsprint.webp) repeat;
    background-blend-mode: multiply;
}
.opening, .feature-spread, .closing-spread { display: grid; gap: clamp(.8rem, 1.55vw, 1.35rem); }
.opening { grid-template-columns: 1.65fr 1fr; }
.opening .panel { position: relative; padding: .85rem 1.05rem .92rem; }
.welcome { isolation: isolate; }
.welcome::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, transparent, #fff0c7 60%), url(illustrations/mesa.webp) 20% 51% / 39% auto no-repeat;
    transform: scaleX(-1);
    opacity: .42;
}
.welcome p { max-width: 55ch; }
.opening h2 { color: var(--red); font: italic 950 clamp(1.45rem, 3.4vw, 2.7rem)/1 var(--display); text-transform: uppercase; }
.kicker { display: block; font-size: .69rem; font-weight: 950; letter-spacing: .12em; margin-bottom: .32rem; }
.field-note { border-left: 7px solid var(--red); }
.field-note a { font-weight: 750; }
.feature-spread { grid-template-columns: minmax(0, 1fr) minmax(195px, 22%); margin-top: 1.2rem; align-items: start; }
.chapter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .46rem .8rem .52rem;
    border-bottom: var(--line);
    background: var(--red) url(illustrations/newsprint.webp) repeat;
    background-blend-mode: multiply;
    color: var(--cream);
}
.chapter.blue { background-color: var(--blue); }
.chapter h2 { margin: 0; font: italic 950 clamp(1.15rem, 3vw, 2.14rem)/1.04 var(--display); text-transform: uppercase; }
.topics .chapter h2 { font-size: clamp(1rem, 1.8vw, 1.55rem); }
.chapter .kicker { color: #ffde81; margin-bottom: .18rem; }
.counter { font-size: .75rem; font-weight: 900; white-space: nowrap; }
.toolbar { display: flex; gap: .5rem; padding: .6rem; }
.toolbar input, .toolbar select, .editor input:not([type=file]), .editor select {
    min-width: 0;
    min-height: 2.65rem;
    border: 2px solid var(--ink);
    border-radius: 2px;
    padding: .42rem .6rem;
    color: var(--ink);
    background: #fff9e9;
}
.toolbar input { flex: 1; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .55rem; padding: 0 .6rem .6rem; }
.word-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: var(--line);
    background: #ffe8a9;
    box-shadow: 2px 2px 0 #6c401e;
}
.word-open {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: left;
}
.word-open:hover .word-body { background: #ffe499; }
.word-open:focus-visible { outline-offset: -4px; }
.illustration { aspect-ratio: 1.58; width: 100%; border-bottom: 2px solid var(--ink); background: #e4a85d; overflow: hidden; }
.illustration img, .quiz-art img, .detail-image { width: 100%; height: 100%; object-fit: cover; }
.word-body { width: 100%; flex: 1; display: block; padding: .26rem .42rem .38rem; }
.english { display: block; font-size: .78rem; text-transform: uppercase; line-height: 1.15; }
.hopi { display: block; color: #7b2117; font-size: clamp(1.04rem, 1.65vw, 1.45rem); line-height: 1.13; font-weight: 950; overflow-wrap: anywhere; }
.word-actions { display: flex; justify-content: space-between; align-items: center; gap: .25rem; flex-wrap: wrap; padding: .28rem .42rem; border-top: 1px solid #b38a57; font-size: .68rem; font-weight: 750; }
.word-actions a { margin-left: auto; }
.listen { padding: .12rem .3rem; background: var(--red); color: white; }
.listen:enabled:hover { background: #681e14; }
.audio-pending { color: #60452c; }
.topic-list { display: grid; gap: .42rem; padding: .52rem; }
.topic { display: flex; gap: .48rem; align-items: center; width: 100%; min-height: 2.75rem; padding: 0 .48rem 0 0; text-align: left; font-size: .87rem; background: #ffe4a2; }
.topic[aria-pressed="true"] { background: #ffbc47; }
.topic img { width: 47px; height: 39px; object-fit: cover; border-right: 2px solid var(--ink); }
.listening { margin: .35rem .52rem .52rem; border: 2px solid var(--ink); background: #f9e4b5; }
.listening h3 { padding: .45rem; background: var(--blue); color: #fff1c1; font-size: 1rem; }
.listening p, .listening a { margin: .45rem; font-size: .83rem; }
.listening a { display: inline-block; font-weight: 800; }
.closing-spread { grid-template-columns: 1.2fr 1fr; margin-top: 1.2rem; }
.flash { display: grid; grid-template-columns: 1fr 1.1fr; gap: .75rem; padding: .65rem; align-items: center; }
.quiz-art { aspect-ratio: 1.3; overflow: hidden; border: var(--line); background: var(--paper); }
.flash-copy h3 { font-size: 1.45rem; }
.quiz-answer { min-height: 1.6em; font-size: 1.4rem; color: #80281d; font-weight: 950; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.actions button { font-size: .82rem; }
.about-copy, .editor-content { padding: .8rem 1rem; }
.about-copy p:last-child, .editor-content p:last-child { margin-bottom: 0; }
.colophon { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .35rem 1rem; padding: .8rem 1.4rem; color: var(--cream); background: var(--ink); font-size: .8rem; letter-spacing: .04em; }
.editor { max-width: 800px; margin: auto; }
.editor .about h2 { font-size: 1.5rem; }
.editor input { max-width: 100%; }
.detail-dialog {
    width: min(760px, calc(100% - 1.2rem));
    max-height: calc(100% - 1.5rem);
    padding: 0;
    color: var(--ink);
}
.detail-dialog::backdrop { background: #16100cd4; }
.modal-open { overflow: hidden; }
.detail-bar, .detail-nav { display: flex; gap: .5rem; padding: .55rem; }
.detail-bar { justify-content: space-between; align-items: center; background: var(--blue); color: var(--cream); border-bottom: var(--line); }
.detail-bar .kicker { margin: 0; }
.detail-layout { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; padding: .75rem; }
.detail-image { aspect-ratio: 1.25; border: var(--line); height: auto; align-self: center; }
.detail-copy h2 { font-size: 1.8rem; margin-bottom: .25rem; }
.detail-translation { color: var(--red); font-weight: 950; font-size: 1.6rem; margin-bottom: .35rem; }
.detail-note { font-size: .9rem; }
.detail-nav { justify-content: space-between; border-top: var(--line); }
.note, .empty { margin: .6rem; }
.empty { grid-column: 1 / -1; }
@media (min-width: 1260px) { .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) {
    .opening, .feature-spread, .closing-spread { grid-template-columns: minmax(0, 1fr); }
    .cover { min-height: 240px; background-position: 39% center; }
    .cover::before { background: linear-gradient(90deg, #100f2220, #100f22b0 38%, #100f22b0 80%, #100f2220); }
    .cover-copy { margin-left: 15%; }
    .tabs a { font-size: .7rem; padding: .4rem .35rem; }
    .feature-spread { margin-top: .95rem; }
    .topics { grid-row: 1; }
    .topics .chapter { padding: .35rem .55rem; }
    .topics .chapter .kicker { display: none; }
    .topic-list { display: flex; flex-wrap: wrap; }
    .topic { flex: 1 0 auto; width: auto; min-height: 2.35rem; font-size: .76rem; }
    .topic img { width: 33px; height: 32px; }
    .topics .listening { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .25rem; }
    .listening h3 { margin: 0; font-size: .82rem; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-layout { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
    .detail-image { max-height: min(31vh, 240px); }
    .field-note p { font-size: .91rem; }
}

.study-toolbar, .deck-toolbar, .pager {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem .65rem;
    padding: .55rem .65rem;
    font-size: .8rem;
}
.study-toolbar { padding-top: 0; }
.study-toolbar label { display: inline-flex; align-items: center; gap: .25rem; font-weight: 750; }
.study-toolbar button { margin-left: auto; }
.pager { justify-content: space-between; border-top: 2px solid var(--ink); }
.pager span { font-weight: 800; }
.deck-toolbar { border-bottom: 2px solid var(--ink); }
.deck-toolbar select {
    max-width: 100%;
    padding: .25rem;
    border: 2px solid var(--ink);
    background: #fff9e9;
}
.topic-text { padding: .4rem .65rem; }
.word-tag {
    display: block;
    border-bottom: 2px solid var(--ink);
    width: 100%;
    padding: .25rem .42rem;
    background: var(--blue);
    color: var(--cream);
    font-size: .66rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.word-tag.research { background: #634824; }
.word-card.text-card .word-body { padding-top: .55rem; padding-bottom: .55rem; overflow-wrap: anywhere; }
.detail-layout.text-detail { grid-template-columns: minmax(0, 1fr); }
.quiz-art.text-quiz {
    display: grid;
    place-items: center;
    padding: .5rem;
    background: var(--blue) url(illustrations/newsprint.webp) repeat;
    background-blend-mode: multiply;
    color: var(--cream);
    font: italic 900 clamp(.85rem, 2vw, 1.5rem)/1.1 var(--display);
    text-align: center;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
@media (max-width: 420px) {
    .study-toolbar button { margin-left: 0; }
    .pager button { padding: .35rem .45rem; }
    .pager { gap: .35rem; font-size: .73rem; }
}

.illustrated-page {
    display: grid;
    grid-template-columns: 16% minmax(0, 1fr);
    background: #f8db9f url(illustrations/comic-paper.webp);
}
.portrait-strip {
    border-right: var(--line);
    background: #62351e url(illustrations/comic-portraits.webp) center top / 100% auto no-repeat;
}
.cover.illustrated-cover {
    display: block;
    min-height: 0;
    background: #62351e;
}
.illustrated-cover img { width: 100%; height: auto; }
.illustrated-cover::before { content: none; }
.tabs {
    background: #62331d url(illustrations/comic-border.webp) center / auto 100%;
}
.tabs a { background: #f8db9f url(illustrations/comic-paper.webp); }
.opening .illustrated-welcome {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    overflow: hidden;
    padding: 0;
}
.illustrated-welcome::before { content: none; }
.illustrated-welcome > div { padding: .85rem 1rem; }
.illustrated-welcome > img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 680px) {
    .illustrated-page { display: block; }
    .portrait-strip { display: none; }
    .guide-page .cover.illustrated-cover { display: grid; grid-template-columns: 16% 84%; }
    .guide-page .illustrated-cover::before {
        content: "";
        position: static;
        align-self: stretch;
        width: 100%;
        z-index: auto;
        background: url(illustrations/comic-portraits.webp) center top / 100% auto no-repeat;
    }
    .opening .illustrated-welcome { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}
