/* RFO2: Silkscreen is the pixel display face; body text stays Tahoma or Verdana */
@font-face {
  font-family: "Silkscreen";
  src: url("../fonts/Silkscreen-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* RFO2: light reading panel on a dark starfield, no dark theme */
:root {
  color-scheme: light;
  --ink: #1a1208;
  --paper: #fff8ee;
  --navy: #1a1464;
  --magenta: #ff2bd6;
  --yellow: #ffe14a;
  --lime: #d6ff6a;
  --link: #0000cc;
  --visited: #551a8b;
  --night: #07071c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--night);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--night);
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(130, 40, 190, 0.5), transparent 52%),
    url("../images/stars.svg");
  background-repeat: no-repeat, repeat;
  background-size: 100% 520px, 140px 140px;
  font-family: Tahoma, Verdana, "Noto Sans", "Liberation Sans", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

::selection {
  background: var(--navy);
  color: var(--yellow);
}

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

.content :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--navy);
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 5;
  background: var(--yellow);
  color: #111;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: bold;
}

.skip:focus {
  top: 8px;
}

/* RFO2: the centered page, about 760px, sitting on the stars */
.frame {
  width: min(760px, calc(100% - 28px));
  margin: 18px auto 32px;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--yellow);
  box-shadow: 7px 7px 0 var(--magenta);
}

.banner {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 16px 14px 12px;
  background: #12082a;
  color: #f4fbff;
}

.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0 1px,
    transparent 1px 4px
  );
}

.banner-kicker,
.site-name,
.tagline {
  position: relative;
  z-index: 1;
}

.banner-kicker {
  margin: 0 0 6px;
  color: var(--yellow);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-name {
  margin: 0;
  font-family: Silkscreen, Tahoma, Verdana, sans-serif;
  font-weight: 400;
  font-size: 32px;
  line-height: 1.2;
  color: #bff7ff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.85), 3px 3px 0 #6a1468;
  -webkit-font-smoothing: none;
}

.tagline {
  margin: 6px 0 0;
  color: #f7f3ea;
  font-size: 15px;
}

/* RFO2: scrolling ticker built with CSS, not a marquee element */
.ticker {
  overflow: hidden;
  background: var(--night);
  color: var(--lime);
  border-top: 2px solid var(--yellow);
  border-bottom: 2px solid var(--magenta);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: rfo2-ticker 32s linear infinite;
}

.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track {
  animation-play-state: paused;
}

.ticker p {
  margin: 0;
  padding: 7px 28px;
  white-space: nowrap;
  font-size: 14px;
}

@keyframes rfo2-ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.layout {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  align-items: start;
  background: var(--navy);
}

.sidebar {
  padding: 10px;
  color: #fff;
}

.sitenav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sitenav a {
  display: block;
  min-height: 40px;
  padding: 8px 8px;
  background: #d9d9d9;
  color: #111;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  border: 2px solid;
  border-color: #fff #4a4a4a #4a4a4a #fff;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.sitenav a:hover,
.sitenav a:focus-visible {
  background: var(--yellow);
  color: #111;
}

.sitenav a[aria-current="page"] {
  background: var(--magenta);
  color: #1a0520;
  border-color: #4a4a4a #fff #fff #4a4a4a;
}

.counter {
  margin-top: 12px;
}

.counter-label {
  margin: 0 0 4px;
  color: #fff;
  font-size: 13px;
  text-align: center;
}

.digits {
  margin: 0;
  padding: 6px 4px;
  background: #000;
  color: #5dff78;
  text-align: center;
  font-family: Silkscreen, "Liberation Mono", monospace;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 1px;
  border: 2px solid;
  border-color: #4a4a4a #fff #fff #4a4a4a;
  -webkit-font-smoothing: none;
}

.content {
  min-width: 0;
  padding: 16px 16px 20px;
  background: var(--paper);
}

h1,
h2,
.group legend,
.new-tag {
  font-family: Silkscreen, Tahoma, Verdana, sans-serif;
  font-weight: 400;
  font-synthesis: none;
  -webkit-font-smoothing: none;
}

h1 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 24px;
  line-height: 1.35;
}

h2 {
  margin: 20px 0 8px;
  color: #5c1248;
  font-size: 16px;
  line-height: 1.45;
  scroll-margin-top: 12px;
}

h3 {
  margin: 14px 0 6px;
  color: var(--navy);
  font-size: 17px;
}

/* RFO2: breadcrumb trail for guides */
.crumbs {
  margin: 0 0 12px;
  font-size: 14px;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin: 0;
}

.crumbs li + li::before {
  content: "»";
  color: #5c1248;
}

.crumbs [aria-current="page"] {
  font-weight: bold;
  color: var(--ink);
}

.feature h3 {
  margin-top: 0;
}

/* RFO2: 1998 web poll */
.poll {
  margin: 0 0 16px;
  padding: 10px 12px 12px;
  background: #fff;
  border: 3px solid var(--navy);
  box-shadow: 4px 4px 0 #7af0ff;
}

.poll legend {
  padding: 0 6px;
  color: var(--navy);
  font-family: Silkscreen, Tahoma, Verdana, sans-serif;
  font-weight: 400;
  font-synthesis: none;
}

.poll-options {
  margin: 8px 0 10px;
  padding: 0;
  list-style: none;
}

.poll-options li {
  margin: 0 0 4px;
}

.poll-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  cursor: pointer;
}

