/* @format */

/* ==========================================================================
   /friends — a 1997-98 personal links page.

   Rules this page follows, from the period:
   - The palette is web-safe: channels drawn only from {00,33,66,99,CC,FF}.
     That constraint is doing most of the work; it's why the palette coheres.
     Four deliberate exceptions, all period-correct system colors rather than
     design choices: #000080 (HTML "navy") and the browser-default link
     colors #0000EE / #551A8B / #EE0000.
   - Windows-95 chrome (#C0C0C0 face) around a parchment reading area
     (#FFFFCC). Both are real period combinations.
   - Hand-rolled 1px bevels, never border-radius, never blurred shadows.
     Shadows are hard 1px offsets only, imitating a WordArt GIF.
   - Verdana at 13px, which is what <font size="2"> rendered as. Verdana runs
     larger than Arial, which is why 1998 pages set it one notch down.
   - Browser-default link colors (#0000EE / #551A8B / #EE0000).
   - Texture tiles BEHIND an opaque panel, so it frames rather than fights.

   Deliberately NOT period: it's responsive, focus states exist, motion
   respects prefers-reduced-motion. The look is 1998; the manners are not.
   ========================================================================== */

:root {
  --face: #cccccc; /* panel chrome (web-safe stand-in for #C0C0C0) */
  --parchment: #ffffcc; /* reading area */
  --navy: #000080; /* section bars */
  --ink: #000000;
  --shadow: #999999; /* bevel dark */
  --hilite: #ffffff; /* bevel light */
  --accent: #cc0000; /* used ONLY for "new" — ornament that carries meaning */
}

/* The starfield. Inline SVG so the page ships no binary assets, but it
   behaves exactly like a tiled background="stars.gif" would. */
