:root {
  --bg: #bfbfbf;
  --desktop: #d7d7d7;
  --surface: #eeeeee;
  --surface-light: #fbfbfb;
  --surface-dark: #9f9f9f;
  --ink: #111111;
  --muted: #3f3f3f;
  --accent: #3d6d70;
  --accent-soft: #dce8e8;
  --line: #111111;
  --shadow: #777777;
  --max: 1180px;
  --gutter: clamp(16px, 3vw, 32px);
  --font-body: Geneva, Verdana, "Lucida Grande", Arial, sans-serif;
  --font-system: Monaco, "Andale Mono", "Lucida Console", "Courier New", monospace;
}

:root[data-background="blueprint"] {
  --bg: #aebdc3;
  --desktop: #cbd8dc;
  --surface-dark: #8ea0a6;
  --accent: #284f59;
  --accent-soft: #dbe8eb;
  --shadow: #68777d;
}

:root[data-background="sage"] {
  --bg: #b7c1b1;
  --desktop: #d4ddd0;
  --surface-dark: #96a38f;
  --accent: #36593a;
  --accent-soft: #e1eadc;
  --shadow: #6c7668;
}

:root[data-background="paper"] {
  --bg: #c9c3b4;
  --desktop: #e0dacd;
  --surface-dark: #aaa18f;
  --accent: #5f4f2f;
  --accent-soft: #eee7d8;
  --shadow: #7c7466;
}

:root[data-background="plain"] {
  --bg: #f7f7f7;
  --desktop: #ffffff;
  --surface: #f2f2f2;
  --surface-light: #ffffff;
  --surface-dark: #d6d6d6;
  --muted: #222222;
  --accent: #000000;
  --accent-soft: #f8f8f8;
  --shadow: #555555;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.22) 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.08) 75%) 0 0 / 8px 8px,
    var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--ink);
}

a:hover {
  text-decoration-thickness: 3px;
}

.text-link,
.profile-links a,
.window-body > p a,
.admin-status a {
  background-image: linear-gradient(var(--ink), var(--ink));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 3px;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--surface-light);
  border: 2px solid var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

.menu-bar {
  min-height: 40px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 0 10px;
  background: var(--surface-light);
  border-bottom: 2px solid var(--line);
  box-shadow: 0 2px 0 var(--shadow);
}

.menu-brand,
.menu-list a,
.menu-toggle,
.background-picker legend {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-system);
  font-size: 0.82rem;
  line-height: 1.15;
}

.menu-brand {
  gap: 8px;
  padding: 0 8px 0 2px;
  font-weight: 700;
  white-space: nowrap;
}

.pixel-mark {
  width: 18px;
  height: 18px;
  display: inline-block;
  background:
    linear-gradient(var(--ink), var(--ink)) 4px 2px / 10px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 2px 4px / 14px 10px no-repeat,
    linear-gradient(var(--surface-light), var(--surface-light)) 4px 6px / 10px 6px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 6px 14px / 6px 2px no-repeat;
  image-rendering: pixelated;
}

.menu-list {
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.menu-list a {
  padding: 0 10px;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
}

.menu-list a:hover,
.menu-list a[aria-current="page"] {
  background: var(--ink);
  color: var(--surface-light);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  border-left: 2px solid var(--line);
  border-right: 2px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

.background-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 6px;
  border: 0;
  border-left: 2px solid var(--line);
}

.background-picker legend {
  float: left;
  margin: 0 2px 0 0;
  padding: 0;
  color: var(--muted);
}

.background-swatch {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.28) 25%, transparent 25%) 0 0 / 6px 6px,
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.12) 75%) 0 0 / 6px 6px,
    var(--swatch-bg);
  border: 2px solid var(--line);
  box-shadow:
    inset -2px -2px 0 rgba(0, 0, 0, 0.2),
    inset 2px 2px 0 rgba(255, 255, 255, 0.72);
  cursor: pointer;
  image-rendering: pixelated;
}

.background-swatch:hover,
.background-swatch[aria-pressed="true"] {
  transform: translateY(-1px);
  box-shadow:
    0 2px 0 var(--ink),
    inset -2px -2px 0 rgba(0, 0, 0, 0.2),
    inset 2px 2px 0 rgba(255, 255, 255, 0.72);
}