.poll-options input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.poll-actions {
  margin: 0;
}

.poll-note {
  margin: 8px 0 0;
  font-weight: bold;
}

.poll-results {
  margin-top: 12px;
}

.poll-row {
  margin: 0 0 8px;
}

.poll-track {
  height: 18px;
  margin: 2px 0;
  background: #fff;
  border: 2px solid;
  border-color: #4a4a4a #fff #fff #4a4a4a;
}

.poll-fill {
  height: 100%;
  width: 0;
  background: var(--navy);
}

.poll-fill-maybe {
  background: #ff2bd6;
}

.poll-fill-no {
  background: #c9a000;
}

.poll-count {
  font-size: 14px;
  font-weight: bold;
}

/* RFO2: guestbook-style comments */
.comments {
  margin-top: 18px;
}

.comments-status {
  margin: 0 0 10px;
}

.comment-list {
  margin: 0 0 12px;
}

.comment {
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #fff;
  border: 3px solid var(--navy);
  box-shadow: 3px 3px 0 #7af0ff;
}

.comment-name {
  margin: 0;
  color: var(--navy);
  font-weight: bold;
}

.comment-time {
  margin: 0 0 6px;
  font-size: 13px;
}

.comment-body {
  margin: 0;
  white-space: pre-wrap;
}

.comment-form label {
  display: block;
  margin: 0 0 8px;
  font-weight: bold;
}

.comment-form input,
.comment-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 6px 8px;
  color: #111;
  background: #fff;
  border: 2px solid;
  border-color: #4a4a4a #fff #fff #4a4a4a;
  font: inherit;
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

p {
  margin: 0 0 10px;
}

ul,
ol {
  margin: 8px 0 12px;
  padding-left: 1.3em;
}

li + li {
  margin-top: 4px;
}

.deck {
  font-size: 18px;
}

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

.content a:visited {
  color: var(--visited);
}

.content a:hover,
.content a:focus-visible {
  color: #111;
  background: var(--yellow);
}

.step-num {
  display: inline-block;
  min-width: 1.4em;
  margin-right: 6px;
  padding: 2px 5px;
  background: var(--navy);
  color: var(--yellow);
  text-align: center;
}

/* RFO2: NEW blinks by flashing a yellow chip, and the word stays readable */
.new-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 4px;
  color: #9d0000;
  background: transparent;
  animation: rfo2-new 1s steps(1) infinite;
}

@keyframes rfo2-new {
  50% {
    background: var(--yellow);
  }
}

.note-yellow {
  margin: 0 0 14px;
  padding: 8px 10px;
  background: #fff3a0;
  border: 3px solid #111;
  box-shadow: 4px 4px 0 var(--navy);
}

.note-yellow p:last-child {
  margin: 0;
}

.feature,
.group,
.construction {
  margin: 0 0 12px;
  padding: 10px 12px 12px;
  background: #fff;
  border: 3px solid var(--navy);
  box-shadow: 4px 4px 0 #7af0ff;
}

.feature h2 {
  margin-top: 0;
}

.group {
  min-width: 0;
}