body.friends-page {
  margin: 0;
  padding: 24px 12px 48px;
  background-color: #000000;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' fill='%23000000'/%3E%3Crect x='7' y='11' width='1' height='1' fill='%23ffffff'/%3E%3Crect x='29' y='5' width='1' height='1' fill='%23cccccc'/%3E%3Crect x='51' y='19' width='1' height='1' fill='%23ffffff'/%3E%3Crect x='17' y='33' width='1' height='1' fill='%239999cc'/%3E%3Crect x='43' y='41' width='1' height='1' fill='%23ffffff'/%3E%3Crect x='60' y='53' width='1' height='1' fill='%23cccccc'/%3E%3Crect x='3' y='57' width='1' height='1' fill='%23ffffff'/%3E%3Crect x='36' y='60' width='1' height='1' fill='%236666cc'/%3E%3Crect x='23' y='47' width='1' height='1' fill='%23ffffff'/%3E%3C/svg%3E");
  font-family: Verdana, Geneva, "DejaVu Sans", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

/* --- the raised bevel, the single most load-bearing device on the page --- */
.bevel-up {
  border: 2px solid;
  border-color: var(--hilite) var(--shadow) var(--shadow) var(--hilite);
}

.bevel-down {
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
}

/* --- the centered fixed-width container -------------------------------- */
/* 600px is the 1996-98 canvas. width:100% + max-width is the one modern
   concession, so it doesn't break on a phone the way the originals did. */
.shell {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background-color: var(--face);
  padding: 6px;
  box-sizing: border-box;
}

/* --- title plate -------------------------------------------------------- */
.plate {
  background-color: var(--navy);
  padding: 14px 10px 16px;
  text-align: center;
}

.plate h1 {
  margin: 0;
  font-family: Impact, "Arial Black", Haettenschweiler, sans-serif;
  font-size: 34px;
  line-height: 1;
  letter-spacing: 1px;
  color: #ffff66;
  text-transform: uppercase;
  /* hard 1px offset, no blur — this is a WordArt drop shadow, not a CSS one */
  text-shadow: 2px 2px 0 #000000;
}

.plate .sub {
  margin: 7px 0 0;
  font-size: 11px;
  color: #ccccff;
  letter-spacing: 1px;
}

/* --- nav strip ---------------------------------------------------------- */
.navbar {
  background-color: var(--face);
  margin-top: 6px;
  padding: 5px 8px;
  text-align: center;
  font-size: 11px;
}

.navbar a {
  color: var(--navy);
  text-decoration: none;
  font-weight: bold;
  padding: 1px 3px;
}

.navbar a:hover,
.navbar a:focus {
  background-color: var(--navy);
  color: #ffffff;
}

.navbar .sep {
  color: var(--shadow);
  padding: 0 3px;
}

/* --- the reading area --------------------------------------------------- */
.parchment {
  background-color: var(--parchment);
  margin-top: 6px;
  padding: 14px 16px 18px;
}

.parchment p {
  margin: 0 0 12px;
}

.parchment a {
  color: #0000ee;
}
.parchment a:visited {
  color: #551a8b;
}
.parchment a:active {
  color: #ee0000;
}

/* --- section bars ------------------------------------------------------- */
h2.bar {
  margin: 22px 0 12px;
  background-color: var(--navy);
  color: #ffffff;
  font-family: Verdana, Geneva, Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 8px;
}

h2.bar:first-child {
  margin-top: 0;
}

/* period <hr size="1" noshade> — flat, no 3D groove */
hr.flat {
  border: 0;
  border-top: 1px solid var(--shadow);
  height: 0;
  margin: 14px 0;
}

/* --- the friends list: 88x31 in the left cell, words in the right -------
   The button is decoration. The name and the one-line description are the
   content — this is what separated a good links page from mystery meat. */
.friend {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dotted var(--shadow);
}

.friend:last-child {
  border-bottom: 0;
}

.friend-body {
  flex: 1 1 auto;
  min-width: 0;
}

.friend-name {
  font-weight: bold;
  font-size: 13px;
}

.friend-desc {
  font-size: 12px;
  color: #333333;
  margin-top: 2px;
}

.friend-url {
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  color: #666666;
  margin-top: 2px;
  word-break: break-all;
}

/* --- the 88x31 button, built in CSS so the page ships no images ---------
   Split composition: ~28px icon block on the left, text on the right.
   1px hard black border, then a Win95 bevel inside it. That border is why
   a zero-gap grid of these reads as a grid. */
.btn88 {
  flex: 0 0 auto;
  display: block;
  width: 88px;
  height: 31px;
  border: 1px solid #000000;
  background-color: #333333;
  text-decoration: none;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.btn88 .b-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  border: 1px solid;
  border-color: #ffffff #666666 #666666 #ffffff;
}

.btn88 .b-icon {
  flex: 0 0 26px;
  background-color: var(--btn-icon, #000080);
  color: var(--btn-icon-ink, #ffff66);
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn88 .b-text {
  flex: 1 1 auto;
  background-color: var(--btn-face, #cccccc);
  color: var(--btn-ink, #000000);
  font-family: Verdana, Geneva, Arial, sans-serif;
  font-size: 8px;
  font-weight: bold;
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 2px;
}

.btn88:hover .b-inner,
.btn88:focus .b-inner {
  border-color: #666666 #ffffff #ffffff #666666; /* press in on hover */
}

/* --- the button farm: zero-gap grid, borders merging into rules ---------- */
.farm {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 10px 0 4px;
}

.farm .btn88 {
  margin: 0 -1px -1px 0; /* collapse adjacent 1px borders into one line */
}

.farm-note {
  font-size: 11px;
  color: #666666;
  margin-top: 8px;
}

/* --- "new!" tag — the one piece of ornament allowed to move -------------- */
.newtag {
  display: inline-block;
  background-color: var(--accent);
  color: #ffffff;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 1px 4px;
  margin-left: 6px;
  vertical-align: 1px;
  text-transform: uppercase;
  animation: blink 1.2s steps(1) infinite;
}

@keyframes blink {
  0%,
  60% {
    opacity: 1;
  }
  61%,
  100% {
    opacity: 0.25;
  }
}

/* --- marquee, done in CSS so nothing depends on a deprecated element ----- */
.marquee {
  background-color: #000000;
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  overflow: hidden;
  margin-top: 6px;
  padding: 3px 0;
}

.marquee span {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  color: #00ff00;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  animation: scroll-left 26s linear infinite;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* --- footer: counter, stamp, badges ------------------------------------- */
.footer {
  background-color: var(--face);
  margin-top: 6px;
  padding: 12px 10px;
  text-align: center;
  font-size: 11px;
  color: #333333;
}

/* odometer — white digits on black, each in its own cell */
.counter {
  display: inline-flex;
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  background-color: #000000;
  padding: 2px;
}

.counter span {
  font-family: "Courier New", Courier, monospace;
  font-size: 15px;
  font-weight: bold;
  color: #ffffff;
  background-color: #333333;
  padding: 1px 3px;
  margin: 0 1px;
}

.stamp {
  margin-top: 9px;
  font-style: italic;
  color: #666666;
}

.badges {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.footer a {
  color: #0000ee;
}

/* --- narrow screens ----------------------------------------------------
   The originals simply broke here. Keep every visual device, drop the
   two-column row to stacked, and let the farm center itself. */
@media (max-width: 520px) {
  body.friends-page {
    padding: 12px 8px 32px;
  }

  .plate h1 {
    font-size: 26px;
  }

  .friend {
    flex-direction: column;
    gap: 7px;
  }

  .farm {
    justify-content: center;
  }

  .navbar {
    line-height: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .newtag {
    animation: none;
  }

  .marquee span {
    animation: none;
    padding-left: 0;
  }
}

/* Focus visibility — not period, non-negotiable. */
a:focus-visible {
  outline: 2px solid #ee0000;
  outline-offset: 1px;
}

/* ==========================================================================
   ADDITIONS — aliased button type, guestbook
   ========================================================================== */

/* --- aliased pixel type -------------------------------------------------
   Real 88x31 buttons were GIFs with 1-bit, hard-edged type. Browsers
   antialias text, which is the single loudest modern tell on this page.
   The SVG filter (defined inline in friends.html) hard-thresholds the alpha
   channel, snapping every partially-transparent edge pixel to fully on or
   fully off — the same result as a 2-color GIF.

   It has to wrap the glyphs ONLY, not .b-text: that element has an opaque
   background, and thresholding alpha on an opaque layer does nothing. */
.btn88 .px {
  filter: url(#alias);
}

/* --- guestbook ----------------------------------------------------------- */
.gb-form {
  margin: 10px 0 14px;
}

.gb-row {
  margin-bottom: 7px;
}

.gb-row label {
  display: block;
  font-size: 11px;
  font-weight: bold;
  color: #333333;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gb-form input[type="text"],
.gb-form textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: Verdana, Geneva, Arial, sans-serif;
  font-size: 12px;
  padding: 4px 5px;
  background: #ffffff;
  color: #000000;
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
}

.gb-form textarea {
  resize: vertical;
  min-height: 54px;
}

/* A Windows-95 push button: raised at rest, sunken while held. */
.gb-btn {
  font-family: Verdana, Geneva, Arial, sans-serif;
  font-size: 12px;
  font-weight: bold;
  padding: 5px 18px;
  background: var(--face);
  color: #000000;
  border: 2px solid;
  border-color: var(--hilite) var(--shadow) var(--shadow) var(--hilite);
  cursor: pointer;
}

.gb-btn:active {
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  padding: 6px 17px 4px 19px;
}

.gb-entry {
  border: 2px solid;
  border-color: var(--shadow) var(--hilite) var(--hilite) var(--shadow);
  padding: 7px 9px;
  margin-bottom: 6px;
  background: #ffffff;
}

/* zebra striping via bgcolor was the period way to make a list scannable */
.gb-entry:nth-child(even) {
  background: #ffffee;
}

.gb-entry .gb-who {
  font-size: 12px;
  font-weight: bold;
  color: var(--navy);
}

.gb-entry .gb-when {
  font-size: 10px;
  color: #666666;
  font-family: "Courier New", Courier, monospace;
  margin-left: 6px;
}

.gb-entry .gb-msg {
  font-size: 12px;
  margin-top: 3px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

