:root {
  color-scheme: light;
  --paper: #f7f9fa;
  --surface: #fff;
  --ink: #152332;
  --muted: #546271;
  --line: #dce2e7;
  --navy: #102133;
  --accent: #f4c871;
  --teal: #17665b;
  --radius: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.7 Tahoma, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--teal); }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #3a8d80; outline-offset: 4px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
.wrap { width: min(calc(100% - 3rem), 1220px); margin-inline: auto; }
.skip { position: fixed; inset-block-start: 1rem; inset-inline-start: 1rem; z-index: 2; padding: .55rem 1rem; background: white; border-radius: 8px; transform: translateY(-200%); }
.skip:focus { transform: none; }

.header { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { display: grid; grid-template-columns: auto 1fr auto; min-height: 74px; align-items: center; gap: 1.3rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; width: max-content; color: var(--ink); }
.wordmark { font: 800 1.48rem/1.1 Arial, sans-serif; letter-spacing: -.065em; }
.wordmark span { color: var(--teal); margin-inline-start: 2px; }
.mark { width: 38px; height: 38px; border-radius: 11px; background: var(--navy); display: grid; place-items: center; position: relative; }
.mark::before { content: ""; width: 13px; height: 20px; border: 2px solid var(--accent); border-radius: 4px; }
.mark::after { content: ""; width: 4px; height: 2px; position: absolute; background: var(--accent); border-radius: 1px; inset-block-end: 10px; }
.top-nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .1rem clamp(.5rem,1.65vw,1.35rem); }
.top-nav a { padding: .65rem 0; color: var(--muted); font-size: .9rem; font-weight: 600; white-space: nowrap; }
.top-nav a:hover, .top-nav a[aria-current] { color: var(--teal); }
.top-nav a[aria-current] { box-shadow: inset 0 -2px var(--teal); }
.search-link { display: inline-flex; align-items: center; gap: .5rem; min-height: 42px; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 10px; font-size: .9rem; font-weight: bold; }
.magnifier { width: 13px; height: 13px; border: 2px solid currentColor; border-radius: 50%; position: relative; margin-inline-end: .12rem; }
.magnifier::after { content: ""; width: 6px; height: 2px; position: absolute; right: -5px; bottom: -3px; background: currentColor; transform: rotate(45deg); }