.background-swatch[aria-pressed="true"]::after {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 6px;
  height: 6px;
  content: "";
  background: var(--ink);
  border: 1px solid var(--surface-light);
}

.background-swatch-classic {
  --swatch-bg: #bfbfbf;
}

.background-swatch-blueprint {
  --swatch-bg: #aebdc3;
}

.background-swatch-sage {
  --swatch-bg: #b7c1b1;
}

.background-swatch-paper {
  --swatch-bg: #c9c3b4;
}

.background-swatch-plain {
  --swatch-bg: #f7f7f7;
}

.window-reset {
  align-self: stretch;
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-left: 2px solid var(--line);
  border-right: 2px solid var(--line);
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.window-reset:hover {
  color: var(--surface-light);
  background: var(--ink);
}

.window-reset[hidden] {
  display: none;
}

.desktop-field {
  padding: clamp(24px, 4vw, 52px) var(--gutter);
  border-bottom: 2px solid var(--line);
  background:
    radial-gradient(circle at 24px 24px, rgba(17, 17, 17, 0.18) 0 1px, transparent 1px 100%) 0 0 / 24px 24px,
    var(--desktop);
}

.desktop-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  grid-template-areas:
    "welcome companion"
    "welcome themes"
    "about events"
    "about join";
  gap: 18px;
  align-items: start;
}

.desktop-grid.is-free-layout {
  position: relative;
  display: block;
}

.desktop-grid.is-free-layout > .window {
  position: absolute;
  margin: 0;
}

.welcome-window {
  grid-area: welcome;
}

.about-window {
  grid-area: about;
}

.themes-window {
  grid-area: themes;
}

.events-window {
  grid-area: events;
}

.join-window {
  grid-area: join;
}

.companion-window {
  grid-area: companion;
}

.window,
.mini-panel {
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--shadow);
}

.window {
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.window.is-focused,
.window:hover {
  box-shadow: 7px 7px 0 #5f5f5f;
}

.title-bar {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 7px;
  background:
    repeating-linear-gradient(
      to bottom,
      var(--surface-light) 0,
      var(--surface-light) 2px,
      var(--surface-dark) 2px,
      var(--surface-dark) 3px
    );
  border-bottom: 2px solid var(--line);
}

.desktop-grid.is-free-layout .title-bar {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.desktop-grid.is-free-layout .title-bar:active,
.desktop-grid.is-free-layout .window.is-dragging .title-bar {
  cursor: grabbing;
}

body.is-window-dragging {
  cursor: grabbing;
  user-select: none;
}

.window.is-dragging {
  box-shadow: 9px 9px 0 #4f4f4f;
}

.title-text {
  display: inline-block;
  margin: 0;
  padding: 1px 7px 2px;
  background: var(--surface);
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.title-bar h1.title-text {
  max-width: none;
  font-size: 0.82rem;
  line-height: 1.2;
}

.window-lines {
  flex: 1 1 auto;
  min-width: 20px;
  height: 12px;
}

.window-box {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  display: inline-block;
  background: var(--surface-light);
  border: 2px solid var(--line);
  box-shadow: inset 2px 2px 0 var(--surface-dark);
}

.window-body {
  padding: clamp(16px, 3vw, 26px);
}

.welcome-window .window-body {
  padding: clamp(22px, 4vw, 42px);
}

.system-note,
.item-meta,
.footer-meta {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--font-system);
  font-size: 0.82rem;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-family: var(--font-system);
  font-size: clamp(2rem, 5vw, 4.7rem);
  line-height: 0.98;
  font-weight: 700;
}

.subtitle {
  max-width: 760px;
  margin: 18px 0 0;
  padding: 12px 14px;
  background: var(--surface-light);
  border: 2px solid var(--line);
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.25;
  font-weight: 700;
}

.lead {
  max-width: 820px;
  margin: 18px 0 0;
  font-size: clamp(1.05rem, 1.45vw, 1.25rem);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.classic-button,
button.classic-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 7px 13px;
  color: var(--ink);
  background: var(--surface-light);
  border: 2px solid var(--line);
  box-shadow:
    inset -2px -2px 0 var(--surface-dark),
    inset 2px 2px 0 #ffffff;
  font-family: var(--font-system);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transform: translate(0, 0);
  transform-origin: center;
}

.classic-button:hover {
  color: var(--surface-light);
  background: var(--ink);
  text-decoration: none;
  box-shadow: none;
}

.classic-button:active {
  transform: translate(2px, 2px);
  box-shadow: inset 2px 2px 0 var(--shadow);
}

.classic-button:disabled,
button.classic-button:disabled {
  color: var(--muted);
  background: var(--surface);
  cursor: not-allowed;
  opacity: 0.56;
  box-shadow: none;
  transform: none;
}

.classic-button.small {
  min-height: 34px;
  margin-top: 8px;
  font-size: 0.82rem;
}

.text-link {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-system);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration-thickness: 2px;
}

.check-list,
.compact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li,
.compact-list li {
  position: relative;
  margin: 0 0 10px;
  padding-left: 26px;
}

.check-list li::before,
.compact-list li::before {
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 15px;
  height: 15px;
  content: "";
  background: var(--surface-light);
  border: 2px solid var(--line);
  box-shadow: inset -2px -2px 0 var(--surface-dark);
}

.check-list li::after {
  position: absolute;
  left: 4px;
  top: 0.15em;
  width: 5px;
  height: 9px;
  content: "";
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.compact-list time {
  display: block;
  font-family: var(--font-system);
  font-size: 0.78rem;
  font-weight: 700;
}

.page-section,
.page-shell {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) var(--gutter);
}

.page-shell {
  display: grid;
  gap: 26px;
}

.section-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-system);
  font-size: clamp(1.4rem, 3vw, 2.3rem);
  line-height: 1.05;
}

