@font-face {
  font-family: "FoA Rounded";
  src: local("Arial Rounded MT Bold"), local("ArialRoundedMTBold");
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  /* The seven identity colours, sampled from the supplied PDF. */
  --emerald: #339933;
  --lush: #00cc33;
  --fresh: #66ff99;
  --sunny: #ff9900;
  --bloom: #cc66ff;
  --nectar: #990066;
  --shade: #3300cc;
  --background: #160f20;
  --surface: #201729;
  --text: #ece7ee;
  --muted: #b5aabb;
  --divider: #403249;
  --top-radius: 5px;
  --bottom-radius: 18px;
  --frame-width: 6px;
  --header-height: 148px;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; background: var(--background); color: var(--text); font-size: 15px; line-height: 1.5; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button { background: none; border: 0; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--fresh); outline-offset: 5px; }
button:hover, nav a:hover { color: var(--fresh); }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
.page { width: min(1200px, calc(100% - 96px)); margin: 0 auto; }
.site-header { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; min-height: var(--header-height); border-bottom: 1px solid var(--divider); gap: 24px; }
.brand { display: block; width: 288px; flex-shrink: 0; }
.brand img { width: 100%; height: auto; }
nav { display: flex; gap: 24px; align-items: center; }
nav a, nav button { padding: 10px 0; font-size: 14px; white-space: nowrap; }
nav a[aria-current] { color: var(--fresh); }
nav a, nav button { color: var(--muted); }
nav a[aria-current], nav a:hover, nav button:hover { color: var(--fresh); }
main { position: relative; isolation: isolate; padding-top: 20px; outline: none; }
#archive::before {
  --backdrop-tile: 1160px;
  --side-fade: min(100px, 12%);
  --top-fade: min(70px, 35%);
  --bottom-fade: min(104px, 30%);
  content: "";
  position: absolute;
  inset: calc(-1 * var(--header-height)) 0 0;
  z-index: -1;
  pointer-events: none;
  background: url("assets/background/Backdrop-Web-01.png") center top / var(--backdrop-tile) auto repeat;
  mask-image:
    linear-gradient(to right, transparent, #000 var(--side-fade), #000 calc(100% - var(--side-fade)), transparent),
    linear-gradient(to bottom, transparent, #0003 28px, #0003 var(--header-height), #000 calc(var(--header-height) + var(--top-fade)), #000 calc(100% - var(--bottom-fade)), transparent);
  mask-composite: intersect;
  animation: backdrop-drift 720s linear infinite;
}
/* Whole-tile offsets keep the repeat aligned when the animation restarts. */
@keyframes backdrop-drift {
  from { background-position: 50% 0; }
  to { background-position: calc(50% + var(--backdrop-tile)) calc(4 * var(--backdrop-tile)); }
}
.archive-toolbar, .grid { width: min(980px, 100%); margin-inline: auto; }
.archive-toolbar { position: sticky; top: 10px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
h1 { display: flex; align-items: baseline; gap: 12px; font-size: 24px; line-height: 1.25; font-weight: 400; letter-spacing: -.035em; }
.archive-toolbar button { min-height: 44px; padding: 8px 13px; border-radius: 8px; background: #000; color: var(--text); font-size: 14px; }
.archive-toolbar button:hover, .archive-toolbar button[aria-pressed="true"] { color: var(--fresh); }
.archive-toolbar button[aria-pressed="true"] { box-shadow: inset 0 -2px var(--emerald); }
#shuffle-button { margin-left: auto; }
.grid { --columns: 3; --gap: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.grid[data-masonry] { display: block; position: relative; overflow-anchor: none; }
.grid[data-masonry] > .card { position: absolute; content-visibility: auto; }
.card { min-width: 0; }
.card-button { display: block; width: 100%; height: 100%; padding: 0; text-align: left; }
.card-button:focus-visible { outline: none; }
/* Keyboard focus uses the same frame with a brighter colour. */
.frame { display: block; position: relative; height: 100%; overflow: hidden; border: var(--frame-width) solid var(--emerald); border-radius: var(--top-radius) var(--top-radius) var(--bottom-radius) var(--bottom-radius); background: var(--background); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.media-placeholder { display: grid; place-items: center; height: 100%; background: var(--surface); color: var(--fresh); font-size: 14px; }
.assembly-pair { display: grid; grid-template-columns: repeat(var(--source-count, 2), minmax(0, 1fr)); gap: 2px; width: 100%; height: 100%; overflow: hidden; }
.assembly-pair img { min-width: 0; }
.card-button:hover .frame, .card-button:focus-visible .frame { border-color: var(--fresh); }
.card-caption { position: absolute; inset: auto 0 0; min-height: 80px; display: flex; justify-content: space-between; gap: 8px; align-items: end; padding: 32px 12px 12px; background: linear-gradient(transparent, #08060bbb 66%, #08060bea); }
.card-title { font-size: 14px; line-height: 1.3; color: #fff; font-weight: 400; overflow-wrap: anywhere; }
.card-label { font-size: 10px; line-height: 1.8; color: #e4dce9; flex-shrink: 0; }
dialog { padding: 0; width: min(1030px, calc(100% - 40px)); max-height: calc(100dvh - 40px); border: 1px solid var(--emerald); border-radius: 5px 5px 18px 18px; color: var(--text); background: var(--background); }
#preview {
  width: min(936px, calc(100% - 132px));
  border-width: var(--frame-width);
  overflow: hidden;
}
#preview[open] { display: flex; flex-direction: column; }
.preview-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0 8px 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--emerald) var(--background);
  scrollbar-gutter: stable;
}
.preview-scroll:focus-visible { outline: 1px solid var(--fresh); outline-offset: -1px; }
dialog::backdrop { background: #08050dd9; }
body.modal-open { overflow: hidden; }
.dialog-bar { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 22px; border-bottom: 1px solid var(--divider); background: var(--background); z-index: 1; color: var(--muted); font-size: 12px; }
#preview .dialog-bar { position: static; flex-shrink: 0; padding-block: 6px; }
#preview-heading { color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.dialog-tools, #preview-authoring:not([hidden]) { display: flex; align-items: center; gap: 14px; }
.dialog-tools { flex-shrink: 0; }
#preview-authoring a, #preview-authoring button { padding: 8px 0; color: var(--muted); font-size: 13px; }
#preview-authoring a:hover, #preview-authoring button:hover { color: var(--fresh); }
.preview-action-status { padding: 10px 22px 0; color: var(--muted); }
.close-button { display: flex; align-items: center; gap: 15px; min-height: 36px; padding: 0 2px; font-size: 13px; }
.close-button span { font-size: 22px; font-weight: 400; }
.preview-layout { display: grid; gap: 18px; padding: 22px; }
.preview-hero { position: relative; isolation: isolate; display: grid; gap: 24px; min-width: 0; }
.preview-hero::before {
  content: "";
  position: absolute;
  inset: -22px 0 0;
  z-index: -1;
  pointer-events: none;
  background: url("assets/background/Backdrop-Web-01.png") var(--offset-x) var(--offset-y) / 640px auto repeat;
  opacity: .2;
  mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 74px), transparent);
}
.preview-media { min-width: 0; }
.preview-image, .preview-video { display: block; width: auto; height: auto; max-width: 100%; max-height: 58dvh; margin-inline: auto; object-fit: contain; border-radius: 3px 3px 12px 12px; }
.preview-video { width: 100%; background: #08060b; }
.preview-embed { display: block; width: min(100%, 103dvh); aspect-ratio: 16 / 9; margin-inline: auto; border: 0; border-radius: 3px 3px 12px 12px; background: #08060b; }
.preview-pdf { display: block; width: 100%; height: 58dvh; border: 0; background: var(--surface); }
.preview-audio { display: block; width: 100%; margin-top: 12px; }
.preview-web-link { display: block; margin-top: 12px; color: var(--fresh); overflow-wrap: anywhere; text-decoration: underline; }
.preview-pair { display: grid; grid-template-columns: repeat(var(--source-count, 2), minmax(0, 1fr)); gap: 3px; }
.preview-pair .preview-image { border-radius: 0; }
.preview-download { display: block; width: fit-content; margin-top: 12px; color: var(--fresh); font-size: 13px; text-decoration: underline; }
.preview-title { min-width: 0; padding-top: 18px; border-top: 1px solid var(--divider); overflow-wrap: anywhere; }
.preview-title h2 { font-family: "FoA Rounded", ui-rounded, "Trebuchet MS", sans-serif; font-size: clamp(23px, 4vw, 31px); font-weight: 700; line-height: 1.18; color: var(--emerald); }
.preview-copy { min-width: 0; overflow-wrap: anywhere; }
.preview-copy:empty { display: none; }
.preview-description { color: var(--text); white-space: pre-wrap; }
.preview-copy .sample-note { margin-top: 12px; color: var(--muted); font-size: 12px; }
.related { border-top: 1px solid var(--divider); padding-top: 16px; min-width: 0; }
.related h3 { font-size: 12px; color: var(--muted); font-weight: 400; margin: 0 0 10px; }
.related-links { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px 16px; }
.related button { max-width: 100%; padding: 5px 0; color: var(--fresh); text-align: left; font-size: 14px; overflow-wrap: anywhere; }
.related button:hover { text-decoration: underline; }
.about-dialog { max-width: 560px; }
.about-content { padding: 30px; }
.about-content h2 { font-size: 24px; font-weight: 400; line-height: 1.2; letter-spacing: -.035em; margin: 24px 0; }
.about-content p { color: var(--text); font-size: 14px; margin: 15px 0; }
.about-content small { display: block; border-top: 1px solid var(--divider); margin-top: 30px; padding-top: 18px; color: var(--muted); font-size: 12px; }
.entry-page { width: min(640px, 100%); margin-inline: auto; padding-bottom: 36px; }
.entry-page h1 { font-size: 28px; font-weight: 400; margin-bottom: 24px; }
.entry-form { display: grid; gap: 20px; }
.entry-form label { display: grid; gap: 6px; }
.thumbnail-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.entry-form [hidden] { display: none; }
.entry-form input:not([type="checkbox"]), .entry-form textarea, .entry-form select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.entry-form textarea { resize: vertical; }
.entry-form input:focus-visible, .entry-form textarea:focus-visible, .entry-form select:focus-visible { outline: 2px solid var(--fresh); outline-offset: 2px; }
.entry-form small, .entry-status { color: var(--muted); font-size: 13px; }
.entry-related { border-block: 1px solid var(--divider); padding-block: 12px; }
.entry-related summary { cursor: pointer; }
#entry-related-options { display: grid; gap: 8px; padding-top: 12px; max-height: 220px; overflow: auto; }
#entry-related-options label { display: flex; align-items: baseline; gap: 8px; overflow-wrap: anywhere; }
.entry-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.entry-actions a { color: var(--muted); }
.save-fragment { padding: 9px 14px; border: 1px solid var(--emerald); border-radius: 4px; color: var(--fresh); }
.save-fragment:disabled { opacity: .6; cursor: default; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 12px; background: var(--fresh); color: var(--background); }
@media (max-width: 1000px) { :root { --header-height: 136px; } .page { width: calc(100% - 56px); } .brand { width: 258px; } #preview { width: min(936px, calc(100% - 80px)); } }
@media (max-width: 700px) {
  :root { --frame-width: 4px; --header-height: 112px; }
  .page { width: calc(100% - 36px); }
  .site-header { gap: 12px; }
  .brand { width: 220px; min-width: 0; flex-shrink: 1; }
  nav { gap: 14px; }
  nav a, nav button { font-size: 12px; }
  main { padding-top: 17px; }
  #archive::before { --backdrop-tile: 720px; }
  h1 { font-size: 22px; }
  .archive-toolbar { gap: 6px; margin-bottom: 14px; }
  .archive-toolbar button { padding-inline: 8px; font-size: 12px; }
  .grid { --columns: 2; --gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-caption { padding: 30px 7px 10px; min-height: 68px; flex-wrap: wrap; gap: 2px; }
  .card-label { font-size: 9px; }
  .card-title { font-size: 13px; }
  .preview-layout { padding: 16px; gap: 18px; }
  .preview-hero::before { inset-block-start: -16px; }
  #preview { width: calc(100% - 36px); }
  #preview .dialog-bar { padding-inline: 16px; }
  .dialog-tools, #preview-authoring:not([hidden]) { gap: 9px; }
}
@media (max-width: 380px) { .brand { width: 196px; } nav { gap: 13px; } .archive-toolbar button { padding-inline: 6px; font-size: 11px; } .card-title { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #archive::before { animation: none; }
}

.fragment-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-top: .8rem;
}

.fragment-links a { color: inherit; text-underline-offset: .2em; }
.entry-form .remove-download:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; }
.entry-form .remove-download input { width: auto; }
