:root {
  --navy: #0f1d33; --navy-2: #1b2d4a; --accent: #e4572e; --accent-dark: #c9431d; --accent-soft: #fdeee9;
  --bg: #f3f5f8; --ink: #152033; --muted: #5a6779; --line: #d9dfe8; --card: #fff;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--accent-dark); }
a:hover { color: var(--accent); }
code, kbd { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88em; }
kbd { display: inline-block; min-width: 1.6em; padding: .05em .45em; text-align: center; background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--ink); }
code { background: #e9edf3; padding: .08em .35em; border-radius: 4px; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 20px; background: var(--navy); color: #fff; }
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.topbar .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--navy-2); display: grid; place-items: center; }
.topbar .logo svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 2.4; stroke-linecap: round; }
.topbar small { color: #aab6c8; font-weight: 500; }
.topbar .spacer { flex: 1; }
.lang { display: flex; gap: 2px; padding: 3px; border: 1px solid #44567a; border-radius: 9px; font-size: .85rem; font-weight: 600; }
.lang a, .lang span { padding: 3px 10px; border-radius: 6px; text-decoration: none; color: #aab6c8; }
.lang a:hover { color: #fff; background: var(--navy-2); }
.lang .is-current { background: var(--accent); color: #fff; }
.topbar .menu { display: none; background: none; border: 1px solid #44567a; color: #fff; border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }

.wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr); max-width: 1280px; margin: 0 auto; }
nav.side { position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow: auto; padding: 22px 14px 40px 20px; border-right: 1px solid var(--line); }
nav.side h4 { margin: 18px 0 6px 10px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
nav.side a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .95rem; }
nav.side a:hover { background: #e6ebf2; }
nav.side a.is-current { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }

main { padding: 36px 40px 80px; min-width: 0; }
main > article { max-width: 860px; }
h1 { margin: 0 0 6px; font-size: 2rem; line-height: 1.2; }
.lead { margin: 0 0 24px; font-size: 1.1rem; color: var(--muted); }
h2 { margin: 44px 0 10px; padding-top: 6px; font-size: 1.45rem; line-height: 1.25; }
h3 { margin: 28px 0 6px; font-size: 1.1rem; }
p, ul, ol { margin: 0 0 14px; }
li { margin: 3px 0; }

figure { margin: 18px 0 24px; }
figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 2px 10px rgba(15, 29, 51, .08); }
figure.small img { max-width: min(100%, 420px); }
figure.narrow img { max-width: min(100%, 360px); }
figure.crop img { border-radius: 8px; }
figcaption { margin-top: 8px; font-size: .88rem; color: var(--muted); }
.screenshot-link { display: block; width: fit-content; max-width: 100%; cursor: zoom-in; }
.image-viewer {
  --edge: clamp(8px, 2vmin, 24px);
  --picture-height: calc(100dvh - 2 * var(--edge) - 60px);
  width: calc(100% - 2 * var(--edge)); max-width: none; max-height: none;
  margin: auto; padding: 0; border: 0; background: transparent;
}
.image-viewer::backdrop {
  background: transparent;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.image-viewer[open] { display: flex; flex-direction: column; gap: 8px; }
html:has(.image-viewer[open]) { overflow: hidden; }
.image-tools {
  align-self: center; display: flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 4px; border-radius: 10px; background: var(--navy); color: white;
}
.image-tools strong { min-width: 0; margin-inline: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.image-tools button { flex: none; min-height: 44px; padding: 0 12px; border: 1px solid #718098; border-radius: 6px; background: var(--navy-2); color: white; font: inherit; cursor: pointer; }
.image-tools button:focus-visible { outline: 2px solid white; outline-offset: -4px; }
.image-tools button[aria-pressed="true"] { background: white; color: var(--navy); }
.image-stage { order: -1; max-height: var(--picture-height); overflow: auto; overscroll-behavior: contain; }
.image-stage img { display: block; width: 100%; height: auto; max-height: var(--picture-height); object-fit: contain; }
.image-stage.actual-size img { width: auto; max-height: none; margin-inline: auto; }
.pair { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.pair figure { margin: 18px 0 24px; flex: 0 1 auto; }

.note, .warn, .tip { margin: 16px 0; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.note { border-color: #bfd0f5; background: #f3f7ff; } .tip { border-color: #bfe3cb; background: #f2faf5; } .warn { border-color: #f3c3b3; background: var(--accent-soft); }
.note > :last-child, .tip > :last-child, .warn > :last-child { margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin: 14px 0 22px; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: .95rem; }
th, td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: #eaeff5; font-weight: 600; }
tr:last-child td { border-bottom: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 18px 0 30px; }
.card { display: block; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(15, 29, 51, .1); }
.card strong { display: block; margin-bottom: 4px; color: var(--navy); }
.card span { color: var(--muted); font-size: .92rem; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); }
.pager a { padding: 8px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
footer { margin-top: 30px; color: var(--muted); font-size: .85rem; }

@media (max-width: 880px) {
  .wrap { display: block; }
  .topbar .menu { display: inline-block; }
  nav.side { display: none; position: static; height: auto; border: 0; border-bottom: 1px solid var(--line); background: #fff; }
  body.menu-open nav.side { display: block; }
  main { padding: 24px 18px 60px; }
}

/* back to the SCAD Share homepage (the help lives at share.scad.events/help) */
.topbar .home { color: #cfd8e6; text-decoration: none; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.topbar .home:hover { color: #fff; }
footer .footlinks { margin: 8px 0 0; }
footer .footlinks a { color: inherit; }
@media (max-width: 520px) {
  html { scroll-padding-top: 108px; }
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "menu brand brand" "home home lang";
    gap: 4px 10px;
    height: auto;
    padding: 8px 12px;
  }
  .topbar .menu { grid-area: menu; }
  .topbar .brand { grid-area: brand; justify-self: start; }
  .topbar .spacer, .topbar .brand small { display: none; }
  .topbar .home { grid-area: home; justify-self: start; }
  .topbar .lang { grid-area: lang; }
}
