:root {
  color-scheme: light;
  --navy: #080e23;
  --ink: #121a2e;
  --muted: #536179;
  --blue: #2458ee;
  --blue-hover: #1745d4;
  --canvas: #f4f7fc;
  --line: #dce4f0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
html { scroll-behavior: smooth; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
p { line-height: 1.6; }
svg { flex-shrink: 0; vertical-align: middle; }
:focus-visible { outline: 3px solid #648aff; outline-offset: 4px; }

.wrap { width: min(1152px, calc(100% - 112px)); margin-inline: auto; }
.masthead { color: #f5f8ff; background: var(--navy); overflow: hidden; }
.topbar { border-bottom: 1px solid #293148; }
.topbar-inner { min-height: 73px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; font-weight: 750; letter-spacing: -.035em; font-size: 1.16rem; }
.brand > span:last-child { overflow-wrap: anywhere; }
.brand-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--blue); flex: 0 0 auto; box-shadow: inset 0 1px 0 #ffffff34; }
.topbar-nav { display: flex; align-items: center; gap: 29px; }
.nav-downloads { color: #c7d2e7; font-size: .91rem; font-weight: 600; }
.nav-downloads:hover { color: #fff; }
.control-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #36425d; background: #131d35; color: #eef4ff; border-radius: 9px; white-space: nowrap; padding: 9px 13px; min-height: 39px; font-size: .88rem; font-weight: 650; }
.control-link:hover { background: #223154; }

.hero { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 501px; padding-block: 71px 78px; }
.hero-copy { position: relative; width: min(58%, 650px); z-index: 1; }
.eyebrow { display: flex; align-items: center; gap: 11px; color: #9bb6ff; font-size: .86rem; line-height: 1.2; font-weight: 720; letter-spacing: .17em; margin-bottom: 20px; }
.eyebrow-line { width: 25px; height: 2px; background: #6f96ff; border-radius: 99px; }
.hero h1 { font-size: clamp(3.2rem, 5.7vw, 5.4rem); font-weight: 770; letter-spacing: -.075em; line-height: 1.015; overflow-wrap: anywhere; }
.hero h1 span { display: block; }
.hero-accent { color: #80a8ff; }
.hero-description { max-width: 400px; margin-top: 22px; color: #bdc9df; font-size: 1.08rem; overflow-wrap: anywhere; }
.hero .button { margin-top: 31px; }
.hero-art { width: clamp(420px, 49vw, 650px); position: absolute; right: -57px; top: 50%; transform: translateY(-50%); z-index: -1; pointer-events: none; }
.hero-art img { width: 100%; height: auto; mask-image: radial-gradient(ellipse at 50% 50%, #000 40%, #000e 58%, transparent 76%); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 47px; padding: 11px 17px; border: 1px solid transparent; border-radius: 9px; font-weight: 680; line-height: 1.25; transition: background-color .18s, border-color .18s; }
.primary { background: var(--blue); color: #fff; box-shadow: 0 2px 4px #082b7c1c; }
.primary:hover { background: var(--blue-hover); }
.hero .primary { padding-inline: 20px; min-height: 50px; }
.secondary { background: #f1f5ff; border-color: #dde7ff; color: #234bd7; }
.secondary:hover { background: #e3ecff; }

.library { padding: 56px 0 74px; min-height: 420px; scroll-margin-top: 20px; }
.library-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 25px; }
.library h2, .admin-heading h1 { font-size: clamp(2rem, 4vw, 2.7rem); letter-spacing: -.06em; line-height: 1.12; }
.library-heading p, .admin-heading p { color: var(--muted); margin-top: 8px; }
.library-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-bottom: 15px; }
.library-toolbar p { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button, .static-filter { border: 1px solid var(--line); background: #fff; color: #3c4c66; font-size: .88rem; font-weight: 660; border-radius: 7px; padding: 7px 12px; }
.filters button:hover { border-color: #94acfa; }
.filters button[aria-pressed="true"], .static-filter { border-color: #cddaff; background: #e9efff; color: #274dc9; }
.search { width: min(100%, 270px); display: flex; gap: 9px; align-items: center; padding: 0 13px; min-height: 44px; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: #536684; }
.search:focus-within { outline: 2px solid #648aff; outline-offset: 2px; }
.search input { width: 100%; padding: 10px 0; border: 0; outline: none; background: transparent; color: var(--ink); font-size: .94rem; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 207px; text-align: center; padding: 22px; background: #fff; border: 1px dashed #c5d1e5; border-radius: 13px; }
.file-icon { width: 48px; height: 48px; border-radius: 11px; background: #eaf0ff; color: #2858e3; display: inline-grid; place-items: center; flex-shrink: 0; }
.empty-state h3 { font-size: 1.13rem; margin: 12px 0 3px; }
.empty-state p { color: var(--muted); font-size: .95rem; }
.text-button { background: none; border: 0; color: #214bda; font-weight: 650; margin-top: 7px; padding: 5px; }
.text-button:hover { text-decoration: underline; }
.download-list { display: grid; gap: 12px; }
.download-card { display: grid; grid-template-columns: auto 1fr auto; gap: 17px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.download-copy { min-width: 0; overflow-wrap: anywhere; }
.file-details { display: flex; flex-wrap: wrap; gap: 5px 12px; padding: 0; margin: 0 0 6px; list-style: none; color: var(--muted); font-size: .82rem; font-weight: 650; }
.file-details li + li::before { content: "·"; margin-right: 12px; }
.download-copy h3 { font-size: 1.22rem; letter-spacing: -.02em; }
.download-copy p { margin-top: 4px; color: var(--muted); white-space: pre-line; }
.file-button { background: #eff4ff; color: #2351df; border-color: #dce7ff; }
.file-button:hover { background: #dde8ff; }
.site-footer { background: #fff; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 85px; }
.footer-inner > a:last-child { font-size: .91rem; color: var(--muted); }
.footer-inner > a:last-child:hover { color: var(--blue); }

.admin-shell { min-height: 100vh; }
.admin-bar { background: var(--navy); color: #f5f8ff; }
.admin-main { padding-block: 48px 70px; }
.admin-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.admin-heading .file-icon { width: 56px; height: 56px; border: 1px solid #dce7ff; border-radius: 13px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1.16fr; align-items: start; gap: 20px; }
.admin-column { display: grid; gap: 20px; min-width: 0; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 24px; box-shadow: 0 4px 15px #0c245206; }
.panel h2 { font-size: 1.28rem; letter-spacing: -.035em; line-height: 1.25; }
.panel p { color: var(--muted); margin-top: 4px; font-size: .94rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel form { margin-top: 20px; }
.panel fieldset { display: grid; gap: 15px; min-width: 0; padding: 0; margin: 0; border: 0; }
.panel label { display: block; color: #22304a; font-size: .91rem; font-weight: 650; min-width: 0; }
.panel input:not([type="checkbox"]), .panel textarea { width: 100%; display: block; margin-top: 6px; background: #fbfcff; color: var(--ink); border: 1px solid #ccd7e8; border-radius: 8px; padding: 10px 11px; font-size: 1rem; line-height: 1.45; font-weight: 450; }
.panel textarea { min-height: 65px; resize: vertical; }
.panel input::placeholder { color: #667691; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.optional { color: var(--muted); font-size: .8rem; font-weight: 450; margin-left: 3px; }
.panel .publish-toggle { display: flex; gap: 10px; align-items: center; padding-block: 4px; }
.publish-toggle input { accent-color: var(--blue); width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 3px; }
.form-actions .button { font-size: .93rem; }
.feedback { color: #146247; font-weight: 650; font-size: .88rem; }
.feedback.error { color: #a22932; }
.small-button { font-size: .9rem; min-height: 37px; padding: 7px 11px; }
.entry-list { padding: 0; list-style: none; display: grid; gap: 8px; margin: 13px 0 0; }
.entry-button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); text-align: left; }
.entry-button[aria-pressed="true"], .entry-button:hover { background: #f1f5ff; border-color: #bdcdff; }
.entry-button > svg { color: #3159d6; }
.entry-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 620; }
.entry-status { padding: 3px 6px; border-radius: 5px; color: #536179; background: #edf0f6; font-size: .78rem; font-weight: 650; }
.entry-status.published { background: #e8f6ee; color: #176140; }
.panel .entry-empty { margin-top: 14px; }

@media (max-width: 1000px) {
  .wrap { width: calc(100% - 76px); }
  .hero { min-height: 470px; }
  .hero-art { right: -57px; }
  .hero-copy { width: 60%; }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 40px); }
  .topbar-inner { min-height: 64px; }
  .topbar-nav { gap: 12px; }
  .nav-downloads { display: none; }
  .hero { display: flex; flex-direction: column-reverse; align-items: flex-start; padding-top: 38px; padding-bottom: 9px; min-height: 0; }
  .hero-copy { width: 100%; }
  .hero h1 { font-size: clamp(2.9rem, 8.8vw, 4.3rem); }
  .hero-description { margin-top: 16px; }
  .hero .button { margin-top: 22px; }
  .hero-art { position: relative; width: min(95%, 390px); right: auto; top: auto; transform: none; align-self: center; margin-top: -5px; margin-bottom: -6px; }
  .eyebrow { margin-bottom: 14px; }
  .library { padding-block: 39px 52px; }
  .library-heading { display: grid; gap: 14px; margin-bottom: 20px; }
  .search { width: 100%; }
  .admin-main { padding-block: 30px 50px; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .brand { font-size: 1rem; gap: 7px; }
  .brand-icon { width: 32px; height: 32px; }
  .control-link { font-size: .81rem; gap: 6px; padding-inline: 8px; }
  .download-card { grid-template-columns: auto 1fr; padding: 15px; }
  .download-card .button { grid-column: 2; justify-self: start; }
  .panel { padding: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}

[hidden] { display: none !important; }
.auth-panel { max-width: 520px; }
.admin-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.entry-button[aria-current="true"] { background: #f1f5ff; border-color: #bdcdff; }
.editor { scroll-margin-top: 18px; }