.interest-grid,
.theme-grid,
.member-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.theme-grid,
.member-grid {
  align-items: stretch;
}

.member-card .window-body {
  display: grid;
  align-content: start;
  gap: 16px;
}

.member-portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(17, 17, 17, 0.12) 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(45deg, transparent 75%, rgba(17, 17, 17, 0.12) 75%) 0 0 / 8px 8px,
    var(--surface-light);
  border: 2px solid var(--line);
  box-shadow:
    inset -3px -3px 0 var(--surface-dark),
    inset 3px 3px 0 #ffffff;
}

.member-portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 34%;
  filter: contrast(1.04) saturate(0.88);
}

.member-portrait::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.14) 0,
      rgba(255, 255, 255, 0.14) 1px,
      transparent 1px,
      transparent 4px
    );
  mix-blend-mode: screen;
}

.member-portrait-placeholder {
  position: absolute;
  inset: 0;
}

.member-portrait-placeholder::before {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74px;
  height: 74px;
  content: "";
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 50% 28%, var(--ink) 0 15px, transparent 16px),
    radial-gradient(ellipse at 50% 82%, var(--ink) 0 31px, transparent 32px);
  image-rendering: pixelated;
}

.mini-panel {
  padding: 18px;
}

.mini-panel h3 {
  margin: 12px 0 8px;
  font-family: var(--font-system);
  font-size: 1rem;
}

.mini-panel p {
  margin: 0;
}

.css-icon {
  position: relative;
  display: block;
  width: 44px;
  height: 38px;
  image-rendering: pixelated;
}

.css-icon.folder {
  background:
    linear-gradient(var(--surface-light), var(--surface-light)) 2px 10px / 40px 26px no-repeat,
    linear-gradient(var(--surface-light), var(--surface-light)) 2px 4px / 18px 10px no-repeat;
  border-bottom: 0;
}

.css-icon.folder::before,
.css-icon.hand::before,
.css-icon.circuit::before {
  position: absolute;
  inset: 0;
  content: "";
  border: 2px solid var(--line);
}

.css-icon.folder::before {
  top: 10px;
}

.css-icon.folder::after {
  position: absolute;
  left: 2px;
  top: 4px;
  width: 18px;
  height: 10px;
  content: "";
  border: 2px solid var(--line);
  border-bottom: 0;
}

.css-icon.hand {
  background:
    linear-gradient(var(--ink), var(--ink)) 8px 8px / 4px 18px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 16px 4px / 4px 22px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 24px 8px / 4px 18px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 8px 26px / 24px 4px no-repeat;
}

