/* torrent.nexus's skin (designs/torrent-nexus-style-guide.md): the 1996
   Under Construction page's colours, bevels, faces, ticker and hazard
   strips over the same shell. Every rule is scoped to the theme that
   /api/federation names (page.js's dressTown), so minion.town loads this
   file and is unchanged by it. It changes surfaces and edges only: no
   width, height, gap or target size here differs from shell.css and
   town.css, and no route, landmark or control depends on it. */

html:root[data-theme="torrent-nexus"] {
  color-scheme: dark;
  --chrome-bg: #000080;
  --chrome-fg: #00ff00;
  --chrome-accent: #ffff00;
  --pane-bg: #000040;
  --label-fg: #ffff00;
  --path-bg: #800080;
  --path-fg: #ffffff;
  --fg-muted: #c0c0c0;
  --on-accent: #000080;
  --raised: #000040;
  --selected: #800080;
  --danger: #ff9999;
  --hairline: #c0c0c0;
  --tile: url(/torrent/gifs/tile.gif);
  --bevel-out: #ffffff #404040 #404040 #ffffff;
  --bevel-in: #404040 #ffffff #ffffff #404040;
  /* The account fixtures read on navy in either scheme: town.css's
     dark-scheme ring colours, always. */
  --fx-red: #f08080; --fx-amber: #f0b54a; --fx-green: #7cc97f;
  --fx-teal: #5fc9bb; --fx-blue: #82b4f0; --fx-violet: #c99cec; --fx-ink: #1d1f24;
}

/* The field: navy with the source page's tile, under every page. */
:root[data-theme="torrent-nexus"] body,
:root[data-theme="torrent-nexus"] body.shell,
:root[data-theme="torrent-nexus"] #stage,
:root[data-theme="torrent-nexus"] #chrome,
:root[data-theme="torrent-nexus"] .flush {
  background: var(--chrome-bg) var(--tile);
  color: var(--chrome-fg);
}

/* Faces: the wordmark and page headings in Times; everything else keeps
   the system sans serif (roles/COMMON.md § Typography). */
:root[data-theme="torrent-nexus"] h1 {
  color: var(--chrome-accent);
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
  letter-spacing: 4px;
}
:root[data-theme="torrent-nexus"] a { color: var(--chrome-accent); text-decoration: underline; }
:root[data-theme="torrent-nexus"] .fine,
:root[data-theme="torrent-nexus"] .quiet,
:root[data-theme="torrent-nexus"] .menu-head,
:root[data-theme="torrent-nexus"] .menu-note,
:root[data-theme="torrent-nexus"] .share-audience { color: var(--fg-muted); opacity: 1; }
:root[data-theme="torrent-nexus"] code,
:root[data-theme="torrent-nexus"] .fp { font-family: "Courier New", Courier, monospace; }

/* Controls: square silver buttons with a 2 px outset bevel (the width of
   a default button's border, so no target grows), pressed inset. */
:root[data-theme="torrent-nexus"] #panel button:not(.link):not(.row):not(.chip),
:root[data-theme="torrent-nexus"] .agent button:not(.link):not(.chip),
:root[data-theme="torrent-nexus"] #picker button:not(.row),
:root[data-theme="torrent-nexus"] .composer button {
  background: #c0c0c0;
  color: #000000;
  border: 2px solid;
  border-color: var(--bevel-out);
  border-radius: 0;
}
:root[data-theme="torrent-nexus"] #panel button:not(.link):not(.row):not(.chip):active,
:root[data-theme="torrent-nexus"] .agent button:not(.link):not(.chip):active,
:root[data-theme="torrent-nexus"] #picker button:not(.row):active,
:root[data-theme="torrent-nexus"] .composer button:active { border-color: var(--bevel-in); }
:root[data-theme="torrent-nexus"] button:disabled { color: #606060; }
:root[data-theme="torrent-nexus"] #composer-send {
  background: var(--chrome-accent);
  color: var(--on-accent);
  font-weight: 700;
}
:root[data-theme="torrent-nexus"] #panel button.danger { color: #800000; }
:root[data-theme="torrent-nexus"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
:root[data-theme="torrent-nexus"] textarea,
:root[data-theme="torrent-nexus"] select {
  background: #ffffff;
  color: #000000;
  border: 2px solid;
  border-color: var(--bevel-in);
  border-radius: 0;
}

/* The corner: still cell 0, still 44 px, now a square yellow key. */
:root[data-theme="torrent-nexus"] #corner {
  border-radius: 0;
  border: 2px solid;
  border-color: var(--bevel-out);
  background: var(--chrome-accent);
  color: var(--on-accent);
}

