/* Shared colors for the launchpad, its dialogs, and documentation. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f8f8f9;
  --surface-raised: #efeff1;
  --line: #d9d9de;
  --control-line: #797980;
  --text: #161619;
  --muted: #45454e;
  --caption: #605f69;
  --accent: #c91f33;
  --accent-hover: #a51628;
  --on-accent: #ffffff;
  --accent-surface: #fff1f2;
  --accent-border: #d39098;
}

/* The red cap, black seam and white clasp carry across all three pages. */
header:is(.header, .site-header) {
  position: relative;
  max-width: none;
  padding-inline: max(5%, calc((100% - 1350px) / 2));
  background: var(--accent);
  border-bottom: 5px solid var(--text);
  color: white;
}

header:is(.header, .site-header)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2.5px;
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  transform: translate(-50%, 50%);
  border: 4px solid var(--text);
  border-radius: 50%;
  background: white;
  box-shadow: inset 0 0 0 2px white, inset 0 0 0 3px #bbbcc2;
  pointer-events: none;
}

header:is(.header, .site-header) .logo svg {
  fill: var(--accent);
  stroke: white;
}

header:is(.header, .site-header) .logo svg path { fill: white; }

header:is(.header, .site-header) .logo .brand-mark {
  display: block;
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  object-fit: contain;
  /* A white header treatment keeps the thin mark clear on the red masthead. */
  filter: brightness(0) invert(1);
}
header:is(.header, .site-header) nav,
header:is(.header, .site-header) nav a,
header:is(.header, .site-header) .preview-label { color: white; }
header:is(.header, .site-header) .preview-label i { background: white; }
header:is(.header, .site-header) nav a:is(:hover, [aria-current]) {
  color: white;
  text-decoration: underline;
  text-underline-offset: 5px;
}
header:is(.header, .site-header) a:focus-visible { outline-color: white; }

@media (max-width: 650px) {
  header:is(.header, .site-header) { padding-inline: 6%; }
}

/* Tiny Pokédex details sit in existing empty edges, outside normal layout. */
header:is(.header, .site-header)::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 12px;
  width: 58px;
  height: 14px;
  pointer-events: none;
  background:
    radial-gradient(circle at 7px 7px, #dcfaff 0 1px, #3ac1ee 2px 4px, #16658c 4px 5px, #f1f3e5 5px 6px, #702031 6px 7px, transparent 7px),
    radial-gradient(circle at 26px 5px, #f5949c 0 2px, #842336 2px 3px, transparent 3px),
    radial-gradient(circle at 37px 5px, #f3d575 0 2px, #842336 2px 3px, transparent 3px),
    radial-gradient(circle at 48px 5px, #94d4ab 0 2px, #842336 2px 3px, transparent 3px);
}

footer { position: relative; }
footer::after {
  content: "";
  position: absolute;
  bottom: 6px;
  right: 12px;
  width: 30px;
  height: 7px;
  pointer-events: none;
  opacity: .3;
  background: repeating-linear-gradient(105deg, transparent 0 4px, var(--text) 4px 6px);
}

/* Small corner ticks add detail without a frame or a narrower content area. */
@media (min-width: 900px) {
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: .45;
    background:
      linear-gradient(var(--accent-border), var(--accent-border)) left 7px bottom 14px / 12px 1px no-repeat,
      linear-gradient(var(--accent-border), var(--accent-border)) left 7px bottom 14px / 1px 12px no-repeat,
      linear-gradient(var(--accent-border), var(--accent-border)) right 7px bottom 14px / 12px 1px no-repeat,
      linear-gradient(var(--accent-border), var(--accent-border)) right 7px bottom 14px / 1px 12px no-repeat;
  }
}

@media (max-width: 650px) {
  header:is(.header, .site-header)::before {
    top: 5px;
    left: 7px;
    transform: scale(.72);
    transform-origin: top left;
  }
  header:is(.header, .site-header) nav .nav-home { display: none; }
}

@media (max-width: 420px) {
  header:is(.header, .site-header) nav { gap: 10px; font-size: 10px; }
  header:is(.header, .site-header) .logo { font-size: 26px; gap: 7px; }
  header:is(.header, .site-header) .logo svg { width: 22px; }
  header:is(.header, .site-header) .logo .brand-mark { width: 36px; height: 36px; }
}