.css-icon.hand::before {
  border-style: dashed;
}

.css-icon.circuit {
  background:
    linear-gradient(var(--ink), var(--ink)) 8px 9px / 28px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 8px 24px / 28px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 21px 9px / 2px 17px no-repeat;
}

.css-icon.circuit::after {
  position: absolute;
  left: 7px;
  top: 8px;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--surface-light);
  border: 2px solid var(--line);
  box-shadow: 22px 15px 0 -2px var(--surface-light), 22px 15px 0 0 var(--line);
}

.page-intro .window-body {
  background:
    linear-gradient(90deg, transparent 0 11px, rgba(17, 17, 17, 0.08) 11px 12px) 0 0 / 12px 12px,
    var(--surface);
}

.profile-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 5px 12px;
  margin: 0;
}

.profile-list dt {
  font-family: var(--font-system);
  font-size: 0.78rem;
  font-weight: 700;
}

.profile-list dd {
  margin: 0;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 14px 0 0;
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-links a {
  text-decoration-thickness: 2px;
}

.news-list {
  display: grid;
  gap: 18px;
}

.with-filter {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.filter-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 700;
}

select {
  min-height: 34px;
  padding: 4px 30px 4px 8px;
  color: var(--ink);
  background: var(--surface-light);
  border: 2px solid var(--line);
  border-radius: 0;
  font: inherit;
}

input,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  color: var(--ink);
  background: var(--surface-light);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.12);
  font: inherit;
}

textarea {
  resize: vertical;
}

.news-item[hidden] {
  display: none;
}

.filter-stack {
  display: grid;
  gap: 5px;
}

.filter-status {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-system);
  font-size: 0.78rem;
}

.archive-panel {
  max-width: 820px;
}

.theme-grid .mini-panel {
  min-height: 100%;
}

.future-panel .columns {
  columns: 2;
  column-gap: 34px;
}

.contact-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  align-items: start;
}

.contact-layout .page-intro {
  grid-column: 1 / -1;
}

.contact-action-panel {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding: 16px;
  background: var(--surface-light);
  border: 2px solid var(--line);
  box-shadow: inset -2px -2px 0 var(--surface-dark);
}

.contact-primary-button {
  width: fit-content;
  min-width: min(100%, 260px);
}

.contact-help {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-system);
  font-size: 0.82rem;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-line {
  max-width: 100%;
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-light);
  border: 2px solid var(--line);
  overflow-wrap: anywhere;
}

.admin-shell {
  width: 100%;
  max-width: 1320px;
  min-width: 0;
}

.admin-shell > *,
.admin-command-body,
.admin-editor-grid,
.admin-edit-window,
.admin-preview-window {
  min-width: 0;
}

.admin-lock-window {
  max-width: 720px;
}

.admin-lock-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.admin-action-row,
.admin-tabs,
.admin-section-title,
.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-command-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 2px solid var(--line);
}

.admin-workflow li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 10px;
  background: var(--surface);
  border-right: 2px solid var(--line);
  font-family: var(--font-system);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.admin-workflow li:last-child {
  border-right: 0;
}

.admin-workflow li span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  background: var(--surface-light);
  border: 2px solid var(--line);
}

.admin-workflow li.is-complete span {
  color: transparent;
}

