:root {
  color-scheme: light;
  --ink: #231b17;
  --muted: #695a51;
  --cream: #f8f0e3;
  --paper: #fff8ed;
  --line: #d6c6b5;
  --rust: #813e32;
  --peach: #efb890;
  --dark: #211714;
  --light-text: #f4e6d5;
  --serif: Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1.25rem; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 1rem/1.65 var(--sans); }
img { display: block; width: 100%; height: auto; }
figure, p { margin: 0; }
button, input, summary { font: inherit; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #b56a45; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.08; overflow-wrap: anywhere; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.045em; }
h2 { font-size: clamp(2.15rem, 4.25vw, 3.7rem); }
ul, ol { margin: 0; padding: 0; }
.wrap { width: min(100% - 7vw, 1280px); margin-inline: auto; }
.section { padding-block: clamp(2.8rem, 6vw, 5.6rem); }
.kicker {
  color: var(--rust); font: 700 .71rem/1.4 var(--mono);
  letter-spacing: .17em; text-transform: uppercase;
}
.skip { position: fixed; top: .5rem; left: .5rem; transform: translateY(-160%); z-index: 10; background: white; padding: .6rem 1rem; }
.skip:focus { transform: none; }

.site-header { background: var(--dark); color: var(--light-text); border-bottom: 1px solid #513e35; position: relative; z-index: 4; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 1.7rem; }
.brand { display: inline-flex; flex: none; align-items: center; gap: .62rem; text-decoration: none; font-weight: 730; white-space: nowrap; letter-spacing: -.025em; }
.brand-sub { font-weight: 500; }
.brand-mark { display: grid; grid-template: repeat(2, 5px) / repeat(2, 5px); gap: 3px; padding: 6px; border: 1px solid #ae785e; border-radius: 50%; transform: rotate(-10deg); }
.brand-mark i { background: #ecb995; border-radius: .6px; }
.brand-mark i:nth-child(2) { opacity: .52; }
.desktop-nav, .header-actions, .locale { display: flex; align-items: center; gap: clamp(.8rem, 2vw, 1.85rem); font-size: .86rem; }
.desktop-nav > a, .desktop-nav summary { color: #e0cab8; text-decoration: none; white-space: nowrap; }
.desktop-nav > a:hover, .desktop-nav .current { color: #fff4e9; text-decoration: underline; }
.header-actions { gap: 1.05rem; }
.locale { gap: 2px; padding: 3px; border: 1px solid #6e5142; border-radius: 5px; }
.locale a { padding: 3px 6px; text-decoration: none; line-height: 1.6; font: 700 .67rem/1.5 var(--mono); }
.locale a[aria-current] { background: var(--light-text); border-radius: 2px; color: var(--dark); }
.nav-cta { color: var(--peach); font-weight: 700; text-decoration: none; white-space: nowrap; }
.mobile-menu { display: none; }
.dropdown { position: relative; }
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
.chevron { display: inline-block; width: .43rem; height: .43rem; margin: 0 .15rem .2rem .4rem; transform: rotate(45deg); border-right: 1.5px solid; border-bottom: 1.5px solid; vertical-align: middle; }
details[open] > summary > .chevron { transform: rotate(225deg); margin-bottom: -.15rem; }
.dropdown-panel { position: absolute; z-index: 5; top: calc(100% + .7rem); margin: 0; padding: .45rem; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 12px 27px #2519152b; min-width: min(19rem, 86vw); list-style: none; max-height: min(23rem, 62vh); overflow: auto; overscroll-behavior: contain; }
.dropdown-panel ul { list-style: none; }
.dropdown-panel a { display: flex; justify-content: space-between; gap: .75rem; text-decoration: none; padding: .42rem .7rem; border-radius: 2px; }
.dropdown-panel a:hover { background: #f1dfc8; }
.dropdown-panel .all-categories { border-bottom: 1px solid var(--line); margin-bottom: .2rem; font-weight: 750; }
.mobile-menu .dropdown-panel { right: 0; }

.hero {
  position: relative;
  color: var(--light-text);
  background: radial-gradient(ellipse at 69% 42%, #493327 0%, #2c1d17 46%, var(--dark) 83%);
}
.hero-grid { display: grid; grid-template-columns: 1.06fr 1fr; gap: clamp(2rem, 5.5vw, 6rem); align-items: center; min-height: min(590px, 79vh); padding-block: clamp(2.6rem, 5.5vw, 5.4rem); }
.hero-kicker { color: var(--peach); margin-bottom: 1.2rem; }
.hero h1 { font-size: clamp(3.8rem, 7.8vw, 8.05rem); line-height: .88; letter-spacing: -.068em; }
.title-period { color: var(--peach); }
.hero-intro { max-width: 51ch; font-size: clamp(.98rem, 1.25vw, 1.1rem); line-height: 1.69; margin-top: 1.4rem; color: #ead7c8; }
.hero-figure { margin: 0; padding: .55rem; border: 1px solid #795c4c; background: #35251e; }
.hero-figure img { object-fit: cover; aspect-ratio: 1.24; }
.hero-figure figcaption { padding: .62rem .35rem .2rem; color: #edd2ba; font-size: .77rem; }
.button-row, .sheet-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.55rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; text-decoration: none; padding: .67rem .95rem; min-height: 44px; background: var(--dark); color: var(--light-text); border: 1px solid var(--dark); border-radius: 4px; cursor: pointer; font-size: .88rem; font-weight: 700; line-height: 1.3; }
.button:hover { background: #5c3629; color: white; }
.button.secondary { color: var(--ink); background: transparent; border-color: #866b5a; }
.button.secondary:hover { background: #ecd9c4; }
.hero .button, .catalog-section .button { background: var(--light-text); color: var(--dark); border-color: var(--light-text); }
.hero .button:hover, .catalog-section .button:hover { background: #fff7eb; }
.hero .button.secondary { background: transparent; color: var(--light-text); border-color: #b89077; }
.hero .button.secondary:hover { background: #51382d; }
.text-link { display: inline-flex; align-items: baseline; gap: .55rem; color: var(--rust); font-weight: 750; text-decoration: underline; }
.category-bar { background: #f0dec8; border-bottom: 1px solid #d5baa0; }
.category-inner { display: flex; align-items: center; gap: 1.2rem; min-height: 64px; padding-block: .6rem; }
.category-inner > span { color: #5d4b40; font-size: .85rem; }
.category-inner > a { margin-left: auto; font-size: .87rem; }
.product-menu > summary { border: 1px solid #ab8b72; border-radius: 4px; padding: .55rem .8rem; font-size: .87rem; font-weight: 750; }
.product-menu > summary:hover { background: #ead5bb; }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.65rem; }
.section-head p + h2, .spread-intro p + h2 { margin-top: .5rem; }
.section-head h2 + p, .spread-intro h2 + p { color: var(--muted); margin-top: .7rem; max-width: 55ch; }
.topic-grid, .article-grid, .guide-list, .product-grid, .related-list { list-style: none; }
.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.topic-grid li + li { border-left: 1px solid var(--line); }
.topic-grid a { display: flex; flex-direction: column; height: 100%; padding: clamp(1rem, 2.5vw, 1.85rem); text-decoration: none; }
.topic-grid a:hover, .guide-list a:hover { background: #f0e1cc; }
.topic-verb { color: var(--rust); font: 700 .69rem/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; margin-bottom: .85rem; }
.topic-grid strong { font-family: var(--serif); font-size: clamp(1.3rem, 2.15vw, 1.9rem); font-weight: 400; line-height: 1.12; }
.topic-grid p { color: var(--muted); margin-top: .6rem; font-size: .9rem; }
.topic-grid a > span:last-child { margin-top: auto; padding-top: .65rem; color: var(--rust); }
.notebook { background: #ead8c4; border-block: 1px solid #d9bda5; }
.spread, .library-group { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(1.5rem, 6.5vw, 6rem); }
.spread-intro .text-link { margin-top: 1.2rem; }
.guide-list { border-top: 1px solid #bda796; }
.guide-list li { border-bottom: 1px solid #bda796; }
.guide-list a { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .9rem .6rem; text-decoration: none; }
.guide-list h3 { font-size: 1.05rem; line-height: 1.36; }
.guide-list p, .library-group h2 + p { margin-top: .2rem; font-size: .9rem; color: var(--muted); }
.library-group + .library-group { border-top: 1px solid var(--line); }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.7rem); }
.article-card a { height: 100%; display: block; border: 1px solid var(--line); background: var(--paper); text-decoration: none; }
.article-card a:hover { border-color: var(--rust); }
.article-card img { aspect-ratio: 3 / 2; object-fit: cover; }
.card-image { background: #dcc6af; }
.article-card-copy { padding: 1.1rem 1.15rem 1.2rem; }
.article-card h3 { font: 400 clamp(1.26rem, 2vw, 1.66rem)/1.16 var(--serif); margin-top: .45rem; }
.article-card p { font-size: .92rem; color: var(--muted); margin-top: .55rem; }
.article-card-copy > span:last-child { display: inline-block; color: var(--rust); margin-top: .55rem; }
.catalog-section { background: #693529; color: #fff1e4; padding-block: 2.4rem; }
.catalog-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.catalog-inner p { margin-top: .5rem; max-width: 60ch; }
.catalog-inner .button-row { margin-top: 0; }
.catalog-inner .product-menu > summary { border-color: #e3b9a8; }
.catalog-inner .product-menu > summary:hover { background: #7a4032; }
.catalog-inner .dropdown-panel { top: auto; bottom: calc(100% + .7rem); right: 0; }

.page-intro { color: var(--light-text); background: radial-gradient(ellipse at right bottom, #4a2d21, var(--dark) 77%); padding-block: 1.35rem clamp(2rem, 5.4vw, 4.7rem); }
.page-intro .kicker { color: var(--peach); margin-bottom: .65rem; }
.page-intro h1 { max-width: 23ch; font-size: clamp(2.8rem, 6.5vw, 5.5rem); line-height: 1; }
.page-intro h1 + p { margin-top: .95rem; max-width: 63ch; font-size: clamp(1rem, 1.6vw, 1.2rem); color: #e4cfc0; }
.breadcrumbs { display: flex; gap: .4rem; flex-wrap: wrap; list-style: none; margin-bottom: clamp(1.45rem, 4vw, 2.5rem); color: #e2c4b1; font-size: .83rem; }
.breadcrumbs li + li::before { content: "/"; margin-right: .4rem; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin-top: 1.3rem; }
.product-grid a { display: flex; justify-content: space-between; gap: 1rem; text-decoration: none; border: 1px solid var(--line); padding: .75rem 1rem; background: var(--paper); }
.product-grid a:hover { border-color: var(--rust); }
.section > h2 + :is(.guide-list, .article-grid, .topic-grid) { margin-top: 1.45rem; }
.reading-layout { display: grid; grid-template-columns: minmax(10rem, .24fr) minmax(0, .76fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: start; padding-top: clamp(2rem, 5vw, 4.5rem); }
.toc { position: sticky; top: 1.25rem; border-top: 2px solid var(--rust); padding-top: .75rem; }
.toc ol { padding-left: 1.15rem; color: var(--muted); font-size: .88rem; }
.toc li { margin-top: .5rem; }
.prose { max-width: 77ch; }
.prose .lead { font-size: clamp(1.15rem, 2vw, 1.35rem); color: #4c3429; }
.prose p + p { margin-top: .86rem; }
.prose section { margin-top: 2.15rem; }
.prose h2 { font-size: clamp(1.7rem, 3.5vw, 2.55rem); margin-bottom: .58rem; }
.article-lead { margin-bottom: 1.35rem; }
.article-lead img { aspect-ratio: 3 / 2; object-fit: cover; }
.article-lead figcaption { font-size: .78rem; color: var(--muted); margin-top: .35rem; }
.related-list li { padding-block: .5rem; border-top: 1px solid var(--line); }
.simple-reading { max-width: 770px; padding-block: clamp(2rem, 5vw, 4rem); }
.simple-reading section:first-child { margin-top: 0; }
.simple-reading h1 { font-size: clamp(2.7rem, 6vw, 4.3rem); margin-bottom: 1rem; }
.simple-reading > .button { margin-top: 1rem; }
.faq-list details { border-bottom: 1px solid var(--line); padding-block: .8rem; }
.faq-list summary { font-weight: 750; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.faq-list details p { margin-top: .5rem; }
.worksheet { padding: clamp(1rem, 2.5vw, 1.7rem); background: #f2e1cb; border: 1px solid #c9ae95; }
.worksheet h2 { margin-top: .45rem; }
.table-scroll { overflow-x: auto; background: var(--paper); margin-block: 1rem; border: 1px solid #cdb6a0; border-radius: 2px; }
.worksheet table { border-collapse: collapse; width: 100%; }
.worksheet th { padding: .4rem .6rem; text-align: left; font-size: .81rem; border-bottom: 1px solid #cdb6a0; }
.worksheet td { padding: .25rem; border: 1px solid #e9dacb; }
.worksheet input { padding: .4rem; width: 100%; min-width: 8rem; border: 1px solid transparent; background: transparent; color: var(--ink); font-size: .89rem; }
.worksheet input:hover { border-color: #bda796; }
.worksheet-note, .sheet-actions, .sheet-status { font-size: .87rem; }
.sheet-status:not(:empty) { margin-top: .6rem; }
.footer { background: var(--dark); color: var(--light-text); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.1rem 2.5rem; justify-content: space-between; padding-block: 1.9rem; }
.footer-inner p { color: #dcc7b8; margin-top: .5rem; font-size: .86rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: .6rem 1.25rem; align-items: center; font-size: .88rem; }

@media (max-width: 950px) {
  .desktop-nav { display: none; }
  .mobile-menu { display: block; }
  .hero-grid { min-height: auto; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-grid li:nth-child(odd) { border-left: 0; }
  .topic-grid li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .hero-grid, .spread, .reading-layout, .library-group { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { gap: 1.65rem; }
  .hero h1 { font-size: clamp(2.75rem, 12.6vw, 6rem); }
  .hero-figure img { aspect-ratio: 1.65; }
  .toc { position: static; }
  .product-grid, .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-inner > span { display: none; }
  .category-inner { gap: .65rem; }
}
@media (max-width: 490px) {
  .wrap { width: 92%; }
  .topbar { gap: .7rem; min-height: 60px; }
  .brand { font-size: .92rem; gap: .45rem; }
  .nav-cta { display: none; }
  .header-actions { gap: .65rem; }
  .section-head { align-items: start; flex-direction: column; gap: .65rem; }
  .article-grid { grid-template-columns: 1fr; }
  .product-grid a { padding: .6rem; font-size: .88rem; }
  .category-inner > a { text-align: right; }
  .catalog-inner .dropdown-panel { right: auto; left: 0; }
}
@media (max-width: 355px) {
  .topbar .brand-sub { display: none; }
}