.group legend {
  padding: 0 6px;
  color: var(--navy);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meta {
  color: #3a2a22;
}

hr.rainbow {
  height: 8px;
  margin: 0;
  border: 0;
  background: linear-gradient(
    90deg,
    #ff2b2b,
    #ff8a00,
    #ffe14a,
    #39ff6a,
    #2b6bff,
    #b44bff,
    #ff2bd6
  );
}

hr.groove {
  height: 0;
  margin: 16px 0;
  border: 0;
  border-top: 2px solid var(--navy);
  border-bottom: 2px solid var(--yellow);
}

.toc {
  margin: 8px 0 4px;
  padding: 8px 12px 8px 8px;
  background: #fff;
  border: 3px solid var(--navy);
}

.toc ol {
  margin: 0;
}

code,
.mono,
.code-window code {
  font-family: "Liberation Mono", "Cascadia Mono", "Courier New", monospace;
}

code.inline {
  font-size: 0.9em;
  padding: 0 4px;
  color: var(--ink);
  background: #fff3a0;
  border: 1px solid var(--navy);
  overflow-wrap: anywhere;
}

.defs dt {
  margin-top: 10px;
  font-weight: bold;
}

.defs dd {
  margin: 2px 0 0;
}

/* RFO2: beveled buttons, including the yellow default */
.button {
  display: inline-block;
  margin: 2px 8px 2px 0;
  padding: 8px 12px;
  min-height: 40px;
  color: #111;
  background: #d9d9d9;
  border: 2px solid;
  border-color: #fff #4a4a4a #4a4a4a #fff;
  font: inherit;
  font-weight: bold;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

a.button,
a.button:visited,
button.button {
  color: #111;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  background: #eee;
  color: #111;
}

.button:active {
  border-color: #4a4a4a #fff #fff #4a4a4a;
}

.button-default {
  background: var(--yellow);
}

.button-default:hover,
.button-default:focus-visible {
  background: #fff1a8;
}

.actions {
  margin: 12px 0;
}

/* RFO2: terminal boxes for the samples, with a copy button */
.code-window {
  margin: 12px 0;
  max-width: 100%;
  background: #071207;
  border: 3px solid var(--navy);
  box-shadow: 4px 4px 0 var(--magenta);
}

.code-window .title-bar {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 8px 0;
  background: #102418;
  color: var(--lime);
}

.code-window .title-icon,
.code-window .title-buttons {
  display: none;
}

.code-window .title {
  font-family: "Liberation Mono", "Cascadia Mono", monospace;
  font-size: 14px;
  font-weight: 400;
  color: var(--lime);
}

.code-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 4px 8px 6px;
  background: #102418;
}

.code-toolbar button {
  min-width: 72px;
  margin: 0;
}

.code-window pre {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  background: #071207;
  color: #e7ffd4;
  -webkit-overflow-scrolling: touch;
}

.code-window code {
  display: block;
  color: #e7ffd4;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-variant-ligatures: none;
}

.code-window.cmd code::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 3px;
  background: #e7ffd4;
  vertical-align: text-bottom;
}

.figure {
  margin: 12px 0 14px;
}

.figure-frame {
  background: transparent;
  box-shadow: none;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
}

.figure figcaption {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.35;
}

/* RFO2: retro frame around a phone screenshot */
.shot {
  margin: 14px 0 18px;
}

.shot a.frame-link {
  display: block;
  max-width: 600px;
  margin: 0 auto;
  padding: 8px;
  background: #fff;
  border: 3px solid var(--navy);
  box-shadow: 5px 5px 0 var(--magenta);
  line-height: 0;
  transition: box-shadow 0.15s ease;
}

.shot a.frame-link:hover,
.shot a.frame-link:focus-visible {
  background: #fff;
  box-shadow: 7px 7px 0 var(--magenta);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
}

.shot figcaption {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.construction {
  display: flex;
  gap: 10px;
  align-items: center;
}

.construction img {
  width: 96px;
  height: auto;
  flex: 0 0 auto;
}

.construction p {
  margin: 0;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 4px 12px 12px;
  background: var(--paper);
}

.badge {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 280px;
  margin: 0;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--navy);
  box-shadow: 3px 3px 0 var(--magenta);
  font-size: 13px;
  font-weight: bold;
  line-height: 1.3;
  list-style: none;
}

.badge img {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
}

/* RFO2: webring and the copyright line */
.site-footer {
  background: var(--paper);
  text-align: center;
}

.webring {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 12px 10px 4px;
}

.webring a {
  display: inline-block;
  min-height: 36px;
  padding: 6px 10px;
  color: #111;
  background: #d9d9d9;
  border: 2px solid;
  border-color: #fff #4a4a4a #4a4a4a #fff;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.webring a:hover,
.webring a:focus-visible {
  background: var(--yellow);
  color: #111;
}

.copyright {
  margin: 4px 0 12px;
}

/* RFO2: phones stack the sidebar into a button row and keep the column readable */
@media (max-width: 700px) {
  .frame {
    margin-top: 8px;
  }

  .site-name {
    font-size: 24px;
  }

  h1 {
    font-size: 16px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sitenav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sitenav a {
    flex: 1 1 calc(50% - 6px);
  }

  .construction {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* RFO2: ticker, blink, and cursor hold still when motion is reduced */
  .ticker-track {
    animation: none;
    width: auto;
    flex-wrap: wrap;
  }

  .ticker {
    overflow: visible;
  }

  .ticker p {
    white-space: normal;
  }

  .ticker p[aria-hidden="true"] {
    display: none;
  }

  .new-tag,
  .code-window.cmd code::after {
    animation: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .code-window.cmd code::after {
    animation: rfo2-cursor 1.1s steps(1) infinite;
  }
}

@keyframes rfo2-cursor {
  50% {
    opacity: 0;
  }
}