.admin-workflow li.is-complete span::after {
  width: 5px;
  height: 9px;
  content: "";
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.admin-workflow li[aria-current="step"] {
  color: var(--surface-light);
  background: var(--ink);
}

.admin-workflow li[aria-current="step"] span {
  color: var(--ink);
}

.admin-tabs {
  width: 100%;
  max-width: 100%;
  padding-bottom: 3px;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.admin-tabs .classic-button {
  flex: 0 0 auto;
  gap: 4px;
}

.admin-draft-mark {
  display: none;
}

.admin-tabs .has-draft .admin-draft-mark {
  display: inline;
}

.admin-tabs .has-draft:not(.is-active) {
  box-shadow:
    inset -2px -2px 0 var(--surface-dark),
    inset 2px 2px 0 #ffffff,
    3px 3px 0 var(--accent);
}

.admin-tabs .classic-button[aria-selected="true"],
.classic-button.is-active {
  color: var(--surface-light);
  background: var(--ink);
  box-shadow: none;
}

.admin-primary-action {
  outline: 2px solid var(--line);
  outline-offset: 2px;
}

.admin-file-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.admin-status {
  margin: 4px 0 0;
  padding: 10px 12px;
  background: var(--surface-light);
  border: 2px solid var(--line);
  font-family: var(--font-system);
  font-size: 0.82rem;
}

.admin-status[data-state="error"] {
  border-style: dashed;
}

.admin-draft-status {
  min-width: 280px;
  margin: 4px 0 0;
  padding: 10px 12px;
  color: var(--muted);
  background: var(--surface);
  border: 2px dotted var(--line);
  font-family: var(--font-system);
  font-size: 0.78rem;
}

.admin-draft-status[data-state="draft"],
.admin-draft-status[data-state="saving"] {
  color: var(--ink);
  background: var(--accent-soft);
  border-style: solid;
}

.admin-draft-status[data-state="error"] {
  color: var(--ink);
  background: var(--surface-light);
  border-style: dashed;
}

.admin-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.admin-form-stack,
.admin-preview-list,
.admin-validation-panel,
.admin-preview-panel {
  display: grid;
  gap: 16px;
}

.admin-validation-panel,
.admin-preview-panel {
  margin-bottom: 22px;
}

.admin-validation-panel h3,
.admin-preview-panel h3,
.admin-section-title h3,
.admin-preview-card h4,
.admin-archive-preview h4 {
  margin: 0;
  font-family: var(--font-system);
  line-height: 1.15;
}

.admin-validation-panel h3,
.admin-preview-panel h3,
.admin-section-title h3 {
  font-size: 1rem;
}

.admin-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-field {
  display: grid;
  gap: 5px;
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-field textarea,
.admin-field input,
.admin-field select {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
}

.admin-field select {
  width: 100%;
}

.admin-field small {
  color: var(--muted);
  font-weight: 400;
}

.admin-field-wide {
  grid-column: 1 / -1;
}

.admin-item {
  min-width: 0;
  margin: 0;
  padding: 14px;
  background: var(--surface-light);
  border: 2px solid var(--line);
  box-shadow: inset -3px -3px 0 var(--surface-dark);
}

.admin-form-section,
.admin-list-section {
  display: grid;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px dotted var(--line);
}

.admin-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: var(--surface-light);
  border: 2px solid var(--line);
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 2px;
}

.admin-row-actions .classic-button,
.admin-item-actions .classic-button {
  margin-top: 0;
}

.admin-item legend {
  padding: 0 6px;
  background: var(--surface);
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-collapsible {
  padding: 0;
}

.admin-item-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 0 solid var(--line);
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-item-summary span:last-child {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 400;
  text-align: right;
}

.admin-collapsible[open] .admin-item-summary {
  border-bottom-width: 2px;
}

.admin-item-content {
  padding: 14px;
}

.admin-item-actions {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.admin-details {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px dotted var(--line);
}

.admin-details summary {
  margin-bottom: 10px;
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-advanced {
  padding: 14px;
  background: var(--surface);
  border: 2px dashed var(--line);
}

.admin-advanced > summary {
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.admin-advanced[open] > summary {
  margin-bottom: 14px;
}

.admin-link-list {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-preview-card,
.admin-archive-preview {
  padding: 14px;
  background: var(--surface-light);
  border: 2px solid var(--line);
  box-shadow:
    inset -2px -2px 0 var(--surface-dark),
    inset 2px 2px 0 #ffffff;
}

.admin-preview-card {
  display: grid;
  gap: 10px;
}

.admin-preview-card p {
  margin: 0;
}

.admin-home-preview h4 {
  font-size: 1.45rem;
}

.admin-preview-subtitle {
  padding: 8px 10px;
  border: 2px solid var(--line);
  font-weight: 700;
}

.admin-static-bubble {
  position: static;
}

.admin-preview-card .member-portrait {
  max-width: 260px;
}

.admin-output-field textarea {
  min-height: 320px;
  font-family: var(--font-system);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: pre;
}

.admin-validation-list li {
  margin-bottom: 8px;
}

.admin-validation-error::before {
  background: var(--surface-light);
  border-style: dashed;
}

.admin-validation-ok::after {
  position: absolute;
  left: 4px;
  top: 0.15em;
  width: 5px;
  height: 9px;
  content: "";
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.companion-stage {
  position: relative;
  min-height: 170px;
  overflow: hidden;
  background:
    linear-gradient(var(--surface-dark), var(--surface-dark)) 0 calc(100% - 24px) / 100% 2px no-repeat,
    radial-gradient(circle at 14px 14px, rgba(17, 17, 17, 0.16) 0 1px, transparent 1px 100%) 0 0 / 18px 18px,
    var(--surface-light);
  border: 2px solid var(--line);
}

.dog-button {
  position: absolute;
  left: 8px;
  bottom: 16px;
  width: 160px;
  height: 96px;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  animation: companion-walk 9s steps(18, end) infinite alternate;
}

.dog-button:hover,
.dog-button:focus-visible {
  animation-play-state: paused;
}

.pixel-dog {
  position: relative;
  z-index: 1;
  display: block;
  width: 160px;
  height: 96px;
  fill: currentColor;
  image-rendering: pixelated;
}

.dog-eye,
.dog-bandana {
  fill: var(--surface-light);
}

.dog-bandana {
  stroke: var(--ink);
  stroke-width: 0;
}

.dog-tail {
  transform-origin: 32px 42px;
  animation: tail-wag 520ms steps(2, end) infinite;
}

.dog-leg {
  transform-origin: center top;
  animation: paw-step 520ms steps(2, end) infinite;
}

.leg-two,
.leg-four {
  animation-delay: 260ms;
}

.dog-shadow {
  position: absolute;
  left: 28px;
  bottom: 7px;
  width: 104px;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 14px);
  opacity: 0.22;
}

.thought-bubble {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  min-height: 48px;
  margin: 0;
  padding: 9px 11px;
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 var(--shadow);
  font-family: var(--font-system);
  font-size: 0.78rem;
  line-height: 1.35;
}

.thought-bubble::after {
  position: absolute;
  left: 34px;
  bottom: -10px;
  width: 12px;
  height: 12px;
  content: "";
  background: var(--surface);
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  transform: rotate(45deg);
}

.companion-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.companion-counter,
.companion-note {
  margin: 0;
  font-family: var(--font-system);
  font-size: 0.78rem;
}

.companion-note {
  margin-top: 12px;
  color: var(--muted);
}

.companion-window.is-petted .dog-button {
  animation-play-state: paused;
}

.companion-window.is-petted .pixel-dog {
  animation: happy-hop 420ms steps(2, end) 1;
}

.companion-window.is-petted .thought-bubble {
  background: var(--accent-soft);
}

.pet-spark {
  position: absolute;
  z-index: 3;
  color: var(--ink);
  font-family: var(--font-system);
  font-size: 1rem;
  font-weight: 700;
  pointer-events: none;
  animation: pet-spark 700ms steps(5, end) forwards;
}

:root[data-background="plain"] body,
:root[data-background="plain"] .desktop-field,
:root[data-background="plain"] .companion-stage,
:root[data-background="plain"] .member-portrait,
:root[data-background="plain"] .page-intro .window-body {
  background: var(--surface-light);
}

:root[data-background="plain"] .title-bar {
  background: var(--surface-light);
}

:root[data-background="plain"] .member-portrait::after {
  display: none;
}

@keyframes classic-button-signal {
  0% {
    color: var(--ink);
    background: var(--surface-light);
    box-shadow:
      inset -2px -2px 0 var(--surface-dark),
      inset 2px 2px 0 #ffffff;
    transform: translate(0, 0);
  }

  35% {
    color: var(--surface-light);
    background: var(--ink);
    box-shadow: 3px 0 0 var(--accent);
    transform: translate(-1px, 0);
  }

  70% {
    box-shadow: -3px 0 0 var(--accent);
    transform: translate(1px, 0);
  }

  100% {
    color: var(--surface-light);
    background: var(--ink);
    box-shadow: none;
    transform: translate(0, 0);
  }
}

@keyframes link-pixel-underline {
  0% {
    background-size: 0 3px;
  }

  50% {
    background-size: 54% 3px;
  }

  100% {
    background-size: 100% 3px;
  }
}

@keyframes menu-screen-refresh {
  0% {
    box-shadow: inset 0 0 0 transparent;
  }

  50% {
    box-shadow: inset 0 -5px 0 var(--accent);
  }

  100% {
    box-shadow: inset 0 0 0 transparent;
  }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .classic-button:not(:disabled):hover {
    animation: classic-button-signal 300ms steps(3, end) both;
  }

  .classic-button:not(:disabled):active {
    animation: none;
  }

  .text-link:hover,
  .profile-links a:hover,
  .window-body > p a:hover,
  .admin-status a:hover {
    animation: link-pixel-underline 360ms steps(4, end) forwards;
  }

  .menu-list a:hover,
  .menu-brand:hover,
  .window-reset:hover {
    animation: menu-screen-refresh 280ms steps(2, end);
  }
}

@keyframes companion-walk {
  from {
    left: 8px;
  }

  to {
    left: calc(100% - 168px);
  }
}

@keyframes tail-wag {
  0% {
    transform: rotate(-8deg);
  }

  100% {
    transform: rotate(14deg);
  }
}

@keyframes paw-step {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(4px);
  }
}

@keyframes happy-hop {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes pet-spark {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-30px) scale(1.4);
  }
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px var(--gutter);
  background: var(--surface-light);
  border-top: 2px solid var(--line);
}

.site-footer p {
  margin: 4px 0 0;
}

@media (max-width: 940px) {
  .desktop-grid,
  .interest-grid,
  .theme-grid,
  .member-grid,
  .contact-layout,
  .admin-editor-grid,
  .admin-field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .desktop-grid {
    grid-template-areas:
      "welcome welcome"
      "about about"
      "themes events"
      "companion companion"
      "join join";
  }

  .contact-layout .page-intro {
    grid-column: 1 / -1;
  }

  .admin-editor-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .menu-bar {
    flex-wrap: wrap;
    padding: 0 8px;
  }

  .menu-brand {
    max-width: calc(100% - 84px);
    white-space: normal;
  }

  .menu-toggle {
    display: inline-flex;
    justify-content: center;
    padding: 0 12px;
  }

  .background-picker {
    order: 4;
    width: 100%;
    min-height: 38px;
    padding: 4px 0 8px;
    border-top: 2px solid var(--line);
    border-left: 0;
  }

  .background-picker legend {
    min-height: 28px;
    margin-right: 4px;
  }

  .window-reset {
    display: none;
  }

  .menu-list {
    order: 3;
    display: none;
    width: 100%;
    flex-direction: column;
    margin: 0;
    padding: 4px 0 8px;
    border-top: 2px solid var(--line);
  }

  .menu-list.is-open {
    display: flex;
  }

  .menu-list a {
    min-height: 34px;
    padding: 0 8px;
  }

  .desktop-grid,
  .interest-grid,
  .theme-grid,
  .member-grid,
  .contact-layout,
  .admin-editor-grid,
  .admin-field-grid,
  .admin-link-row,
  .admin-lock-form {
    grid-template-columns: 1fr;
  }

  .desktop-grid {
    grid-template-areas:
      "welcome"
      "companion"
      "about"
      "themes"
      "events"
      "join";
  }

  h1 {
    max-width: 100%;
  }

  .section-heading,
  .with-filter,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .classic-button {
    width: 100%;
  }

  .admin-action-row,
  .admin-item-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-tabs .classic-button {
    width: auto;
  }

  .admin-workflow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-workflow li:nth-child(2) {
    border-right: 0;
  }

  .admin-workflow li:nth-child(-n + 2) {
    border-bottom: 2px solid var(--line);
  }

  .admin-file-state,
  .admin-list-row {
    grid-template-columns: 1fr;
  }

  .admin-draft-status {
    min-width: 0;
  }

  .admin-row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-list {
    grid-template-columns: 1fr;
  }

  .future-panel .columns {
    columns: 1;
  }

  .companion-controls {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .dog-button {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #111111;
    --accent: #000000;
    --shadow: #444444;
  }

  body,
  .desktop-field,
  .companion-stage,
  .member-portrait,
  .page-intro .window-body {
    background: var(--surface-light) !important;
  }

  .title-bar {
    background: var(--surface-light) !important;
  }

  .member-portrait::after {
    display: none;
  }
}
