/* Team AER apps landing — shared base.
 * Every project page loads this first, then its own theme stylesheet.
 * Keep this file opinion-free: resets, accessibility, the AER shell strip.
 * Pages override the shell look through the --shell-* custom properties. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100dvh; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img, svg, video, canvas { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--focus-ring, #ffbf47); outline-offset: 3px; }
::selection { background: var(--selection-bg, #ffe066); color: var(--selection-fg, #000); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 1000; padding: 10px 14px; background: #000; color: #fff; border-radius: 6px; text-decoration: none; }
.skip-link:focus { top: 16px; }

/* Anchored sections clear a sticky page nav. :where() keeps this at zero
   specificity so a page with a taller nav can override it. */
:where([id]) { scroll-margin-top: var(--anchor-offset, 88px); }

/* Page-wide gutter: 16px on phones, grows with viewport. */
:root { --gutter: clamp(16px, 4vw, 48px); --measure: 62ch; }
.wrap { width: min(100% - 2 * var(--gutter), var(--max-w, 1200px)); margin-inline: auto; }

/* ---- AER shell strip: a thin, consistent "part of Team AER" bar above the page's own nav. ---- */
.aer-strip {
  --_bg: var(--shell-bg, #000);
  --_fg: var(--shell-fg, #fff);
  background: var(--_bg); color: var(--_fg);
  font: 500 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}
.aer-strip .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
/* The shell owns its link colour; a page-level a:not([class]) rule must not recolour it. */
:is(.aer-strip, .aer-footer) a[href] { color: inherit; }
.aer-strip a { text-decoration: none; opacity: 0.85; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 2px; }
.aer-strip a:hover { opacity: 1; }
.aer-strip__mark { width: 28px; height: 28px; object-fit: contain; display: block; flex: 0 0 auto; }
.aer-strip__links { display: flex; gap: 18px; }

/* Long section menus remain reachable in a short phone viewport or landscape. */
.nav-open .aer-nav-menu { max-height: calc(100dvh - var(--nav-menu-top, 104px) - 12px); overflow-y: auto; overscroll-behavior-y: contain; }

/* ---- AER footer (project pages share one footer so every page ends the same way). ---- */
.aer-footer {
  --_bg: var(--footer-bg, #000);
  --_fg: var(--footer-fg, #fff);
  background: var(--_bg); color: var(--_fg);
  padding: 48px 0 40px;
  font: 400 14px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.aer-footer .wrap { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .aer-footer .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
/* Phones: the app's own block spans; "Team AER" and "Other apps" sit side by side. */
@media (max-width: 719px) {
  .aer-footer .wrap { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .aer-footer .wrap > :first-child, .aer-footer__meta { grid-column: 1 / -1; }
  .aer-footer__meta { flex-direction: column; gap: 6px; }
}
.aer-footer h2 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.aer-footer a { text-decoration: none; opacity: 0.8; }
.aer-footer a:hover { opacity: 1; text-decoration: underline; }
.aer-footer ul { display: grid; gap: 0; }
.aer-footer ul a { display: inline-flex; align-items: center; min-height: 34px; }
@media (pointer: coarse) { .aer-footer ul a { min-height: 44px; } }
.aer-footer p + ul { margin-top: 10px; }
.aer-footer__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid color-mix(in srgb, var(--_fg) 18%, transparent); opacity: 0.75; font-size: 13px; }

/* ---- Motion: honour the OS preference everywhere. ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-delay: 0s !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
