/* Mid-grey and violet from the CER reference, within a shared rounded window. */
:root {
  color-scheme: light;
  --bg: #939393;
  --surface: #a6a4a9;
  --panel: #99959f;
  --ink: var(--accent);
  --muted: var(--accent);
  --line: #79717f;
  --control: #504659;
  --accent: #420078;
  --violet: #7000ef;
  --violet-text: var(--accent);
  --font: Helvetica, Arial, sans-serif;
  --tri-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='32' viewBox='0 0 240 32'%3E%3Cg fill='none' stroke='%235d4276' stroke-width='.7' opacity='.55'%3E%3Cpath d='M0 16 C40 1 80 1 120 16 S200 31 240 16'/%3E%3Cpath d='M0 16 C20 8 40 8 60 16 S100 24 120 16 S160 8 180 16 S220 24 240 16'/%3E%3Cpath d='M0 12 C13 12 27 20 40 20 S67 12 80 12 S107 20 120 20 S147 12 160 12 S187 20 200 20 S227 12 240 12'/%3E%3C/g%3E%3C/svg%3E");
}

body {
  padding: 38px 30px 46px;
  letter-spacing: .01em;
  background-image: url("assets/cer-hex-pattern.svg");
  background-size: 124.708px 216px;
  /* Place an upright mark at the centre, preserving the hexagonal spacing. */
  background-position: calc(50% + 62.354px) calc(50% + 36px);
  background-attachment: fixed;
}

body::before { opacity: .018; }

.app-window {
  max-width: 1120px;
  margin: 0 auto;
  background: rgb(166 164 169 / .8);
  -webkit-backdrop-filter: blur(.7px);
  backdrop-filter: blur(.7px);
  border: 1px solid #62596b;
  border-radius: 30px;
  box-shadow: inset 0 1px 0 #c2bec7, 8px 9px 0 #4b405a40, 0 20px 60px #33234012;
  overflow: clip;
}

.window-titlebar {
  display: block;
  min-height: 70px;
  padding: 10px 18px;
  border-bottom: 0;
  background: transparent;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-align: center;
  text-transform: uppercase;
}

.window-titlebar::before,.window-titlebar::after { content: none; }
.masthead { padding: 20px 30px 69px; gap: 0; }
/* Allow space for The while preserving the size of the original lettering. */
.masthead .brand { width: min(calc(50% * 1339 / 1244), calc(360px * 1339 / 1244)); transform: translateY(-18px); }
.brand .wordmark { width: 100%; max-width: none; }
.app-window main { min-height: 50vh; padding: 0 40px; }
/* Route changes focus the content landmark; links and controls retain their focus rings. */
.app-window main:focus { outline: none; }
.intro { padding-top: 55px; }

.masthead nav { gap: 10px; }
nav a {
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
}
nav a:hover { background: var(--panel); color: var(--ink); }
nav a[aria-current=page] {
  color: #f3edf9;
  background: #6200c7;
  border-color: #5100a5;
  box-shadow: inset 0 1px 0 #ffffff26;
}

