:root {
  color-scheme: light;
  --paper: #faf8f3;
  --white: #fffdf9;
  --ink: #172446;
  --muted: #505a70;
  --blue: #234ac0;
  --blue-dark: #14358f;
  --peach: #fbd1bd;
  --line: #e2dfd7;
  font: 16px/1.6 system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); }
body, h1, h2, h3, p, figure, ul { margin: 0; }
a { color: inherit; }
button { font: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #a24932; outline-offset: 4px; }
.shell { width: min(100% - 88px, 1192px); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip:focus { position: fixed; z-index: 5; top: 12px; left: 12px; background: white; padding: 8px 16px; }

.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 1rem; font-weight: 780; line-height: 1.08; text-decoration: none; }
.brand-mark { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; background: var(--blue); color: white; font: 1.9rem/1 Georgia, serif; }
nav { display: flex; align-items: center; gap: clamp(20px, 4vw, 50px); }
nav a, .footer a { text-underline-offset: 4px; text-decoration: none; }
nav a:hover, .footer a:hover { text-decoration: underline; }
nav a { font-size: .94rem; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 17px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; text-align: center; font-size: .92rem; font-weight: 690; line-height: 1.35; }
.button-small { min-height: 40px; padding: 7px 18px; }
.button-outline { border-color: #b7b8c2; background: transparent; }
.button-outline:hover { background: #fffaf3; border-color: var(--ink); }
.button-primary { background: var(--blue); color: white; }
.button-primary:hover { background: var(--blue-dark); }
.text-link { font-size: .94rem; font-weight: 650; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.text-link:hover { color: var(--blue-dark); }

.hero { padding-block: clamp(40px, 5vw, 72px) 52px; display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr); gap: clamp(30px, 5vw, 74px); align-items: center; }
.eyebrow { display: flex; align-items: center; gap: 9px; font-size: .82rem; font-weight: 720; color: var(--blue-dark); letter-spacing: .07em; text-transform: uppercase; }
.eyebrow-line { width: 24px; height: 2px; background: currentColor; flex: none; }
h1, h2 { font-family: Georgia, Cambria, serif; font-weight: 700; letter-spacing: -.048em; line-height: 1.06; }
h1 { font-size: clamp(2.8rem, 5.95vw, 5.4rem); }
.hero h1 { margin: 13px 0 20px; }
.hero h1 span { color: #aa4e33; }
.hero-lead { max-width: 47ch; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.19rem); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 25px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 5px 21px; margin-top: 24px; list-style: none; padding: 0; color: var(--muted); font-size: .86rem; }
.hero-facts li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 7px; vertical-align: .14em; background: #a64b35; border-radius: 50%; }
.hero-figure { position: relative; border-radius: 24px; background: #d9dce9; min-width: 0; min-height: 285px; overflow: hidden; }
.hero-figure img { width: 100%; height: auto; aspect-ratio: 1.22; object-fit: cover; }
.hero-figure figcaption { position: absolute; bottom: 16px; left: 16px; display: grid; gap: 3px; width: max-content; max-width: calc(100% - 32px); padding: 13px 18px; border-radius: 10px; background: var(--white); box-shadow: 0 4px 22px #17244622; }
.phrase-index { font-size: .8rem; color: var(--blue-dark); font-weight: 700; }
.serbian { font: 700 clamp(1.15rem, 2vw, 1.45rem)/1.18 Georgia, serif; }
.phrase-meaning { color: var(--muted); font-size: .86rem; }

.format-band { display: grid; grid-template-columns: repeat(3, 1fr); padding: 23px 15px; border-block: 1px solid var(--line); }
.format-band > div { padding: 0 17px; }
.format-band > div + div { border-left: 1px solid var(--line); }
.format-sign { display: inline-grid; min-width: 30px; height: 30px; place-items: center; padding-inline: 3px; border-radius: 7px; background: #e9eeff; color: var(--blue-dark); font-weight: 750; font-size: .9rem; }
.format-band h3 { display: inline-block; margin-inline-start: 7px; font-size: 1rem; }
.format-band p { margin: 7px 0 0; color: var(--muted); }

.section { padding-block: clamp(54px, 7vw, 94px); }
.section h2, .practice h2 { font-size: clamp(2.15rem, 4.2vw, 3.65rem); margin-top: 9px; }
.section-intro { display: grid; grid-template-columns: 1fr minmax(250px, 37%); gap: 20px; align-items: end; margin-bottom: 24px; }
.section-intro > p { color: var(--muted); }
.level-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.level-controls button { min-height: 44px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 13px; color: var(--ink); font-weight: 750; background: var(--white); cursor: pointer; }
.level-controls button span { font-weight: 490; font-size: .88rem; }
.level-controls button:hover { border-color: var(--blue); }
.level-controls button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.level-panel { display: grid; grid-template-columns: minmax(220px, 30%) 1fr; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--white); }
.level-panel + .level-panel { margin-top: 12px; }
.level-panel[hidden] + .level-panel { margin-top: 0; }
.level-aside { padding: 24px; background: #e9eeff; }
[data-panel="a2"] .level-aside { background: #fbe3d6; }
[data-panel="b1"] .level-aside { background: #ebefe1; }
.level-code { display: block; font: 700 2.85rem/1 Georgia, serif; color: var(--blue-dark); }
.level-aside h3 { margin-top: 12px; font-size: 1.16rem; }
.level-aside p { color: var(--muted); margin-top: 5px; }
.lesson-list { list-style: none; padding: 2px 18px; }
.lesson-list li + li { border-top: 1px solid var(--line); }
.lesson-list a { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; min-height: 66px; padding-block: 9px; text-decoration: none; }
.lesson-list a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.lesson-icon { display: grid; place-items: center; min-height: 33px; border-radius: 7px; background: #f0f1f7; color: var(--ink); font-size: .87rem; font-weight: 700; }
.lesson-list strong, .lesson-list small { display: block; }
.lesson-list small { color: var(--muted); font-size: .87rem; line-height: 1.4; }
.lesson-access { color: var(--blue-dark); font-size: .89rem; white-space: nowrap; }

.practice { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(24px, 7vw, 90px); padding: clamp(24px, 5vw, 60px); border-radius: 20px; background: var(--peach); align-items: center; }
.practice-copy > p:not(.eyebrow) { margin-top: 13px; }
.practice .button { margin-top: 19px; border-color: #916754; }
.dialogue { display: grid; gap: 6px; }
.dialogue p { display: grid; grid-template-columns: 5.8rem 1fr; align-items: baseline; gap: 0 8px; background: #fff5ed; border-radius: 10px; padding: 9px 12px; }
.dialogue span, .dialogue small { color: #5e4b50; font-size: .86rem; }
.dialogue small { grid-column: 2; }
.questions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 2px; }
.faq summary { cursor: pointer; font-weight: 680; padding: 4px 6px; }
.faq details p { padding: 7px 6px; color: var(--muted); }
.footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding-block: 20px; }
.footer-inner > span, .footer-inner > a:last-child { color: var(--muted); font-size: .94rem; }

.account-main { display: grid; place-items: start center; padding-block: clamp(36px, 10vw, 118px); }
.account-card { width: min(100%, 485px); padding: clamp(24px, 5vw, 45px); border: 1px solid var(--line); background: var(--white); border-radius: 18px; }
.account-card h1, .cabinet-main h1 { margin: 11px 0 16px; font-size: clamp(2.55rem, 5.5vw, 4.6rem); }
.account-card p:not(.eyebrow) { color: var(--muted); }
.login-form { display: grid; margin-block: 22px; gap: 8px; }
.login-form label { font-size: .94rem; font-weight: 690; }
.login-form input { width: 100%; min-height: 44px; border: 1px solid #a9adba; border-radius: 8px; padding: 8px 11px; font: inherit; color: var(--ink); background: white; }
.login-form input + label { margin-top: 4px; }
.login-form button { justify-self: stretch; margin-top: 6px; cursor: pointer; }
.login-form button:disabled { background: #57678d; cursor: default; }
.login-form .login-message { color: #812c23; }
.login-timer { font-variant-numeric: tabular-nums; }
.account-hint { font-size: .9rem; border-top: 1px solid var(--line); padding-top: 15px; }

@media (max-width: 880px) {
  .shell { width: calc(100% - 46px); }
  .hero { gap: 25px; }
  .hero-figure img { aspect-ratio: .98; }
  .format-band { padding-inline: 0; }
  .format-band > div { padding-inline: 12px; }
}

@media (max-width: 700px) {
  .shell { width: calc(100% - 36px); }
  .topbar-inner { min-height: 64px; gap: 12px; }
  nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-block: 35px; }
  .hero-figure { border-radius: 17px; }
  .hero-figure img { aspect-ratio: 1.23; }
  .format-band { grid-template-columns: 1fr; padding: 0; }
  .format-band > div { padding: 13px 3px; }
  .format-band > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .format-band p { margin-top: 4px; }
  .section-intro, .level-panel, .practice, .questions { grid-template-columns: 1fr; }
  .level-aside { padding: 17px; }
  .level-code { font-size: 2rem; }
  .level-aside h3 { margin-top: 6px; }
  .lesson-list { padding-inline: 11px; }
  .lesson-list a { grid-template-columns: 32px 1fr; gap: 8px; }
  .lesson-access { grid-column: 2; }
}

@media (max-width: 360px) {
  .shell { width: calc(100% - 26px); }
  h1 { font-size: 2.45rem; }
  .dialogue p { grid-template-columns: 1fr; }
  .dialogue small { grid-column: 1; }
}

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