/* "Homepage '97": one deliberate look, a lovingly over-decorated 1997 personal homepage.
   It intentionally has a single theme and no light/dark split (a deviation from NFR-10): the
   starfield and bevels are the design. Colours are chosen for WCAG AA on #000033 and #c0c0c0. */

/* Real Comic Sans where the system has it (Windows, macOS: nothing is downloaded); the bundled
   Comic Neue (SIL OFL) elsewhere. */
@font-face {
  font-family: "Comic Neue";
  src: local("Comic Sans MS"), local("ComicSansMS"), url("/static/fonts/comic-neue-regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  --navy: #000033;
  --fg: #ffffff;
  --muted: #ccccff;
  --link: #00ffff;
  --visited: #ff66ff;
  --yellow: #ffff00;
  --magenta: #ff00ff;
  --grey: #c0c0c0;
  --grey-dark: #808080;
  --bevel-dark: #404040;
  --panel-link: #000080;
  --panel-visited: #800080;
  --danger: #a00000;
  --rainbow: linear-gradient(90deg, #ff0000, #ff9900, #ffff00, #00ff00, #00ccff, #cc66ff, #ff0000);
  --body-font: "Comic Neue", "Comic Sans MS", "Chalkboard SE", cursive;
  --head-font: "Times New Roman", Times, serif;
  --mono-font: "Courier New", Courier, monospace;
  --ui-font: "MS Sans Serif", Tahoma, Arial, sans-serif;
  /* Controls sit on white and grey bevels, so they keep their light native rendering. */
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--fg);
  font: 16px/1.5 var(--body-font);
  background-color: var(--navy);
  background-image:
    radial-gradient(1.5px 1.5px at 12px 18px, #fff 99%, transparent),
    radial-gradient(1px 1px at 44px 52px, #ffff99 99%, transparent),
    radial-gradient(1px 1px at 70px 12px, #fff 99%, transparent),
    radial-gradient(2px 2px at 88px 70px, #99ffff 99%, transparent),
    radial-gradient(1px 1px at 30px 84px, #fff 99%, transparent);
  background-size: 100px 100px;
  overflow-x: hidden;
}
a { color: var(--link); }
a:visited { color: var(--visited); }
img, video { max-width: 100%; }
h1, h2, h3 { font-family: var(--head-font); line-height: 1.2; }
h1, h2 { text-align: center; color: var(--yellow); text-shadow: 2px 2px var(--magenta); overflow-wrap: anywhere; }
h1 { font-size: 1.7rem; margin: 16px 0 12px; }
h2 { font-size: 1.3rem; margin: 24px 0 10px; }
h3 { font-size: 1.15rem; color: #ffff66; margin: 16px 0 8px; }
/* The alt text after "/" keeps screen readers from announcing the sparkles. */
h1::before, h2::before { content: "~*~ "; content: "~*~ " / ""; }
h1::after, h2::after { content: " ~*~"; content: " ~*~" / ""; }
hr { border: 0; height: 4px; margin: 12px 0; background: var(--rainbow); }

/* Focus: black, yellow and magenta rings, so it shows on navy, grey and white alike (NFR-5). */
:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #000, 0 0 0 8px var(--magenta);
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: var(--yellow); color: #000; padding: 4px 8px; font-weight: bold; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- Ticker, masthead, toolbar ---- */
.ticker {
  overflow: hidden; background: #000; border-block: 2px solid var(--magenta); padding: 4px 0;
  font: bold 0.95rem var(--mono-font); color: #00ff00; white-space: nowrap;
}
.ticker span { display: inline-block; padding-left: 100%; animation: ticker-scroll 22s linear infinite; }
@keyframes ticker-scroll { to { transform: translateX(-100%); } }
.masthead { text-align: center; padding: 18px 12px 6px; display: grid; gap: 8px; justify-items: center; }
.masthead p { margin: 0; }
.brand {
  font: italic 900 2.6rem/1.1 var(--head-font); text-decoration: none; color: var(--yellow);
  filter: drop-shadow(3px 3px 0 #000080); overflow-wrap: anywhere; max-width: 100%;
}
.brand:visited { color: var(--yellow); }
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
  .brand, .brand:visited {
    background: linear-gradient(90deg, #ff0000, #ff9900, #ffff00, #00ff00, #00ccff, #cc66ff);
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
}
.tagline { font-size: 0.95rem; color: #ffff66; }
.blink { animation: blink 1s steps(1) infinite; color: #ff3333; font-weight: bold; }
@keyframes blink { 50% { visibility: hidden; } }
.construction {
  display: inline-flex; background: repeating-linear-gradient(45deg, #ffcc00 0 10px, #000 10px 20px); padding: 4px;
}
.construction span { background: #ffcc00; color: #000; font: bold 0.8rem "Arial Black", Arial, sans-serif; padding: 3px 8px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; padding: 0 12px; }
.search { flex: 0 1 360px; min-width: 0; }
.search input { width: 100%; }
.nav { display: flex; gap: 10px; }

/* ---- Windows 95 controls ---- */
input, select, textarea {
  font: 1rem var(--head-font); color: #000; background: #fff; max-width: 100%;
  border: 2px solid; border-color: var(--grey-dark) #fff #fff var(--grey-dark);
  box-shadow: inset 1px 1px var(--bevel-dark); padding: 6px 8px; border-radius: 0;
}
input[type="checkbox"], input[type="radio"] {
  width: 1.1em; height: 1.1em; margin: 0.2em 0 0; padding: 0; border: 0; box-shadow: none; background: none;
  accent-color: #000080; flex: none;
}
input[type="file"] { background: var(--grey); font-family: var(--ui-font); }
input[readonly] { background: #eeeeee; }
button, .button, .order a, input[type="file"]::file-selector-button {
  display: inline-block; cursor: pointer; text-decoration: none; text-align: center;
  background: var(--grey); color: #000; font: bold 0.95rem/1.2 var(--ui-font); padding: 7px 14px;
  border: 2px solid; border-color: #fff var(--bevel-dark) var(--bevel-dark) #fff; border-radius: 0;
  box-shadow: inset -1px -1px var(--grey-dark), inset 1px 1px #dfdfdf;
}
.button:visited, .order a:visited { color: #000; }
button:active, .button:active, .order a:active {
  border-color: var(--bevel-dark) #fff #fff var(--bevel-dark); box-shadow: inset 1px 1px var(--grey-dark);
}
button:focus-visible, .button:focus-visible, .order a:focus-visible {
  box-shadow: 0 0 0 2px #000, 0 0 0 8px var(--magenta);
}
/* Win95 marks the default button with an extra black frame. */
.primary { outline: 1px solid #000; outline-offset: 0; }
.primary:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.danger { color: var(--danger); }
.big { font-size: 1.15rem; padding: 12px 20px; }

/* ---- Pages and form panels ---- */
/* Text sits on solid navy so the starfield never speckles through the letters. */
.page, .item { background: var(--navy); border: 3px ridge var(--grey); margin: 12px auto; }
.page { max-width: 760px; padding: 8px 16px 16px; }
.page.wide { max-width: 1000px; }
.page > p, .page li { overflow-wrap: anywhere; }
.form, .share, fieldset {
  background: var(--grey); color: #000;
  border: 3px solid; border-color: #fff var(--bevel-dark) var(--bevel-dark) #fff;
  box-shadow: 2px 2px 0 #000;
}
.form { display: grid; gap: 12px; max-width: 520px; padding: 14px; margin: 12px auto; }
.form label { display: grid; gap: 4px; font-weight: bold; }
.form a, .share a:not(.button) { color: var(--panel-link); }
.form a:visited, .share a:not(.button):visited { color: var(--panel-visited); }
.form .muted, .share .muted { color: #333; }
.check { display: flex !important; gap: 8px; align-items: flex-start; font-weight: normal !important; }
fieldset { display: grid; gap: 8px; box-shadow: none; border-style: groove; border-color: #fff; padding: 8px 12px 12px; margin: 0; }
legend { font-weight: bold; padding: 0 4px; }
.notice {
  padding: 10px 12px; background: #ffffe1; color: #000; border: 1px solid #000; box-shadow: 2px 2px 0 #000;
}
.error { padding: 10px 12px; background: #aa0000; color: #fff; font-weight: bold; border: 2px solid; border-color: #ff6666 #550000 #550000 #ff6666; }
.muted { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.mod-actions { max-width: none; margin: 12px 0; }

/* ---- Browse grid (FR-BRW-1, FR-BRW-2) ---- */
.heading { margin: 14px 12px 10px; }
.order { text-align: center; margin: 10px 12px 14px; }
.order a::after { content: "!!"; content: "!!" / ""; }
.grid { columns: 5 200px; column-gap: 10px; padding: 0 12px; }
.tile {
  display: block; position: relative; break-inside: avoid; margin: 0 0 10px; text-decoration: none;
  background: var(--grey); padding: 5px; border: 3px solid; border-color: #fff var(--bevel-dark) var(--bevel-dark) #fff;
}
.tile:hover, .tile:focus-visible { border-color: var(--yellow) var(--magenta) var(--magenta) var(--yellow); }
.tile video, .tile img { display: block; width: 100%; height: auto; background: #000; }
.cap {
  display: block; text-align: center; color: var(--panel-link); font: bold 0.9rem/1.3 var(--head-font);
  text-decoration: underline; padding-top: 4px; overflow-wrap: anywhere;
}
.anim-badge {
  position: absolute; top: 10px; left: 10px; background: #cc0000; color: var(--yellow); padding: 2px 5px;
  font: bold 11px/1 "Arial Black", Arial, sans-serif; transform: rotate(-12deg); border: 2px solid var(--yellow);
}
.more { display: table; margin: 16px auto; }
.empty { text-align: center; }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; padding: 0; margin: 8px 0; list-style: none; }
.tags a::before { content: "\2605  "; content: "\2605  " / ""; color: var(--yellow); }

/* ---- Item page, share block and embed (FR-SHR-4, FR-SHR-7..10) ---- */
.item { max-width: 960px; padding: 8px 16px 16px; }
.frame {
  width: fit-content; max-width: 100%; margin: 8px auto 0; background: var(--grey); padding: 6px;
  border: 3px solid; border-color: #fff var(--bevel-dark) var(--bevel-dark) #fff; box-shadow: 3px 3px 0 #000;
}
.frame img, .frame video { display: block; max-width: 100%; height: auto; max-height: 70vh; background: #000; }
/* Stills stay at their own size (no upscaling blur); clips get a comfortable viewing width. */
.frame img { width: auto; }
.frame video { width: min(720px, calc(100vw - 72px)); object-fit: contain; }
.share { display: grid; gap: 10px; margin: 16px auto; padding: 14px; max-width: 760px; }
.share h3 { color: var(--panel-link); margin: 8px 0 0; }
.share label { display: grid; gap: 4px; font-weight: bold; }
.big-copy .copy-field, .big-copy button { font-size: 1.15rem; }
.big-copy button { width: 100%; padding: 14px 20px; }
.copy-field { width: 100%; }
.share-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.share-menu li {
  display: grid; gap: 4px; align-content: start; padding: 8px; background: #d4d0c8;
  border: 2px solid; border-color: var(--grey-dark) #fff #fff var(--grey-dark);
}
.platform { font-size: 0.9rem; font-weight: bold; color: #000; }
.share p { margin: 0; }
.owner-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.owner-controls form { margin: 0; }
.item-links { text-align: center; }
.embed { margin: 0; background: #000; }
.embed video { display: block; width: 100%; height: 100vh; max-height: none; border-radius: 0; object-fit: contain; }

/* ---- Upload and processing (FR-MED-2, FR-MED-5, FR-MED-8) ---- */
#upload-status video {
  display: block; width: 100%; max-height: 60vh; margin: 12px 0; background: #000;
  border: 6px solid var(--grey); box-shadow: 3px 3px 0 #000;
}
.uploads { padding-left: 1.2em; }

/* ---- Moderation queue (FR-MOD-1, FR-MOD-3) ---- */
.report {
  display: flex; flex-wrap: wrap; gap: 16px; margin: 24px 0; padding-top: 16px;
  border-top: 4px solid; border-image: var(--rainbow) 1;
}
.report > div { flex: 1 1 320px; min-width: 0; }
.report h2 { text-align: left; }
.page img { height: auto; background: #000; border: 6px solid var(--grey); box-shadow: 3px 3px 0 #000; }

/* ---- Footer: odometer, web ring, 88x31 badges ---- */
.foot { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 6px 12px 24px; font-size: 0.9rem; }
.foot p { margin: 0; }
.odometer { display: inline-flex; gap: 2px; background: #000; padding: 3px; border: 2px inset var(--grey-dark); vertical-align: middle; }
.odometer span {
  background: #111; color: #33ff33; font: bold 1.1rem var(--mono-font); padding: 1px 5px; border: 1px solid #333;
  font-variant-numeric: tabular-nums;
}
.webring { border: 2px ridge var(--grey); padding: 6px 10px; background: #000080; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.badge88 {
  width: 88px; height: 31px; display: grid; place-items: center; text-align: center; color: #fff;
  font: bold 9px/1.1 Verdana, Arial, sans-serif; border: 1px solid #fff;
}
.badge-netscape { background: #003399; }
.badge-html { background: #660066; }
.badge-gif { background: #006600; }

@media (max-width: 600px) {
  .brand { font-size: 2rem; }
  .search { flex-basis: 100%; }
  .grid { columns: 2; column-gap: 8px; padding: 0 8px; }
  .tile { margin-bottom: 8px; padding: 4px; }
  .page, .item { padding-inline: 10px; margin-inline: 6px; }
}

/* NFR-5: the ticker and blink are decoration; they stop for anyone who asks for less motion. */
@media (prefers-reduced-motion: reduce) {
  .ticker span, .blink { animation: none !important; }
  .ticker span { padding-left: 0; }
}
