:root {
  --forest: #244f3f;
  --forest-dark: #183c2e;
  --cream: #f8f6ee;
  --border: #c8d0bf;
  --muted: #485f52;
}
[hidden] { display: none !important; }
html { scroll-padding-top: 5rem; }
body { background: var(--cream); }
.wrap { max-width: 1200px; padding-right: clamp(1rem,4vw,3rem); padding-left: clamp(1rem,4vw,3rem); }
.site-head { background: #f9f8f0; border-color: #c7cdbc; }
.site-head .wrap { height: 4.25rem; }
.brand { font-size: 1.3rem; font-weight: 650; gap: .6rem; }
.brand .mark { width: 1.9rem; height: 1.9rem; flex-basis: 1.9rem; }
.nav { font-size: 1.03rem; gap: clamp(1.3rem,3vw,2.7rem); color: #364b3f; }
.mini-dl { font-size: 1rem; font-weight: 600; padding: .35rem 1rem; }
.download-glyph { display: block; width: 1.2em; height: 1.2em; flex: none; }
.hero { background: #19392e; isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background:
  linear-gradient(90deg,rgba(15,43,33,.98),rgba(16,44,32,.91) 39%,rgba(17,45,34,.62) 70%,rgba(17,40,30,.57)),
  url('assets/library.jpg') center 48% / cover no-repeat; }
.hero::after { opacity: .04; z-index: -1; }
.hero .wrap { padding-top: clamp(2.1rem,4.2vw,4rem); padding-bottom: clamp(2.4rem,4.5vw,4.5rem); }
.hero h1 { font-family: 'Noto Serif CJK SC',var(--serif); font-size: clamp(2.85rem,5.3vw,4.8rem); line-height: 1.22; color: #fff8e4; }
.hero-lede { font-size: clamp(1.04rem,1.7vw,1.25rem); color: #e4ede1; margin-top: 1.1rem; }
.hero-actions { gap: .65rem; }
.btn { font-size: 1rem; font-weight: 600; justify-content: center; min-height: 2.85rem; padding: .55rem 1.3rem; }
.btn-primary { background: #e0bd77; color: #21352a; border-color: #e0bd77; }
.btn-primary:hover { background: #edce93; }
.btn-ghost { border-color: #899f8c; color: #fff8e4; }
.stack { width: min(100%, 25rem); max-width: none; }
.stack .sheet { border-radius: 18px; pointer-events: none; }
#hero-card { position: relative; min-height: 20rem; transform: rotate(-1deg); }
#hero-card .kc-source { display: none; }
.sec { padding: clamp(2.5rem,5vw,4.7rem) 0; }
.sec-head { margin-bottom: 1.25rem; }
.sec-head h2 { color: #254b3b; font-size: clamp(1.85rem,3.1vw,2.65rem); font-family: 'Noto Serif CJK SC',var(--serif); }
.card-demo { background: var(--card-2); }
.course-picker { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: .8rem 1.5rem; border-top: 1px solid var(--line); padding-top: .85rem; }
.course-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.course-group legend { padding: 0; margin-bottom: .35rem; color: var(--muted); font-weight: 600; }
.subject-group { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.course-group:nth-child(2) .subject-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.subject-group button {
  min-height: 2.65rem;
  padding: .45rem .4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffaf0;
  color: #253d2e;
  cursor: pointer;
  font: 550 1rem/1.35 var(--sans);
}
.subject-group button:hover { background: #edf0e7; }
.subject-group button[aria-pressed="true"] { border-color: var(--forest); background: var(--forest); color: #fff8e7; }
.demo-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .15rem 1rem; margin-block: .85rem 1rem; color: var(--muted); }
.sample-filters { margin-bottom: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.sample-tools { display: flex; flex-wrap: wrap; align-items: stretch; gap: .5rem; }
.sample-tools svg { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sample-search, .sample-tools button { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; padding-inline: .85rem; border: 1px solid var(--border); border-radius: 5px; background: var(--card); color: var(--forest-dark); font: inherit; }
.sample-search { flex: 1 1 15rem; max-width: 32rem; min-width: 0; cursor: text; }
.sample-search input { width: 100%; min-width: 0; padding: .5rem 0; border: 0; background: transparent; color: inherit; font: inherit; }
.sample-search input:focus { outline: none; }
.sample-search:focus-within, .sample-filters button:focus-visible, .sample-facets select:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.sample-tools button { font-weight: 600; cursor: pointer; }
.sample-tools button:hover { border-color: var(--forest); }
.sample-tools button[aria-expanded="true"] { color: var(--forest); border-color: var(--forest); }
.sample-tools button[aria-pressed="true"] { background: var(--forest); color: white; border-color: var(--forest); }
.sample-facets { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .7rem 1rem; padding: 1rem 0 .3rem; }
.sample-facets label { display: grid; gap: .25rem; color: var(--muted); font-weight: 600; }
.sample-facets select { width: 100%; min-width: 0; min-height: 2.65rem; padding: .35rem .45rem; border: 1px solid var(--border); border-radius: 4px; background: var(--card); color: var(--forest-dark); font: 400 1rem var(--sans); }
.sample-results { display: flex; align-items: center; gap: 1rem; min-height: 2rem; margin-top: .35rem; color: var(--muted); }
.sample-results button { padding: .2rem 0; border: 0; background: none; color: var(--forest); font: inherit; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.sample-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.8rem, 1.8vw, 1.3rem); }
.sample-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(.75rem, 1.75vw, 1.25rem);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
}
.sample-header { display: flex; justify-content: space-between; align-items: center; gap: .7rem; min-height: 2.5rem; margin-bottom: .7rem; }
.sample-header h3 { display: flex; align-items: center; gap: .55rem; font-size: clamp(1.2rem, 2.1vw, 1.45rem); line-height: 1.25; }
.sample-header h3::before { content: ''; width: .55rem; height: .55rem; flex: none; border-radius: 50%; background: var(--kc-accent, #2e7d6f); }
.sample-stage { position: relative; flex: 1; display: flex; flex-direction: column; padding: clamp(.4rem, 1.1vw, .85rem); border: 1px dashed var(--line); border-radius: 3px; background: var(--card-2); }
.sample-stage .kc-card { flex: 1; min-height: var(--sample-height, 18rem); }
.sample-stage .sample-measure { position: absolute; top: 0; left: 0; min-height: 0; visibility: hidden; }
.sample-stage .kc-card-type { display: none; }
.sample-next { border: 1px solid var(--line); background: #fffaf0; color: #244e37; border-radius: 4px; cursor: pointer; padding: .3rem .7rem; min-height: 2.35rem; font: inherit; white-space: nowrap; }
.sample-next:hover { border-color: var(--forest); background: #f6f4e9; }
.text-link { display: inline-flex; align-items: center; gap: .4rem; color: #315e43; font-weight: 600; text-underline-offset: .22rem; font-size: 1rem; }
#uses { background: #eff1e7; }
#uses .sec-head { max-width: none; margin: 0 0 clamp(1.6rem,3.5vw,2.75rem); padding-bottom: .85rem; border-bottom: 1px solid var(--border); }
.study-cycle {
  --dial: clamp(14rem,24vw,18rem);
  display: grid;
  grid-template-columns: minmax(0,1fr) var(--dial) minmax(0,1fr);
  grid-template-areas: "learn dial summarize" "practice practice practice";
  column-gap: clamp(.3rem,1.25vw,1rem);
  align-items: start;
  max-width: 55rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.study-cycle::before {
  content: "";
  grid-area: dial;
  justify-self: center;
  width: var(--dial);
  max-width: 100%;
  aspect-ratio: 240 / 228;
  background: url("assets/study-cycle.svg") center / contain no-repeat;
}
.study-cycle li { min-width: 0; }
.study-cycle h3 { color: var(--stage-color); font: 650 clamp(1.4rem,2.5vw,1.9rem)/1.3 var(--serif); }
.study-cycle p { margin: .35rem 0 0; color: #344c40; font-size: clamp(1rem,1.35vw,1.12rem); line-height: 1.65; text-wrap: balance; }
.cycle-learn, .cycle-summarize { padding-top: calc(var(--dial) * .19); max-width: 16em; }
.cycle-learn { grid-area: learn; --stage-color: #326347; justify-self: end; text-align: right; }
.cycle-summarize { grid-area: summarize; --stage-color: #405e7b; }
.cycle-practice { grid-area: practice; --stage-color: #935a3d; justify-self: center; text-align: center; }
@media (max-width: 650px) {
  .study-cycle {
    --dial: clamp(11.5rem,55vw,15rem);
    max-width: 29rem;
    grid-template-columns: repeat(2,minmax(0,1fr));
    grid-template-areas: "learn summarize" "dial dial" "practice practice";
    column-gap: clamp(.8rem,4vw,1.65rem);
    row-gap: .25rem;
  }
  .cycle-learn, .cycle-summarize { justify-self: center; padding-top: 0; text-align: center; }
}
.download { display: flex; min-height: calc(100svh - 9.5rem); color: #f2efdf; background: radial-gradient(ellipse at 50% 36%, #2e5342, #193d30 67%); }
.download > .wrap { width: 100%; display: flex; flex-direction: column; }
.download .sec-head { max-width: none; margin: 0; padding-bottom: 1rem; border-bottom: 1px solid #627b6a; }
.download .sec-head h2 { color: #faf4df; }
.download-stage { flex: 1; display: grid; align-content: center; justify-items: center; text-align: center; padding: clamp(2.4rem, 5vw, 4.5rem) 0 clamp(1.8rem, 4vw, 3.3rem); }
.download-subject { position: relative; display: inline-flex; max-width: 100%; align-items: center; gap: .65rem; min-height: 2.75rem; padding: 0 .15rem; }
#download-title { color: #fff8e7; font: 600 clamp(1.6rem, 4vw, 3.1rem)/1.32 'Noto Serif CJK SC', var(--serif); }
.download-subject::after { content: ''; width: .54rem; height: .54rem; flex: none; border: solid #e5c68d; border-width: 0 2px 2px 0; transform: translateY(-.15rem) rotate(45deg); }
.download-subject select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font: 1rem var(--sans); }
.package-button { display: inline-flex; align-items: center; justify-content: center; gap: .65rem; max-width: 100%; min-height: 3.7rem; margin-top: 1.35rem; padding: .65rem clamp(1.6rem, 4vw, 3rem); border-radius: 3rem; color: #183a2c; background: #f5e7be; box-shadow: 0 5px 14px #10291f55; font: 650 clamp(1.25rem, 2.3vw, 1.65rem)/1.3 var(--sans); text-decoration: none; }
.package-button .download-glyph { width: 2rem; height: 2rem; }
.package-button:hover { background: #fff1cb; }
.package-button:active { background: #e6d4a7; }
.package-status { margin-top: 1.35rem; color: #d6ded8; font: 550 1.15rem/1.5 var(--sans); }
.download-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25rem 1rem; min-height: 1.5em; margin-top: .65rem; color: #d4dfd2; font-size: 1rem; line-height: 1.5; }
.download-secondary { padding: .25rem .1rem; border: 0; background: transparent; color: #f4e8c5; font: inherit; text-decoration: underline; text-underline-offset: .22em; cursor: pointer; }
.download-secondary:focus-visible { outline: 2px solid #f1d594; outline-offset: 3px; }
.devices { display: flex; justify-content: center; align-items: flex-start; gap: clamp(.75rem, 3.4vw, 2.8rem); margin: clamp(1.6rem, 3.5vw, 2.9rem) 0 0; min-width: 0; max-width: 100%; padding: 0; border: 0; }
.devices label { position: relative; display: flex; flex-direction: column; align-items: center; }
.devices input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.devices span { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.85rem; padding: .35rem .2rem; border-bottom: 2px solid transparent; color: #e7eee7; font: 550 1.075rem/1.25 var(--sans); cursor: pointer; }
.devices img { flex: none; object-fit: contain; filter: invert(92%); }
.devices input:checked + span { color: #fff5d8; border-color: #e6c382; }
.devices input:checked + span img { filter: invert(100%); }
.devices label:hover input:enabled + span { border-color: #e6c382; }
.devices input:disabled + span { color: #a7aaa9; cursor: default; }
.devices input:disabled + span img { filter: invert(66%); }
.platform-status { color: #bdbdbd; font: .875rem/1.4 var(--sans); white-space: nowrap; }
.devices input:enabled ~ .platform-status { display: none; }
.download-subject:focus-within, .devices input:focus-visible + span, .download a:focus-visible { outline: 2px solid #f1d594; outline-offset: 4px; }

#release-feedback { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
#release-dialog {
  width: min(32rem, calc(100% - 2rem));
  border: 1px solid #b6c2b3;
  border-radius: 1rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  color: #1d382c;
  background: #f8f6ee;
}
#release-dialog::backdrop { background: #0f231ccc; }
#release-dialog form { display: grid; gap: .65rem; }
#release-dialog h2 { padding-right: 1.65rem; font-size: clamp(1.55rem, 5vw, 2rem); }
#release-dialog input[type=email], #release-dialog select, #release-dialog textarea {
  width: 100%; padding: .55rem .75rem; border: 1px solid #7e9686; border-radius: .45rem;
  color: inherit; background: #fffcf4; font: inherit;
}
#release-dialog textarea { resize: vertical; }
#release-message-fields { display: grid; gap: .4rem; }
#release-dialog p, #release-dialog label { line-height: 1.55; }
#release-dialog input[type=checkbox] { accent-color: #244f3f; }
#release-dialog summary { cursor: pointer; text-decoration: underline; }
#release-dialog details p { margin-top: .4rem; }
.release-close {
  position: absolute; top: .5rem; right: .65rem; min-width: 2.75rem; min-height: 2.75rem;
  border: 0; background: none; color: inherit; font-size: 1.6rem; cursor: pointer;
}
.release-submit {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 3rem; padding: .5rem 1rem; border: 0; border-radius: 2rem;
  background: #244f3f; color: #fff9e5; font: inherit; font-weight: 650; cursor: pointer;
}
.release-submit:disabled { opacity: .7; cursor: progress; }
.release-status:empty { display: none; }
.foot { font-size: 1rem; }
@media (max-width: 700px) {
  .site-head .wrap { height: 3.55rem; }
  .hero .wrap { display: flex; flex-direction: column; gap: 1.6rem; }
  .hero h1 { font-size: clamp(2.45rem,9.6vw,3.5rem); }
  .hero::before { background-position: center; }
  .stack { width: min(86vw,25rem); margin-bottom: .4rem; }
}
@media (max-width: 880px) {
  .course-picker { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sample-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .subject-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sample-search { flex-basis: 100%; }
  .sample-facets { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; }
}
@media (max-width: 420px) {
  .devices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .25rem; width: 100%; max-width: 21rem; }
  .devices span { flex-direction: column; gap: .38rem; min-width: 4rem; min-height: 3.8rem; font-size: 1rem; }
  .devices img { height: 1.5rem; }
}
