:root {
  color-scheme: light;
  font-family: "DM Sans", Inter, system-ui, sans-serif;
  --paper: var(--brand-paper);
  --white: #fff;
  --ink: var(--brand-navy);
  --subtle: #4b5871;
  --blue: var(--brand-violet);
  --line: var(--brand-line);
  --heading: "Instrument Serif", Georgia, serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
a { color: inherit; text-underline-offset: .23em; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand-focus); outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { width: min(1140px, calc(100% - 64px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); background: var(--white); }
.header-inner, .header-inner nav, .brand { display: flex; align-items: center; }
.header-inner { min-height: 66px; justify-content: space-between; gap: 12px; }
.brand { gap: 10px; font-size: 15px; font-weight: 800; text-decoration: none; letter-spacing: -.025em; }
.header-inner nav { gap: 18px; font-size: 14px; }
.header-inner nav a { text-decoration: none; font-weight: 650; padding-block: 8px; }
.header-inner nav a:hover { text-decoration: underline; }
.header-inner nav .current { color: var(--blue); text-decoration: underline; text-decoration-thickness: 2px; }
main.shell { padding-block: 30px 64px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); position: relative; overflow: hidden; min-height: 286px; border-radius: 24px; }
.hero-content { padding: 35px 0 36px 43px; z-index: 1; }
.hero h1 { margin: 0; font: 400 clamp(52px, 7vw, 88px)/.93 var(--heading); letter-spacing: -.065em; }
.hero p { margin: 19px 0 0; max-width: 31ch; line-height: 1.5; font-size: 16px; }
.hero-art { position: relative; align-self: stretch; margin-right: 40px; min-width: 0; }
.index-card { position: absolute; top: 50%; left: 50%; width: min(250px, 76%); height: 158px; border-radius: 14px; }
.back-card { background: #beb3fa; transform: translate(-60%, -49%) rotate(-17deg); border: 1px solid #dbe1ff; box-shadow: 0 14px 24px #0d1e4d4f; }
.front-card { background: #ffe3ef; transform: translate(-42%, -49%) rotate(10deg); padding: 13px 22px; border: 1px solid #fff5fa; box-shadow: 0 14px 24px #0d1e4d44; }
.card-rule { border-top: 1px solid #873b754f; }
.card-quote { font: 400 82px/.75 var(--heading); color: #233979; margin: 14px 0 -11px; }
.card-lines { display: grid; gap: 8px; }
.card-lines i { display: block; height: 2px; background: #873b754c; }
.card-lines i:last-child { width: 64%; }
.search { display: flex; align-items: center; position: relative; background: white; border: 1px solid #c6d0e2; border-radius: 13px; margin: 18px 0 26px; }
.hero[hidden] + .search { margin-top: 0; }
.search:focus-within { outline: 2px solid var(--brand-focus); outline-offset: 2px; }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; padding: 14px 12px 14px 45px; color: var(--ink); font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: #5a6581; }
.search button { flex-shrink: 0; margin-right: 9px; border: 0; border-radius: 7px; background: #eef1fa; padding: 7px 12px; color: var(--blue); font-size: 13px; font-weight: 750; }
.search-icon { position: absolute; left: 17px; top: 50%; width: 14px; height: 14px; border: 2px solid #4e6087; border-radius: 50%; transform: translateY(-57%); pointer-events: none; }
.search-icon::after { content: ""; position: absolute; height: 2px; width: 6px; right: -5px; bottom: -3px; background: #4e6087; transform: rotate(45deg); border-radius: 2px; }
.browse-heading { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; margin-bottom: 13px; }
.browse-heading h2, .result-heading, .lesson-title { margin: 0; font: 400 clamp(33px, 5vw, 50px)/1.02 var(--heading); letter-spacing: -.045em; }
.browse-heading span, .topic-count, .lesson-meta { color: var(--subtle); font-size: 13px; }
.filters, .jump-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filters a, .jump-links a { display: inline-flex; align-items: center; min-height: 37px; padding: 7px 13px; border: 1px solid #cdd6e6; border-radius: 999px; background: white; text-decoration: none; color: var(--blue); font-size: 13px; font-weight: 700; }
.filters a:hover, .jump-links a:hover { background: var(--brand-tint); }
.filters a[aria-current="true"] { background: var(--blue); color: white; border-color: var(--blue); }
.topic-grid, .expression-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.topic-card { position: relative; display: flex; flex-direction: column; align-items: start; background: white; border: 1px solid var(--line); border-radius: 15px; padding: 18px; text-decoration: none; transition: box-shadow .16s, border-color .16s; }
.topic-card:hover { border-color: #aab7d2; box-shadow: 0 5px 15px #25387312; }
.category { font-size: 11px; letter-spacing: .025em; font-weight: 750; color: #4a2f88; background: #eee8ff; border-radius: 5px; padding: 4px 7px; }
.category[data-group="conversations"] { background: #fae7f1; color: #80365e; }
.category[data-group="language-bank"] { background: #e2f6fa; color: #255968; }
.topic-card h3 { margin: 13px 0 6px; line-height: 1.2; letter-spacing: -.03em; font-size: 19px; }
.topic-card p { margin: 0 0 16px; color: var(--subtle); line-height: 1.55; font-size: 13px; }
.topic-count { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: auto; }
.topic-count b { color: var(--blue); font-size: 18px; line-height: 1; }
.breadcrumb { display: inline-block; margin: 0 0 13px; color: var(--blue); font-size: 14px; font-weight: 750; }
.lesson-header { padding: 21px 24px; border: 1px solid var(--line); background: white; border-radius: 16px; margin-bottom: 18px; }
.lesson-header .lesson-title { margin: 12px 0 10px; }
.lesson-header p { color: var(--subtle); max-width: 72ch; line-height: 1.6; margin: 5px 0; }
.lesson-footer { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-top: 14px; }
.practice-link { color: var(--blue); font-size: 13px; font-weight: 750; }
.jump-links { margin-bottom: 17px; }
.lesson-section { margin-block: 22px; scroll-margin-top: 15px; }
.lesson-section h2 { font: 400 30px/1.1 var(--heading); letter-spacing: -.025em; margin: 0 0 12px; }
.expression-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.expression { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 17px 18px; min-width: 0; overflow-wrap: anywhere; }
.expression h3 { font-size: 18px; margin: 0 0 7px; letter-spacing: -.025em; line-height: 1.25; color: var(--blue); }
.expression p, .section-note p { margin: 0 0 9px; line-height: 1.55; font-size: 14px; color: var(--subtle); }
.examples { margin: 12px 0 0; padding: 9px 12px; border-left: 3px solid #bfb0ee; background: #f6f2ff; border-radius: 0 7px 7px 0; }
.examples p { color: var(--ink); margin: 0; }
.examples p + p { margin-top: 8px; }
.section-note { background: #fff0f7; border: 1px solid #efd5e6; border-radius: 12px; padding: 14px 17px; }
.section-note p:last-child { margin-bottom: 0; }
.search-results .expression-grid { margin-top: 14px; }
.result-meta { margin: 10px 0 0; color: var(--subtle); font-size: 14px; }
.expression .result-topic { display: inline-block; color: var(--blue); font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.skip { position: absolute; z-index: 2; top: 8px; left: 8px; background: white; padding: 10px; transform: translateY(-150%); }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 850px) {
  .shell { width: min(100% - 38px, 1140px); }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-content { padding-left: 27px; }
  .hero-art { margin-right: 23px; }
}
@media (max-width: 580px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { min-height: 58px; }
  .header-inner nav { gap: 12px; }
  main.shell { padding-top: 16px; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: auto; border-radius: 17px; }
  .hero-content { padding: 25px 21px 26px; }
  .hero h1 { font-size: clamp(45px, 12vw, 62px); }
  .hero-art { display: none; }
  .hero p { font-size: 14px; margin-top: 12px; }
  .search { margin-block: 12px 20px; }
  .topic-grid, .expression-grid { grid-template-columns: 1fr; }
  .browse-heading { flex-wrap: wrap; }
  .lesson-header { padding: 17px; }
}
@media (prefers-reduced-motion: reduce) { .topic-card { transition: none; } }

@media (max-width: 360px) {
  .header-inner nav { gap: 8px; font-size: 13px; }
  .brand { font-size: 13px; }
}