.btn {
  background: #aaa6b1;
  border-color: var(--control);
  box-shadow: inset 0 1px 0 #c5bfce, 0 2px 0 #5b506c44;
}
.btn:hover { background: #b8afc5; border-color: var(--accent); }
.btn.primary, .tabs button[aria-pressed=true] {
  background: #6200c7;
  color: #f3edf9;
  border-color: #5100a5;
  box-shadow: inset 0 1px 0 #ffffff26, 0 2px 0 #5b506c44;
}
.btn.primary:hover { background: #5100a5; }
nav a[aria-current=page] .signal-dot { background: #f3edf9; }

.filters input, .filters select, input[type=text], textarea,
.ra-accessibility select, .ra-controls input {
  background-color: #b2aeb9;
  border-color: var(--control);
  box-shadow: inset 0 2px 2px #30203d18;
}
button, input, textarea, select { color: var(--ink); }
input::file-selector-button { color: var(--ink); }
::placeholder { color: var(--muted); opacity: 1; }
input[type=checkbox] { accent-color: var(--accent); }
.art { background: #9e99a5; }
.art.field { background: #9996a0; }
.art.paper { background: #b2adb9; color: var(--ink); }
.tag { background: #aaa5b1; }
audio, video { color-scheme: light; }

.app-window footer { margin: 65px 40px 0; padding: 30px 0 28px; }
.app-window footer .principles-link { margin-top: 8px; font-size: 10px; }
.app-window footer .slogan {
  font-size: clamp(8.4px, 2.38vw, 22.4px);
  color: var(--violet-text);
}
.app-window footer .slogan > span:last-child { font-weight: 400; }
.slogan > span:first-child {
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
}
.slogan > span:last-child { font-weight: 700; }
#toast { border-radius: 20px; box-shadow: 0 4px 20px #30203d26; color: #f3edf9; }
.skip { border-radius: 18px; color: #f3edf9; }
.skip:focus-visible { box-shadow: 0 0 0 8px var(--surface); }
::selection { background: #6200c7; color: #f3edf9; }

@media (max-width: 800px) {
  body { padding: 22px 18px 30px; }
  .app-window main { padding: 0 28px; }
  .app-window footer { margin-inline: 28px; }
  .window-titlebar { padding-inline: 20px; }
}

@media (max-width: 767px) {
  .masthead .brand { transform: translateY(-16px); }
}

@media (max-width: 520px) {
  body { padding: 12px 10px 20px; }
  .app-window { border-radius: 23px; box-shadow: 4px 5px 0 #4b405a40; }
  .window-titlebar { min-height: 60px; padding: 9px 10px; }
  .masthead { padding: 13px 12px 63px; gap: 0; }
  .masthead nav { max-width: 260px; gap: 4px 5px; }
  nav a { padding: 7px 9px; font-size: 9px; letter-spacing: .1em; }
  .app-window main { padding: 0 20px; }
  .intro { padding-top: 42px; }
  .intro h1 { font-size: clamp(38px, 10.8vw, 56px); }
  .slogan, .intro h1.slogan { font-size: clamp(10px, 2.9vw, 15px); }
  .app-window footer .slogan { font-size: clamp(7px, 2.03vw, 10.5px); }
  .app-window footer { margin: 50px 20px 0; }
  .account { padding: 0; }
}

/* Page-specific hierarchy and the Archive's compact browsing column. */
main[data-page=relay] .intro h1 { color: var(--violet-text); }
main[data-page=relay] .intro .serif {
  max-width: 660px;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.5;
  letter-spacing: 0;
}
main[data-page=relay] .relay-affirmation {
  display: block;
  margin-top: 14px;
  color: var(--violet-text);
  font-family: Georgia, serif;
  font-size: clamp(24px, 3vw, 32px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.35;
}
#relay-identity-slot { max-width: 520px; margin: 0 auto 20px; }
main[data-page=archive] .intro { padding-bottom: 14px; }
main[data-page=archive] .intro h1 {
  max-width: 650px;
  margin-inline: auto;
  margin-bottom: 18px;
  font-size: clamp(15.6px, 2.4vw, 24px);
  color: var(--violet-text);
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
}
#archive-constellation { margin: 0 auto 24px; }

/* Clear content lettering and open headings; the brand motto keeps its own rules. */
#main h2, #main h3 {
  font-family: var(--font);
  letter-spacing: .01em;
  line-height: 1.3;
}
#main:not([data-page=archive]) > .intro h1:not(.slogan) {
  font-family: var(--font);
  font-style: normal;
  font-weight: 400;
  letter-spacing: .025em;
  line-height: 1.2;
}

#main[data-page=transceiver] > .intro h1:not(.slogan) {
  font-size: clamp(12px, 3vw, 26px);
  font-weight: 400;
  letter-spacing: .14em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

#main[data-page=archive] .card[href="#passage/return"] h3 {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.archive-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  margin: 8px 0 35px;
}
.archive-filters, .archive-results { min-width: 0; }
.archive-filters .filters {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  max-width: none;
  margin: 0;
  text-align: left;
}
.archive-filters label {
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.archive-filters label:first-child { margin-top: 0; }
.archive-filters input, .archive-filters select {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 12px 14px;
  font-size: 13px;
  text-align: left;
}
.archive-results #results-count { margin: 0 0 12px; text-align: left; }
.archive-results .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.archive-results .card { min-width: 0; overflow-wrap: anywhere; }
.format-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
  letter-spacing: 0;
}
.format-marker svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 1000px) {
  .archive-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
  .archive-results .grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .archive-layout { grid-template-columns: 1fr; gap: 26px; }
  .archive-filters { max-width: 340px; width: 100%; }
  .archive-filters input, .archive-filters select { font-size: 16px; }
}