/* Menus, sheets and boxes: raised navy, a silver bevel and a black keyline
   instead of a soft shadow, square corners. */
:root[data-theme="torrent-nexus"] #menu,
:root[data-theme="torrent-nexus"] #panel-menu,
:root[data-theme="torrent-nexus"] #maker-menu,
:root[data-theme="torrent-nexus"] #composer-actions,
:root[data-theme="torrent-nexus"] #picker,
:root[data-theme="torrent-nexus"] .chip-pop,
:root[data-theme="torrent-nexus"] .composer-menu {
  background: var(--raised);
  color: var(--chrome-fg);
  border: 2px solid;
  border-color: var(--bevel-out);
  border-radius: 0;
  box-shadow: 0 0 0 1px #000000;
  animation: none;
}
:root[data-theme="torrent-nexus"] #menu button,
:root[data-theme="torrent-nexus"] #panel-menu button,
:root[data-theme="torrent-nexus"] #maker-menu button,
:root[data-theme="torrent-nexus"] #menu a { border-radius: 0; }
:root[data-theme="torrent-nexus"] .composer #composer-actions button { background: none; color: inherit; border: 0; }
:root[data-theme="torrent-nexus"] .composer #composer-actions button:focus-visible { background: var(--selected); color: #ffffff; }
:root[data-theme="torrent-nexus"] #menu .segmented button[aria-checked="true"] { background: var(--selected); color: #ffffff; }
:root[data-theme="torrent-nexus"] .who,
:root[data-theme="torrent-nexus"] .share-card,
:root[data-theme="torrent-nexus"] .detail .text,
:root[data-theme="torrent-nexus"] .mail-form,
:root[data-theme="torrent-nexus"] .mail-definition {
  background: var(--raised);
  border: 2px solid;
  border-color: var(--bevel-out);
  border-radius: 0;
}
:root[data-theme="torrent-nexus"] .who[data-signed-in="false"] { border-style: dashed; border-color: var(--hairline); }
:root[data-theme="torrent-nexus"] #pane { border-radius: 0; }