.hero { display: grid; grid-template-columns: 48% 52%; position: relative; isolation: isolate; min-height: 452px; margin-block: 2rem 2.8rem; border-radius: 24px; color: white; background: var(--navy); overflow: hidden; }
.hero-copy { align-self: center; padding: clamp(1.7rem, 4.3vw, 4.2rem); padding-inline-end: 1rem; z-index: 1; }
.hero h1 { font-size: clamp(2.35rem, 4.45vw, 4.15rem); line-height: 1.17; letter-spacing: -.055em; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.academy-motto { color: #e4eaf0; margin: 0 0 .75rem; font-weight: 700; font-size: .875rem; }
.academy-motto span { color: var(--accent); padding-inline: .15rem; }
.hero-desc strong { color: var(--accent); margin-inline-end: .2em; }
.hero-desc { font-size: clamp(1rem, 1.45vw,1.17rem); color: #e1e9f0; max-width: 44ch; margin: 1rem 0 1.65rem; }
.hero-photo { position: relative; min-height: 100%; }
.hero-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to left,#102133 0%,#10213365 18%,transparent 54%); }
.hero-photo img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 46% center; }
.actions { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.button, .search button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 46px; border: 1px solid transparent; border-radius: 9px; padding: .55rem .9rem; text-align: center; font-weight: 700; background: var(--navy); color: white; }
.button:hover, .search button:hover { background: var(--teal); color: white; }
.hero .button { background: var(--accent); color: var(--navy); }
.hero .button:hover { background: #ffdc9e; }
.hero .hero-outline { background: transparent; color: white; border-color: #a9b8c880; }
.hero .hero-outline:hover { background: #ffffff15; }
.outline { background: var(--surface); color: var(--teal); border-color: var(--line); }
.small { min-height: 40px; font-size: .91rem; }

.topics { scroll-margin-top: 1rem; }
.topics h2 { font-size: clamp(1.5rem,2.75vw,2rem); margin-bottom: 1rem; }
.topic-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .65rem; }
.topic { display: flex; align-items: center; gap: .7rem; min-height: 76px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: .65rem .75rem; }
.topic:hover { border-color: #78a49d; background: #f3f9f6; }
.topic b { display: block; font-size: 1rem; }
.topic small { display: block; color: var(--muted); font-size: .83rem; line-height: 1.4; }
.topic-icon { width: 38px; height: 38px; border-radius: 10px; background: #e8f3ef; color: #17665b; display: grid; place-items: center; flex: 0 0 auto; position: relative; }
.topic-icon::before, .topic-icon::after { content: ""; position: absolute; }
.icon-news::before { width: 17px; height: 20px; border: 2px solid; border-radius: 3px; }
.icon-news::after { width: 8px; height: 2px; background: currentColor; box-shadow: 0 4px currentColor,0 -4px currentColor; }
.icon-reviews { background: #edeaf6; color: #514098; }
.icon-reviews::before { width: 16px; height: 16px; border: 2px solid; border-radius: 50%; }
.icon-reviews::after { width: 6px; height: 6px; border: 2px solid; border-radius: 50%; }
.icon-repair { background: #fcf0dd; color: #895a20; }
.icon-repair::before { width: 19px; height: 6px; border: 2px solid; border-radius: 4px; transform: rotate(-45deg); }
.icon-repair::after { width: 19px; height: 6px; border: 2px solid; border-radius: 4px; transform: rotate(45deg); }
.icon-tools { background: #e7eff6; color: #315d7d; }
.icon-tools::before { width: 19px; height: 14px; border: 2px solid; border-radius: 3px; }
.icon-tools::after { width: 8px; height: 2px; background: currentColor; inset-block-end: 8px; }
.icon-downloads::before { width: 17px; height: 7px; border: 2px solid; border-block-start: 0; border-radius: 0 0 4px 4px; inset-block-end: 8px; }
.icon-downloads::after { width: 8px; height: 8px; border-block-end: 2px solid; border-inline-start: 2px solid; transform: rotate(45deg); inset-block-start: 10px; }

.icon-science::before { width: 19px; height: 19px; border: 2px solid; border-radius: 50%; }
.icon-science::after { width: 4px; height: 4px; background: currentColor; border-radius: 50%; box-shadow: 6px 3px currentColor, -5px -3px currentColor; }
.icon-engineering { color: #315d7d; background: #e7eff6; }
.icon-engineering::before { width: 14px; height: 14px; border: 2px solid; border-radius: 3px; }
.icon-engineering::after { width: 5px; height: 5px; background: currentColor; box-shadow: 0 9px currentColor, 0 -9px currentColor, 9px 0 currentColor, -9px 0 currentColor; }
.icon-os { color: #514098; background: #edeaf6; }
.icon-os::before { width: 13px; height: 20px; border: 2px solid; border-radius: 4px; }
.icon-os::after { width: 4px; height: 2px; background: currentColor; transform: translateY(6px); }
.icon-networks { color: #315d7d; background: #e7eff6; }
.icon-networks::before { width: 4px; height: 5px; border-radius: 1px; background: currentColor; transform: translateX(-7px) translateY(5px); }
.icon-networks::after { width: 4px; height: 16px; border-radius: 1px; background: currentColor; transform: translateX(7px); box-shadow: -7px 5px 0 -1px currentColor; }
.icon-ai { color: #72538b; background: #f1ecf6; }
.icon-ai::before { width: 15px; height: 15px; border: 2px solid; border-radius: 4px; transform: rotate(45deg); }
.icon-ai::after { width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
.support-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-start: 1rem; }
.section-intro { color: var(--muted); margin: -.45rem 0 1.2rem; }
.issue { padding-block: 2rem 4rem; }
.section-page { min-height: 62vh; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-block: .75rem 1.3rem; scroll-margin-top: 1rem; }
.section-head h2, .section-head h1 { font-size: clamp(1.9rem,4vw,3rem); }
.search { display: flex; gap: .45rem; }
.search input, .form input:not([type=checkbox]), .form select, .form textarea { min-width: 0; background: var(--surface); border: 1px solid #c2cdd6; border-radius: 8px; color: var(--ink); padding: .6rem .75rem; }
.search input { width: min(35vw,320px); }
.search-result, .muted, .lede, .card p, .file-row p { color: var(--muted); }
.listing-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; margin-top: 1.5rem; }
.pagination .button { padding-inline: .6rem; }
.pagination .page-number { min-width: 44px; }
.pagination [aria-current="page"]:hover { background: var(--navy); }
.page-gap { color: var(--muted); }
.breadcrumb { display: flex; gap: .4rem .65rem; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-block-end: .9rem; }
.breadcrumb > :not(:last-child)::after { content: "/"; margin-inline-start: .65rem; color: #7d8995; }
.breadcrumb [aria-current] { color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; }
.card, .file-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card:hover { border-color: #9cabba; }
.card-visual { display: block; aspect-ratio: 16/8.8; background: #1e3041; }
.card-visual img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1rem; min-width: 0; }
.eyebrow { display: inline-block; color: var(--teal); font-weight: 700; font-size: .9rem; }
.card h3, .card h2, .file-row h2 { margin-top: .35rem; font-size: clamp(1.05rem,2.1vw,1.23rem); }
.card p, .file-row p { margin: .35rem 0 0; }
.card .button { margin-top: .65rem; }
.download-list { display: grid; gap: .65rem; }
.file-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; padding: .65rem .85rem; gap: .65rem; }
.file-row .card-body { padding: 0; }
.file-row h2 { margin: 0; }
.empty { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.empty p { margin-top: 0; }
.article-path { margin: 1.75rem 0 0; }
.reading { width: min(100%,760px); margin-inline: auto; padding-block: 2rem 4rem; }
.reading.narrow { max-width: 450px; min-height: 55vh; }
.reading h1 { font-size: clamp(2rem,4.8vw,3.75rem); margin: .45rem 0 .65rem; }
.story-header { padding-bottom: .75rem; }
.lede { font-size: 1.16rem; margin: 0 0 .75rem; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; margin: 1.35rem 0; font-size: 1.09rem; line-height: 1.95; }
.article-image { width: 100%; max-height: 540px; object-fit: contain; background: #eef0f1; border-radius: var(--radius); }
.story-actions { padding-top: .9rem; border-top: 1px solid var(--line); }
.form { display: grid; gap: 1rem; margin-top: 1.45rem; }
.form label:not(.checkbox) { display: grid; gap: .3rem; }
.form textarea { resize: vertical; }
.form button { justify-self: start; }
.checkbox { display: flex; gap: .45rem; align-items: center; }
small { color: var(--muted); }
.admin-post-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; }
.admin-post-grid .empty { grid-column: 1 / -1; }
.admin-post { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: .45rem; padding: .75rem; overflow-wrap: anywhere; }
.admin-post h2 { margin-block-start: 0; }
.admin-section-grid .topic b { overflow-wrap: anywhere; }
.delete { margin-top: 2rem; }
.error { color: #9b302a; }
.danger { background: #9b302a; }
.footer { background: #edf1f2; border-top: 1px solid var(--line); }
.footer-inner { min-height: 125px; display: flex; gap: .8rem 1.5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 1rem 0; }
.footer-name p { margin: .25rem 0 0; font-size: .9rem; color: var(--muted); }
.footer nav { display: flex; gap: .4rem 1.2rem; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }

@media (max-width: 950px) {
  .topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 920px) {
  .bar { grid-template-columns: 1fr auto; gap: .3rem 1rem; padding-top: .55rem; }
  .top-nav { grid-row: 2; grid-column: 1 / -1; justify-content: start; }
  .hero { min-height: 380px; }
}
@media (max-width: 650px) {
  .admin-post-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .wrap { width: calc(100% - 1.5rem); }
  .top-nav { gap: 0 .8rem; }
  .top-nav a { padding: .48rem 0; font-size: .875rem; }
  .hero { grid-template-columns: 1fr; margin-block: 1rem 1.65rem; border-radius: 17px; min-height: 0; }
  .hero-copy { padding: 1.3rem 1.05rem 0; }
  .hero h1 { font-size: clamp(1.85rem,7.8vw,3.35rem); }
  .hero-desc { margin-block: .75rem .9rem; }
  .hero-photo { min-height: 175px; }
  .hero-photo::after { background: linear-gradient(to bottom,#102133 0%,transparent 55%); }
  .hero-photo img { object-position: center 52%; }
  .topic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .45rem; }
  .topic { min-height: 67px; gap: .43rem; padding: .45rem; }
  .topic-icon { width: 32px; height: 32px; }
  .topic small { font-size: .79rem; }
  .section-head { flex-direction: column; align-items: stretch; }
  .search input { flex: 1; width: auto; }
  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
  .card-body { padding: .65rem; }
  .file-row .file-icon { display: none; }
  .file-row { grid-template-columns: minmax(0,1fr) auto; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 360px) {
  .cards { grid-template-columns: 1fr; }
  .topic b { font-size: .94rem; }
  .topic small { font-size: .76rem; }
}
