:root {
  color-scheme: light;
  --page: #f6f7f2;
  --paper: #fffefa;
  --ink: #162e23;
  --muted: #4c6055;
  --forest: #17372b;
  --edge: #d9e0d6;
  --orange: #ffd18c;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); line-height: 1.55; }
button, input { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #2b7956; outline-offset: 4px; }
h1:focus, main:focus, .feedback:focus { outline: none; }
.frame { width: min(70rem, calc(100% - 3rem)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--edge); background: var(--paper); }
.topbar { display: flex; align-items: center; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--forest); font-size: 1.12rem; font-weight: 760; text-decoration: none; }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: .14rem; width: 2.2rem; height: 2.2rem; padding: .5rem; border-radius: .65rem; color: var(--orange); background: var(--forest); }
.brand-mark i { height: .88rem; border: 1.5px solid currentColor; border-radius: 2px 3px 2px 1px; transform: skewY(9deg); }
.brand-mark i + i { border-radius: 3px 2px 1px 2px; transform: skewY(-9deg); }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { margin-left: 1.5rem; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  position: relative;
  min-height: 23rem;
  isolation: isolate;
  margin-top: 2.4rem;
  overflow: hidden;
  border-radius: 1.6rem;
  background: #17372b;
  color: #fffaf0;
}
.hero-copy { padding: 3.25rem 0 3.4rem 3.4rem; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.6rem); font-weight: 760; line-height: 1.04; letter-spacing: -.065em; margin: 0; max-width: 14ch; text-wrap: balance; }
.hero p { color: #e5eee3; font-size: clamp(1rem, 1.65vw, 1.16rem); max-width: 32rem; margin: 1.2rem 0 1.65rem; }
.hero-art { min-width: 0; position: relative; width: 100%; height: 100%; min-height: 18rem; background: radial-gradient(ellipse at 55% 60%, #38684d, transparent 66%); }
.hero-art::before { content: ""; position: absolute; inset: 0; opacity: .5; background-image: radial-gradient(#9db99c 1px, transparent 1px); background-size: 14px 14px; mask-image: radial-gradient(ellipse at 60% 60%, black, transparent 72%); }
.art-orbit { position: absolute; top: 12%; right: 12%; width: 72%; aspect-ratio: 1; border: 1px solid #9fc49b85; border-radius: 50%; }
.art-orbit::after { content: ""; position: absolute; inset: 11%; border-radius: inherit; border: 1px dashed #acd4a97a; }
.art-card { position: absolute; box-shadow: 0 1.35rem 2.9rem #0b211a7a; }
.art-laws { display: grid; justify-items: center; align-content: center; gap: .55rem; top: 17%; right: 17%; width: 27%; aspect-ratio: .77; border-radius: .8rem; background: #ffd796; color: #593d19; transform: rotate(12deg); }
.art-scales { font: 3.2rem/1 "Segoe UI Symbol", serif; }
.art-laws i { display: block; background: #98653580; height: 2px; width: 47%; }
.art-laws i:last-child { width: 34%; }
.art-book { display: flex; top: 53%; right: 22%; width: 59%; height: 35%; transform: rotate(-12deg); border-radius: 1.05rem; background: #bb8350; padding: 0 .35rem .35rem; }
.art-page { display: grid; gap: .45rem; width: 50%; align-content: center; padding: 1rem; border-radius: .9rem .5rem .4rem .65rem; border-right: 1px solid #d0bb9f; background: #fff2d8; }
.art-page + .art-page { border: 0; background: #f8e8c6; border-radius: .5rem .9rem .65rem .4rem; }
.art-page i { display: block; background: #ae94738c; height: 2px; width: 80%; }
.art-page i:nth-child(2) { width: 94%; }
.art-page i:last-child { width: 70%; }
.art-code { top: 23%; right: 43%; display: grid; place-content: center; width: 38%; aspect-ratio: 1.35; border: 1px solid #bad6b4; border-radius: .85rem; background: #bcdabe; color: #214634; transform: rotate(-11deg); }
.art-code > span { padding-top: .6rem; font: 760 clamp(1.6rem, 4vw, 3.35rem)/1 Consolas, monospace; }
.art-toolbar { display: flex; gap: .27rem; position: absolute; inset: .66rem auto auto .7rem; }
.art-toolbar i { width: .36rem; height: .36rem; border-radius: 50%; background: #4e7860; }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 2.8rem; padding: .7rem 1.1rem; border: 1px solid transparent; border-radius: .63rem; font-weight: 700; line-height: 1.25; text-align: center; text-decoration: none; }
.button-accent { background: var(--orange); color: #392414; }
.button-accent:hover { background: #ffe0ad; }
.hero :focus-visible { outline-color: #fff0ce; }
.button-dark { background: var(--forest); color: #fff; }
.button-dark:not(:disabled):hover { background: #24513f; }
.button-subtle { background: #ebf1e9; color: #1d4332; border-color: #dbe4d6; }
.button-subtle:hover { background: #e0ecd9; }

.subjects { padding: 2.5rem 0 2.25rem; }
.section-head { display: flex; align-items: baseline; gap: 1rem; justify-content: space-between; margin-bottom: 1rem; }
.section-head h2, .review h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.1rem); letter-spacing: -.035em; line-height: 1.18; }
.section-head p { margin: 0; color: var(--muted); }
.subject-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.subject-card { display: flex; flex-direction: column; min-height: 15rem; padding: 1.35rem; border-radius: 1.1rem; background: var(--paper); border: 1px solid var(--edge); box-shadow: 0 .35rem 1.4rem #19392c08; }
.section-icon { display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: .76rem; font: 750 1.35rem/1 "Segoe UI Symbol", system-ui; }
.icon-code { background: #e3eaf8; color: #334975; font: 750 1rem/1 Consolas, monospace; }
.icon-book { background: #f8e9ce; color: #694721; }
.icon-scales { background: #e1efdf; color: #305d42; }
.subject-card h3 { margin: .8rem 0 .3rem; font-size: 1.25rem; line-height: 1.2; letter-spacing: -.025em; }
.subject-card p { color: var(--muted); margin: 0 0 1.1rem; }
.subject-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.subject-meta { color: var(--muted); font-size: .9rem; margin-top: auto; margin-bottom: .6rem; }
.site-footer { color: var(--muted); margin-top: .4rem; padding: 1rem 0 1.8rem; border-top: 1px solid var(--edge); font-size: .875rem; }

.quiz-shell { max-width: 46rem; margin: 1.9rem auto 2.75rem; }
.text-button { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .55rem .05rem; margin-bottom: .55rem; background: transparent; color: #315e45; border: 0; font-weight: 700; text-decoration: none; }
.text-button:hover { text-decoration: underline; }
.quiz-card { background: var(--paper); border: 1px solid var(--edge); border-radius: 1.2rem; padding: clamp(1.05rem, 3.75vw, 2.25rem); box-shadow: 0 .5rem 2.2rem #17372b09; }
.quiz-step { display: flex; justify-content: space-between; gap: 1rem; align-items: start; font-size: .94rem; font-weight: 650; color: var(--muted); }
.quiz-step span:last-child { white-space: nowrap; }
progress { appearance: none; display: block; width: 100%; height: .45rem; border: 0; margin: .7rem 0 1.5rem; border-radius: 2rem; color: #367353; background: #e1ebdf; overflow: hidden; }
progress::-webkit-progress-bar { background: #e1ebdf; }
progress::-webkit-progress-value { background: #367353; border-radius: inherit; }
progress::-moz-progress-bar { background: #367353; }
.quiz-card h1 { margin: 0 0 1.3rem; font-size: clamp(1.6rem, 4vw, 2.35rem); line-height: 1.15; letter-spacing: -.035em; }
fieldset { display: grid; gap: .65rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.choice { display: grid; grid-template-columns: auto 2rem 1fr; align-items: center; gap: .75rem; padding: .75rem .9rem; border: 1px solid var(--edge); border-radius: .65rem; cursor: pointer; min-height: 3.4rem; }
.choice:hover { background: #f5f8f3; }
.choice:has(input:checked) { border-color: #477c58; background: #edf5eb; }
.choice input { accent-color: #337453; width: 1.05rem; height: 1.05rem; margin: 0; }
.choice-letter { display: grid; place-items: center; border-radius: .38rem; width: 2rem; height: 2rem; background: #eaf0e8; color: #395642; font-weight: 720; }
fieldset:disabled .choice { cursor: default; }
fieldset .choice.correct { border-color: #528964; background: #e5f4e7; }
fieldset .choice.incorrect { border-color: #b66d5e; background: #faece7; }
.feedback { border-radius: .65rem; padding: .85rem 1rem; margin-top: 1rem; background: #eff4ed; }
.feedback[hidden] { display: none; }
.feedback-incorrect { background: #f9eee5; }
.feedback p { margin: .25rem 0; }
.source-link { display: inline-block; color: #285d44; text-decoration-thickness: .06em; text-underline-offset: .16em; margin-top: .25rem; font-size: .94rem; }
.quiz-next { display: flex; justify-content: flex-end; margin-top: 1.2rem; }
.result-card .result-subject { color: var(--muted); font-size: .95rem; font-weight: 700; margin: 0 0 .4rem; }
.result-card h1 { margin-bottom: .65rem; }
.score { margin: 0; font-size: 2rem; color: #365745; line-height: 1; }
.score strong { font-size: clamp(3.1rem, 9vw, 5.3rem); color: var(--forest); }
.result-note { margin: 1rem 0; color: var(--muted); }
.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.review { margin-top: 1.7rem; border-top: 1px solid var(--edge); padding-top: 1.25rem; }
.review h2 { font-size: 1.35rem; margin-bottom: .75rem; }
.review-item { margin-top: .55rem; border: 1px solid var(--edge); border-radius: .6rem; padding: .6rem .85rem; }
.review-item summary { font-weight: 650; cursor: pointer; min-height: 1.7rem; }
.review-copy p { margin: .35rem 0; }

.lectures-shell { max-width: 61rem; margin: clamp(1rem, 3vw, 2rem) auto 2.75rem; }
.lecture-series {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: #e6efe5;
  border: 1px solid #d6e3d4;
  border-radius: 1.15rem;
}
.lecture-series h1, .reader-card h1 { margin: .85rem 0 .45rem; font-size: clamp(1.95rem, 5vw, 3rem); letter-spacing: -.045em; line-height: 1.1; text-wrap: balance; }
.lecture-series .button { flex: 0 0 auto; background: var(--paper); }
.lecture-series p, .lecture-entry p { margin: 0; color: var(--muted); }
.lecture-index { display: grid; gap: .8rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.lecture-entry { display: block; padding: clamp(1rem, 2.9vw, 1.4rem); border: 1px solid var(--edge); border-radius: .85rem; background: var(--paper); text-decoration: none; }
.lecture-entry:hover { border-color: #7fa78c; background: #f4f8f1; }
.lecture-entry h2 { margin: 0 0 .3rem; font-size: clamp(1.08rem, 2.4vw, 1.25rem); line-height: 1.25; }
.lecture-layout { display: grid; grid-template-columns: minmax(0, 1fr) 15.5rem; gap: 1rem; align-items: start; }
.reader-card, .lecture-nav { background: var(--paper); border: 1px solid var(--edge); border-radius: 1.1rem; }
.reader-card { min-width: 0; padding: clamp(1.1rem, 3.8vw, 2.15rem); }
.reader-card h1 { margin-top: 0; }
.reader-intro { margin: .75rem 0 1.55rem; color: var(--muted); font-size: 1.1rem; line-height: 1.5; }
.reader-section { margin-top: 1.45rem; }
.reader-section h2, .lecture-practice h2, .lecture-sources h2 { margin: 0 0 .48rem; font-size: 1.22rem; line-height: 1.25; }
.reader-section p, .lecture-practice p { margin: 0 0 .65rem; line-height: 1.68; overflow-wrap: anywhere; }
.reader-section pre { margin: .7rem 0; padding: .85rem 1rem; overflow-x: auto; border-radius: .6rem; background: var(--forest); color: #ffefcd; font: .95rem/1.6 Consolas, monospace; }
.reader-section code { font: inherit; }
.lecture-practice { margin-top: 1.45rem; padding: 1rem 1.1rem; border: 1px solid #d7e5d6; border-radius: .8rem; background: #eff5ed; }
.lecture-practice summary { width: fit-content; min-height: 2.65rem; padding: .45rem 0; color: #29563d; font-weight: 700; cursor: pointer; }
.lecture-practice details p { margin-bottom: 0; }
.lecture-sources { margin-top: 1.5rem; }
.lecture-sources .source-link { display: block; width: fit-content; margin: .25rem 0; }
.lecture-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--edge); }
.lecture-nav { padding: 1rem; }
.lecture-nav h2 { margin: 0 0 .55rem; font-size: 1rem; }
.lecture-nav ol { display: grid; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.lecture-nav a { display: block; min-height: 2.75rem; padding: .52rem .6rem; border-radius: .5rem; font-size: .93rem; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; }
.lecture-nav a:hover, .lecture-nav a[aria-current] { background: #e7f0e5; color: #224b36; }
.lecture-nav a[aria-current] { font-weight: 700; box-shadow: inset 3px 0 #397759; }

.account-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem 1.1rem; margin-left: auto; padding: .65rem 0 .65rem .9rem; }
.account-tools > a { color: var(--forest); font-size: .94rem; font-weight: 690; text-decoration: none; }
.account-tools > a:hover { text-decoration: underline; }
.load-note { margin: 2rem 0; color: var(--muted); }
.account-shell, .report-shell { margin: clamp(1rem, 4vw, 2.5rem) auto 2.5rem; }
.account-shell { max-width: 36rem; padding: clamp(1.15rem, 5vw, 2.3rem); border: 1px solid var(--edge); border-radius: 1.1rem; background: var(--paper); }
.account-shell h1, .report-shell h1 { margin: 0 0 .45rem; font-size: clamp(1.8rem, 4vw, 2.65rem); line-height: 1.14; letter-spacing: -.035em; }
.account-shell > p, .report-subtitle { margin: .55rem 0 1.2rem; color: var(--muted); }
.registration-form, .report-search { display: grid; gap: .45rem; }
.registration-form > .button { justify-self: start; margin-top: .55rem; }
.registration-form > label, .report-search > label { font-weight: 650; }
.registration-form input, .report-search input { min-height: 2.8rem; padding: .55rem .7rem; border: 1px solid #aebfb1; border-radius: .55rem; background: #fff; color: var(--ink); }
.action-error { margin: .45rem 0 0; color: #902f26; flex-basis: 100%; font-size: .94rem; }
.read-label { display: inline-block; margin-top: .5rem; color: #356449; font-weight: 670; font-size: .9rem; }
.lecture-actions .button[data-mark-read]:disabled { opacity: .8; }
.report-shell h2 { margin: 1.55rem 0 .7rem; font-size: clamp(1.2rem, 3vw, 1.55rem); }
.report-search { margin: 1.1rem 0; }
.report-search > div { display: flex; flex-wrap: wrap; gap: .55rem; }
.report-search input { width: min(100%, 23rem); min-width: 0; }
.report-table { overflow-x: auto; border: 1px solid var(--edge); border-radius: .85rem; background: var(--paper); }
.report-table table { width: 100%; border-collapse: collapse; text-align: left; }
.report-table th, .report-table td { padding: .7rem .9rem; vertical-align: top; border-bottom: 1px solid var(--edge); }
.report-table thead { background: #e7f0e5; color: #254f39; }
.report-table thead th { min-width: 7rem; }
.report-table tbody tr:last-child > * { border-bottom: 0; }
.report-table tbody th { font-weight: 640; min-width: 11rem; }
.report-table th a { color: #27583c; text-underline-offset: .16em; }
.report-table span { display: block; color: var(--muted); font-weight: 400; font-size: .9rem; overflow-wrap: anywhere; }
.report-empty { margin: .7rem 0; padding: 1rem; border: 1px solid var(--edge); border-radius: .7rem; background: var(--paper); color: var(--muted); }
.report-pagination { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.report-pagination:empty { display: none; }
.report-attempt { margin-bottom: .65rem; border: 1px solid var(--edge); border-radius: .75rem; overflow: hidden; background: var(--paper); }
.report-attempt summary { padding: .85rem 1rem; cursor: pointer; }
.report-attempt summary span { display: block; margin-left: 1.05rem; color: var(--muted); font-size: .94rem; }
.attempt-details { padding: .15rem 1rem 1rem; border-top: 1px solid var(--edge); }
.attempt-details p { margin: .7rem 0 .25rem; }
.attempt-details ul { margin: .5rem 0 0; padding-left: 1.4rem; }
.attempt-details li { margin-top: .65rem; }
.attempt-details li span { display: block; overflow-wrap: anywhere; }

@media (max-width: 52rem) {
  .frame { width: calc(100% - 2rem); }
  .hero { margin-top: 1.6rem; min-height: 19rem; grid-template-columns: 1.35fr 1fr; }
  .hero-copy { padding: 2rem 0 2.2rem 2rem; }
  .subject-grid { gap: .7rem; }
  .subject-card { padding: .95rem; }
  .art-scales { font-size: 2.3rem; }
  .lecture-layout { grid-template-columns: 1fr; }
}

@media (max-width: 36rem) {
  .topbar { min-height: 3.75rem; flex-wrap: wrap; padding-block: .65rem; }
  .account-tools { margin-left: 0; padding: .3rem 0 0; width: 100%; }
  .hero { grid-template-columns: 1fr; min-height: 0; margin-top: 1rem; border-radius: 1.1rem; }
  .hero-copy { padding: 1.5rem 1.25rem 0; }
  .hero h1 { max-width: 14ch; font-size: clamp(2.2rem, 9.8vw, 3.4rem); }
  .hero p { margin: .85rem 0 1.05rem; }
  .hero-art { min-height: 10rem; max-width: 20rem; margin-inline: auto; }
  .art-orbit { top: -38%; }
  .art-laws { top: 10%; right: 16%; width: 21%; }
  .art-book { width: 45%; height: 43%; top: 49%; right: 24%; }
  .art-code { width: 30%; top: 20%; right: 47%; }
  .art-page { padding: .55rem; gap: .3rem; }
  .art-scales { font-size: 1.55rem; }
  .art-laws i { height: 1px; }
  .art-toolbar { inset: .46rem auto auto .45rem; }
  .art-toolbar i { height: .28rem; width: .28rem; }
  .subjects { padding: 1.55rem 0 1.35rem; }
  .section-head { display: block; }
  .section-head p { margin-top: .3rem; }
  .subject-grid { grid-template-columns: 1fr; }
  .subject-card { min-height: 0; padding: 1.15rem; }
  .quiz-shell { margin-top: 1rem; }
  .choice { padding: .6rem; gap: .45rem; }
  .lecture-series { align-items: start; flex-direction: column; }
}
