:root {
  color-scheme: light;
  --ink: #183c34;
  --muted: #50665c;
  --line: #cbd8cd;
  --paper: #f8faf6;
  --serif: "Spectral", Georgia, serif;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body, figure, p, h1, h2 { margin: 0; }
body { min-height: 100vh; }
a { color: inherit; }
button, select, input { font: inherit; }
button, select { cursor: pointer; }
:focus-visible, input:focus-visible + span { outline: 3px solid #ca6a2d; outline-offset: 3px; }
.mast { border-bottom: 1px solid var(--line); }
.mast nav, .wrap { width: min(1240px, 100%); margin: auto; padding-inline: clamp(16px, 4vw, 64px); }
.mast nav { min-height: 58px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: .88rem; }
.mast nav > span:not([aria-current]) { color: #94a99b; }
.mast a { text-decoration: none; }
.mast a:hover { text-decoration: underline; }
.brand { font-weight: 750; }
.hub { padding-block: clamp(28px, 4vw, 58px); }
h1, .building h2, .explanation h2 { font-family: var(--serif); font-weight: 500; line-height: 1.03; letter-spacing: -.045em; }
.hub h1 { font-size: clamp(3.2rem, 6vw, 5.4rem); }
.dot { color: #6d9250; }
.intro { color: var(--muted); margin-top: 12px; font-size: 1.05rem; line-height: 1.55; }
.level-picker { margin: 0; border: 0; padding: 0; }
.level-picker legend, .level-select { font-size: .85rem; font-weight: 650; }
.level-picker legend { margin-bottom: 8px; }
.segments { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #e7ede5; border-radius: 12px; }
.segments label { cursor: pointer; position: relative; }
.segments input { position: absolute; opacity: 0; }
.segments span { display: block; border-radius: 8px; padding: 9px clamp(12px, 2vw, 26px); font-weight: 650; }
.segments input:checked + span { background: #fff; color: #163f31; box-shadow: 0 1px 4px #173d3425; }
.subject { font-size: .8rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.catalog-heading .segments { flex-wrap: nowrap; }
.catalog-heading .segments span { padding-inline: clamp(10px, 1.5vw, 22px); }
.campus { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 16px; }
.building {
  --sky: #e7efdc; --ground: #b9cead;
  display: flex; flex-direction: column; grid-column: span 2; overflow: hidden; border: 1px solid var(--line);
  border-radius: 14px; color: var(--ink); text-decoration: none; background: #fff;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.building:nth-child(-n+2) { grid-column: span 3; }
.building:hover, .building:focus-visible { border-color: #748f7c; box-shadow: 0 5px 18px #183c3418; }
.building.energi { --sky: #f1e9ce; --ground: #dfcaa1; }
.building.fisika { --sky: #e3ebed; --ground: #b6c9d0; }
.building.kimia { --sky: #e2eeeb; --ground: #b8d3c9; }
.building.matematika { --sky: #f4e8da; --ground: #dfc3ae; }
.diorama {
  display: grid; place-items: center; background-color: var(--sky);
  background-image: radial-gradient(ellipse at 50% 100%, var(--ground), transparent 72%);
}
.diorama img { width: 100%; height: clamp(126px, 12.5vw, 175px); display: block; object-fit: contain; }
.building:nth-child(-n+2) img { height: clamp(156px, 15vw, 210px); }
.building-copy { padding: 14px clamp(14px, 2vw, 24px) 18px; }
.building-name { font-size: .75rem; letter-spacing: .065em; font-weight: 650; color: var(--muted); text-transform: uppercase; }
.building h2 { margin: 4px 0 7px; font-size: clamp(1.8rem, 2.5vw, 2.5rem); }
.building-copy p { font-size: .94rem; line-height: 1.45; color: var(--muted); }
.lesson { padding-block: clamp(20px, 4vw, 48px); }
.lesson-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.lesson h1 { font-size: clamp(2.2rem, 4.5vw, 4.5rem); }
.level-select { display: grid; flex: none; gap: 5px; }
.level-select select, .tools button { color: var(--ink); border: 1px solid #a8bbad; border-radius: 7px; padding: 7px 12px; background: white; }
.atlas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.model {
  min-width: 0; position: relative; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background-color: #e1ebd9; background-image: radial-gradient(#71917d4d 1px, transparent 1px); background-size: 16px 16px;
}
.animal-view { background-color: #f1e7df; background-image: radial-gradient(#a788714d 1px, transparent 1px); }
.model figcaption { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 8px; }
.model h2, .structure-list h2 { font-size: 1rem; }
.model figcaption span { font-size: .8rem; color: var(--muted); }
.viewport { position: relative; width: 100%; height: clamp(205px, 24vw, 330px); }
.viewport img, .viewport canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.viewport canvas { touch-action: none; cursor: grab; }
.viewport canvas:active { cursor: grabbing; }
[hidden] { display: none !important; }
.presence { min-height: 2em; width: fit-content; font-size: .82rem; background: #ffffffc9; border-radius: 6px; padding: 4px 8px; }
.tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 22px; color: var(--muted); font-size: .85rem; }
.tools button { flex: none; }
.explore { display: grid; grid-template-columns: minmax(230px, .85fr) 1.4fr; gap: clamp(18px, 4vw, 50px); padding-top: 18px; border-top: 1px solid var(--line); }
.choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.choices button { display: inline-flex; gap: 7px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 7px 11px; color: var(--ink); font-size: .85rem; }
.choices button[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--swatch); flex: none; box-shadow: inset 0 0 0 1px #0002; }
.choices button:hover, .tools button:hover { border-color: #517f65; }
.explanation { border-left: 3px solid #98ba79; padding-left: 18px; align-self: start; }
.explanation .subject { color: #4f6b52; font-size: .74rem; }
.explanation h2 { margin: 5px 0 9px; font-size: clamp(1.75rem, 3vw, 2.5rem); }
.explanation > p:last-child { line-height: 1.55; max-width: 65ch; }
.model-note { color: var(--muted); font-size: .8rem; line-height: 1.5; margin-top: 24px; }
.lab-sheet { display: grid; grid-template-columns: 1.5fr 1fr; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
.experiment { display: grid; align-content: center; padding: 12px; background: #e1ece7; min-width: 0; }
.experiment.volume { background: #ece8d9; }
.experiment canvas { width: 100%; height: auto; display: block; }
.experiment figcaption { padding: 10px; color: #415b50; line-height: 1.45; font-size: .85rem; }
.lab-panel { padding: clamp(18px,3vw,36px); }
.lab-panel h2 { font-size: 1.15rem; }
.lab-panel article { margin: 20px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.lab-panel h3 { margin: 0 0 7px; font: 500 1.7rem var(--serif); }
.lab-panel p { color: var(--muted); line-height: 1.55; }
.lab-button { background: #f2f6ed; color: var(--ink); border-radius: 7px; padding: 8px 14px; border: 1px solid var(--line); }
.dimensions { display: grid; gap: 6px; margin-top: 16px; }
.dimensions label { display: flex; align-items: center; justify-content: space-between; }
.dimensions output { font-variant-numeric: tabular-nums; }
.dimensions input { width: 100%; accent-color: #376654; margin: 3px 0 8px; }
@media (max-width: 700px) {
  .lab-sheet { grid-template-columns: minmax(0,1fr); }
  .catalog-heading { flex-direction: column; align-items: start; gap: 17px; }
  .campus { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .building, .building:nth-child(-n+2) { grid-column: auto; }
  .building:nth-child(-n+2) img { height: 126px; }
  .lesson-heading { flex-wrap: wrap; }
  .level-select { display: flex; align-items: center; }
  .atlas { gap: 6px; }
  .model { padding: 9px 6px; border-radius: 10px; }
  .model figcaption { display: grid; }
  .viewport { height: clamp(145px, 38vw, 225px); }
  .presence { font-size: .75rem; }
  .explore { grid-template-columns: 1fr; }
  .tools { align-items: flex-start; }
  .mast nav { gap: 7px; }
}

@media (max-width: 510px) {
  .campus { grid-template-columns: minmax(0,1fr); }
  .building { flex-direction: row; }
  .diorama { width: 38%; flex: none; }
  .diorama img, .building:nth-child(-n+2) img { height: auto; }
  .building-copy { padding: 14px 10px 15px 13px; }
  .building-name { font-size: .7rem; }
  .building h2 { font-size: 1.65rem; }
  .building-copy p { font-size: .86rem; }
}