/* Rows: the same sizes; selection is purple with white text. */
:root[data-theme="torrent-nexus"] .rows button.row { border-radius: 0; }
:root[data-theme="torrent-nexus"] .rows button.row:hover:not(:disabled) { background: var(--raised); }
:root[data-theme="torrent-nexus"] .rows button.row[aria-pressed="true"],
:root[data-theme="torrent-nexus"] .rows button.row[aria-selected="true"],
:root[data-theme="torrent-nexus"] .composer-menu li[aria-selected="true"] { background: var(--selected); color: #ffffff; }
:root[data-theme="torrent-nexus"] #inbox .chip.path { border-radius: 0; }

/* The mailbox: a received message in a navy box, a sent one purple. */
:root[data-theme="torrent-nexus"] .messages .message-row {
  background: var(--raised);
  border: 2px solid;
  border-color: var(--bevel-out);
  padding: 0.6rem;
  margin: 0.4rem 0;
}
:root[data-theme="torrent-nexus"] .messages .message-row.sent { background: var(--selected); color: #ffffff; }

/* Errors and destructive confirmations. */
:root[data-theme="torrent-nexus"] .error,
:root[data-theme="torrent-nexus"] .field-error { color: var(--danger); }

/* Focus: a 2 px yellow outline with a 2 px navy separation; inset inside a
   list or menu, so it does not cover the neighbour. */
:root[data-theme="torrent-nexus"] :focus-visible {
  outline: 2px solid var(--chrome-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--chrome-bg);
}
:root[data-theme="torrent-nexus"] .rows :focus-visible,
:root[data-theme="torrent-nexus"] #menu :focus-visible,
:root[data-theme="torrent-nexus"] #panel-menu :focus-visible,
:root[data-theme="torrent-nexus"] #maker-menu :focus-visible,
:root[data-theme="torrent-nexus"] #composer-actions :focus-visible,
:root[data-theme="torrent-nexus"] .composer-menu :focus-visible { outline-offset: -4px; box-shadow: none; }
:root[data-theme="torrent-nexus"] #corner:focus-visible { outline: 2px solid var(--chrome-accent); outline-offset: 2px; }

/* The landing (index.html's brand-torrent-nexus template): the source
   page's composition in a centred 560 px column. */
:root[data-theme="torrent-nexus"] #landing.brand { max-width: 560px; text-align: center; }
#landing .wordmark { font-size: 48px; margin: 8px 0; text-shadow: 3px 3px 0 #ff0000; overflow-wrap: anywhere; }
#landing .welcome { color: #ffff00; font-size: 1.5rem; }
#landing .art img, #landing .strip img { image-rendering: pixelated; max-width: 100%; height: auto; }
#landing .strip { display: block; margin: 0 auto; }
#landing .blink { animation: tn-blink 1s steps(1) infinite; }
@keyframes tn-blink { 50% { visibility: hidden; } }
#landing .ticker {
  background: #000000;
  border: 2px solid;
  border-color: var(--bevel-in);
  color: #ffff00;
  font-family: "Courier New", Courier, monospace;
  margin: 12px auto;
  overflow: hidden;
  white-space: nowrap;
}
#landing .ticker span { animation: tn-scroll 18s linear infinite; display: inline-block; padding-left: 100%; }
@keyframes tn-scroll { to { transform: translateX(-100%); } }
#landing .rainbow { animation: tn-rainbow 3s steps(6) infinite; }
@keyframes tn-rainbow {
  0% { color: #ff0000; } 17% { color: #ff9900; } 33% { color: #ffff00; }
  50% { color: #00ff00; } 67% { color: #00ffff; } 83% { color: #ff00ff; }
}
#landing .box {
  background: var(--raised);
  border: 3px solid;
  border-color: var(--bevel-out);
  margin: 16px auto;
  padding: 8px 12px;
}
#landing .stamp, #landing .webring-name { font-family: "Comic Sans MS", "Comic Sans", system-ui, sans-serif; }
#landing .webring {
  background: #800080;
  color: #ffffff;
  border: 3px solid;
  border-color: var(--bevel-out);
  margin: 16px auto;
  padding: 4px 10px;
}
#landing .webring ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1rem; list-style: none; margin: 0.25rem 0 0; padding: 0; }
#landing .webring a { color: #00ffff; display: inline-block; min-height: 32px; line-height: 32px; }
@media (pointer: coarse) { #landing .webring a { min-height: 44px; line-height: 44px; } }
#landing .counter-note, #landing .small { font-size: 13px; color: #c0c0c0; }

@media (prefers-reduced-motion: reduce) {
  #landing .blink, #landing .ticker span, #landing .rainbow { animation: none; }
  #landing .ticker span { padding-left: 0; white-space: normal; }
  #landing .ticker { white-space: normal; }
}

/* Forced colours: system canvas and button colours replace the tile and
   the bevels. */
@media (forced-colors: active) {
  :root[data-theme="torrent-nexus"] body,
  :root[data-theme="torrent-nexus"] #stage,
  :root[data-theme="torrent-nexus"] #chrome,
  :root[data-theme="torrent-nexus"] .flush { background-image: none; }
  :root[data-theme="torrent-nexus"] * { border-color: ButtonBorder; }
}
