body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
/* Layout concept: a friendly institutional site. Sky-and-playground scene on the home page, four large doors to the main sections, plain readable pages behind them. */
:root {
  --bg: #FAF8FF; --surface: #FFFFFF; --ink: #1E1442; --muted: #5B5279; --line: #E3DCF5;
  --accent: #6B3FC4; --on-accent: #FFFFFF; --soft: #EEE8FC;
  --sun: #FFC629; --on-sun: #2C2100; --sun-soft: #FFF4CC; --on-sun-soft: #4A3A00; --danger: #B3261E;
  --sky: #DDF0FF; --sky-ink: #1E1442;
  --font: "Golos Text", "Segoe UI", "Arial", sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #15102A; --surface: #201A3A; --ink: #F2EEFF; --muted: #B4ABD0; --line: #372E58;
  --accent: #B59BF5; --on-accent: #15102A; --soft: #2B2350; --sun-soft: #3C3312; --on-sun-soft: #FFE89A; --danger: #FF9C94; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #15102A; --surface: #201A3A; --ink: #F2EEFF; --muted: #B4ABD0; --line: #372E58;
  --accent: #B59BF5; --on-accent: #15102A; --soft: #2B2350; --sun-soft: #3C3312; --on-sun-soft: #FFE89A; --danger: #FF9C94; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font); overflow-wrap: break-word; }
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { text-wrap: balance; line-height: 1.15; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.band { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1120px; margin-inline: auto; }
button, .btn { font: 600 15px/1.2 var(--font); min-height: 42px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.primary { background: var(--accent); color: var(--on-accent); }
.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.small-btn { min-height: 34px; padding: 5px 12px; font-size: 14px; }

/* Header */
.editbar { background: var(--sun-soft); color: var(--on-sun-soft); font-size: 15px; padding-block: 8px; }
.editbar .wrap { display: flex; gap: 10px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.editbar .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.editbar .ghost { color: var(--on-sun-soft); border-color: var(--on-sun-soft); }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 12px; }
.top .wrap { display: flex; align-items: center; gap: 10px 24px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 18px; line-height: 1.15; min-width: 0; }
.logo svg { flex: none; }
nav.menu { display: flex; flex-wrap: wrap; gap: 2px; order: 3; width: 100%; }
.top .lang { margin-left: auto; }
nav.menu a { padding: 7px 11px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 15px; }
nav.menu a:hover { background: var(--soft); }
nav.menu a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.lang { display: flex; border: 1.5px solid var(--accent); border-radius: 999px; overflow: hidden; }
.lang button { min-height: 34px; padding: 4px 12px; border: 0; border-radius: 0; background: transparent; color: var(--accent); font-size: 14px; }
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* Home */
.hero { position: relative; background: var(--sky); color: var(--sky-ink); overflow: hidden; }
.hero-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-text { position: relative; padding-block: clamp(44px, 8vw, 96px); max-width: 1120px; margin-inline: auto; display: grid; gap: 16px; justify-items: start; min-height: 440px; align-content: center; }
.hero h1 { font-size: clamp(36px, 5.6vw, 64px); font-weight: 900; max-width: 11em; font-style: normal; }
.hero p { font-size: clamp(18px, 2vw, 22px); font-weight: 500; line-height: 1.35; max-width: 17em; }
.hero .btn { background: #6B3FC4; color: #FFFFFF; min-height: 48px; padding-inline: 26px; font-size: 16px; }
.doors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: -76px; position: relative; }
.door { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: grid; justify-items: center; text-align: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 17px; line-height: 1.25; box-shadow: 0 8px 22px rgb(60 30 130 / .10); transition: transform .15s; }
.door:hover { transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .door { transition: none; } .door:hover { transform: none; } }
.door svg { width: 44px; height: 44px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
main { padding-block: 44px 72px; }
.page { display: grid; gap: 28px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.page-head h1, .page-head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 800; }
.lede { font-size: 19px; color: var(--muted); max-width: 40em; white-space: pre-line; }
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; align-items: start; }
.fact { display: grid; gap: 1px; }
.fact div { padding-block: 10px; border-top: 1px solid var(--line); display: grid; gap: 2px; min-width: 0; }
.fact dt { font-size: 14px; color: var(--muted); }
.fact dd { margin: 0; font-weight: 600; white-space: pre-line; }
dl { margin: 0; }
.missing, .fact dd.missing { color: var(--muted); font-weight: 400; font-style: normal; }

/* Lists */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.card h3 { font-size: 20px; font-weight: 700; }
.age { justify-self: start; font-weight: 700; font-size: 14px; padding: 3px 10px; border-radius: 999px; background: var(--sun); color: var(--on-sun); font-variant-numeric: tabular-nums; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.person img, .person .avatar { width: 100%; aspect-ratio: 1; max-width: 100%; object-fit: cover; border-radius: 12px; background: var(--soft); display: block; }
.person .avatar { display: grid; place-items: center; color: var(--accent); font-size: 44px; font-weight: 800; }
.doc-group { display: grid; gap: 4px; }
.doc-group h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.doc { display: flex; align-items: center; gap: 8px 16px; padding-block: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; justify-content: space-between; }
.doc > span, .doc > a:first-child { min-width: 0; flex: 1 1 260px; font-weight: 500; }
.chip { font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--sun-soft); color: var(--on-sun-soft); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.gallery figure { display: grid; gap: 6px; align-content: start; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; background: var(--soft); }
.gallery figcaption { font-size: 15px; color: var(--muted); }
.empty { background: var(--soft); border-radius: 16px; padding: 26px; max-width: 42em; display: grid; gap: 6px; }
.empty strong { font-size: 18px; }
.note { background: var(--sun-soft); color: var(--on-sun-soft); padding: 12px 16px; border-radius: 10px; font-size: 15px; max-width: 46em; }
.material p { white-space: pre-line; }
footer.foot { background: #1E1442; color: #F2EEFF; padding-block: 28px; font-size: 15px; }
footer.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }

/* Editor */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgb(20 10 50 / .55); }
.form { padding: 22px; display: grid; gap: 14px; }
.form h2 { font-size: 22px; font-weight: 800; }
.form label { display: grid; gap: 5px; font-weight: 600; font-size: 15px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
input[type="text"], input[type="url"], input[type="file"], textarea, select { width: 100%; font: 400 16px/1.4 var(--font); padding: 9px 11px; border-radius: 8px; border: 1.5px solid var(--muted); background: var(--bg); color: var(--ink); }
textarea { min-height: 96px; resize: vertical; }
.form-acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.form-err { color: var(--danger); font-size: 15px; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 20; max-width: calc(100vw - 32px); }

@media (max-width: 860px) {
  .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .hero-text { min-height: 0; padding-block: 36px 240px; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .hero-scene { top: auto; bottom: 0; height: 280px; }
}
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .form { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; width: min(440px, 100%); }
.auth input[type="password"], dialog input[type="password"] { width: 100%; font: 400 16px/1.4 var(--font); padding: 9px 11px; border-radius: 8px; border: 1.5px solid var(--muted); background: var(--bg); color: var(--ink); }
.auth p { font-size: 15px; color: var(--muted); }
.auth p.form-err { color: var(--danger); }
.auth p.note { color: var(--on-sun-soft); }
.editbar a.btn { color: var(--on-sun-soft); border-color: var(--on-sun-soft); }
