:root {
  color-scheme: dark;
  --background: #020817;
  --surface: #071934;
  --surface-2: #0a2144;
  --surface-3: #0e2b55;
  --border: rgba(150, 186, 235, .19);
  --text: #f6f8ff;
  --muted: #9eb1d2;
  --accent: #8ebcff;
  --green: #79e0ae;
  --amber: #ffd488;
  --red: #ff9b9b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--background); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 82% -10%, rgba(25, 73, 135, .42), transparent 42rem),
    radial-gradient(circle at 12% 35%, rgba(14, 53, 107, .18), transparent 34rem),
    linear-gradient(155deg, #020817, #03122a 65%, #020817);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: #b9d5ff; }
button, input, select { font: inherit; }
.virelia-home {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 18px;
  width: 54px;
  height: 62px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(4, 16, 38, .82);
  backdrop-filter: blur(14px);
}
.virelia-home img { width: auto; height: 50px; object-fit: contain; }
.shell { width: min(1100px, calc(100% - 40px)); margin: 0 auto; padding: 52px 0 38px; }
.header { display: flex; gap: 28px; align-items: flex-start; justify-content: space-between; margin-bottom: 30px; }
.header h1 { margin: 7px 0 8px; font-size: clamp(2.35rem, 7vw, 4.7rem); letter-spacing: -.055em; line-height: .98; }
.eyebrow { margin: 0; color: var(--accent); text-transform: uppercase; font-size: .75rem; letter-spacing: .13em; font-weight: 800; }
.subtitle { max-width: 760px; margin: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.language-switcher { display: flex; gap: 5px; padding: 5px; border: 1px solid var(--border); border-radius: 999px; background: rgba(7, 25, 52, .86); }
.language-switcher a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; }
.language-switcher a.active { background: #dce9ff; color: #06152e; }
.notice { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; padding: 13px 16px; border: 1px solid rgba(255, 211, 120, .3); border-radius: 14px; color: #ffe5aa; background: rgba(90, 61, 7, .22); }
.lead-card { display: grid; grid-template-columns: 1fr auto; gap: 30px; padding: clamp(24px, 5vw, 44px); border: 1px solid var(--border); border-radius: 26px; background: linear-gradient(135deg, rgba(10, 37, 78, .95), rgba(4, 19, 44, .95)); box-shadow: 0 28px 80px rgba(0, 0, 0, .26); }
.lead-card h2 { margin: 8px 0 10px; font-size: clamp(1.7rem, 5vw, 3rem); letter-spacing: -.035em; }
.lead-card p:not(.eyebrow) { color: var(--muted); line-height: 1.65; margin: 0; max-width: 680px; }
.lead-links { display: grid; gap: 10px; align-content: center; min-width: 230px; }
.lead-links a { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 13px; text-decoration: none; background: rgba(2, 11, 27, .38); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.stats article { padding: 17px 18px; border: 1px solid var(--border); border-radius: 17px; background: rgba(6, 25, 52, .84); }
.stats span { display: block; min-height: 2.4em; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.stats strong { display: block; margin-top: 7px; font-size: 1.25rem; }
.catalog, .entries-section { margin-top: 22px; padding: clamp(20px, 4vw, 30px); border: 1px solid var(--border); border-radius: 24px; background: rgba(5, 22, 48, .76); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 6px 0 0; font-size: 1.75rem; }
.status { color: var(--green); font-size: .86rem; }
.section-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.section-card { min-height: 150px; padding: 18px; border: 1px solid var(--border); border-radius: 17px; background: linear-gradient(145deg, rgba(11, 38, 78, .78), rgba(4, 18, 39, .78)); cursor: pointer; transition: transform .16s ease, border-color .16s ease; }
.section-card:hover, .section-card:focus-visible { transform: translateY(-2px); border-color: rgba(160, 204, 255, .46); outline: none; }
.section-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.section-card h3 { margin: 0; font-size: 1.08rem; }
.section-card-count { color: var(--accent); border: 1px solid var(--border); border-radius: 999px; padding: 3px 8px; font-size: .75rem; font-weight: 800; }
.section-card p { margin: 10px 0 0; color: var(--muted); line-height: 1.55; font-size: .9rem; }
.toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(170px, .35fr) minmax(170px, .35fr); gap: 10px; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: 100%; min-height: 46px; color: var(--text); border: 1px solid var(--border); border-radius: 13px; background: #061832; padding: 0 13px; }
.toolbar input::placeholder { color: #8398bb; }
.entry-list { display: grid; gap: 13px; }
.entry { border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(145deg, rgba(11, 38, 78, .82), rgba(4, 18, 39, .82)); overflow: clip; scroll-margin-top: 20px; }
.entry[open] { border-color: rgba(151, 196, 255, .38); }
.entry summary { list-style: none; cursor: pointer; padding: 19px 20px; }
.entry summary::-webkit-details-marker { display: none; }
.entry-summary-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.entry-id { color: #dbe9ff; font-weight: 850; letter-spacing: .04em; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; font-size: .73rem; color: var(--muted); }
.badge.active { color: var(--green); }
.badge.draft { color: var(--amber); }
.badge.repealed, .badge.archived { color: #b8c1d2; }
.badge.amended { color: #c3b9ff; }
.entry h3 { margin: 0; font-size: 1.3rem; }
.entry-summary-copy { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.entry-body { padding: 0 20px 22px; border-top: 1px solid var(--border); }
.entry-metadata { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.entry-metadata div { padding: 11px; border: 1px solid var(--border); border-radius: 12px; background: rgba(3, 14, 32, .45); }
.entry-metadata span { display: block; color: var(--muted); font-size: .72rem; }
.entry-metadata strong { display: block; margin-top: 5px; font-size: .88rem; overflow-wrap: anywhere; }
.entry-text { color: #dce6f8; line-height: 1.72; }
.entry-text p { margin: 0 0 12px; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 17px; }
.entry-actions a { padding: 9px 12px; border: 1px solid var(--border); border-radius: 11px; text-decoration: none; background: rgba(7, 28, 60, .78); }
.empty { color: var(--muted); padding: 34px 8px; text-align: center; }
.principles { display: grid; grid-template-columns: .7fr 1.3fr; gap: 30px; margin-top: 22px; padding: clamp(22px, 4vw, 32px); border: 1px solid var(--border); border-radius: 24px; background: rgba(6, 25, 52, .72); }
.principles h2 { margin: 7px 0 0; }
.principles ul { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.7; }
.principles li + li { margin-top: 8px; }
footer { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .84rem; line-height: 1.6; }
.language-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(1, 7, 19, .93); backdrop-filter: blur(18px); }
.language-gate[hidden] { display: none; }
.language-dialog { width: min(520px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: 26px; text-align: center; background: #071936; box-shadow: 0 30px 100px #000; }
.language-dialog h1 { margin: 8px 0 10px; }
.language-dialog p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.language-crest { height: 90px; width: auto; }
.language-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.language-options button { min-height: 76px; color: var(--text); border: 1px solid var(--border); border-radius: 15px; background: #0a2349; cursor: pointer; }
.language-options strong, .language-options span { display: block; }
.language-options strong { font-size: 1.1rem; }
.language-options span { margin-top: 4px; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html.language-pending #page-content { visibility: hidden; }
@media (max-width: 880px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .section-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .entry-metadata { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .virelia-home { position: absolute; top: 12px; left: 12px; width: 46px; height: 52px; border-radius: 13px; }
  .virelia-home img { height: 42px; }
  .shell { width: min(100% - 24px, 1100px); padding-top: 82px; }
  .header { display: block; }
  .language-switcher { width: max-content; margin-top: 18px; }
  .lead-card { grid-template-columns: 1fr; }
  .lead-links { min-width: 0; }
  .section-heading { align-items: flex-start; }
  .principles { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 560px) {
  .stats, .section-grid, .toolbar, .entry-metadata { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .stats article { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .stats span { min-height: 0; }
  .stats strong { margin-top: 0; }
  .entry summary { padding: 17px; }
  .entry-body { padding: 0 17px 19px; }
}
@media (max-width: 460px) {
  .language-options { grid-template-columns: 1fr; }
  .language-options button { min-height: 58px; }
  .notice { align-items: flex-start; flex-direction: column; }
}
