/* ==========================================================
   BLUE DRAVA - 90s web, modern CSS
   Edit the colour tokens below to re-theme the whole site.
   ========================================================== */

:root {
  --navy-900: #000a2e;
  --navy-800: #001048;
  --navy-700: #001a6e;
  --navy-600: #0a2a9a;
  --navy-400: #3b5bd6;
  --yellow:   #ffd800;
  --yellow-d: #b89a00;
  --paper:    #f4efd0;
  --text:     #e8ecff;
  --link:     #ffd800;
  --link-vis: #ff9f1c;
  --link-hov: #ffffff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--navy-900);
  /* tiled "starfield" background, the classic way */
  background-image:
    radial-gradient(var(--navy-600) 1px, transparent 1.5px),
    radial-gradient(var(--navy-700) 1px, transparent 1.5px);
  background-size: 24px 24px, 12px 12px;
  background-position: 0 0, 6px 6px;
}

a            { color: var(--link); }
a:visited    { color: var(--link-vis); }
a:hover      { color: var(--link-hov); background: var(--navy-400); }
a:focus-visible { outline: 2px dashed var(--yellow); outline-offset: 2px; }

/* ---------- page frame ---------- */

.wrapper {
  max-width: 62rem;
  margin: 1rem auto;
  border: 4px ridge var(--yellow);
  background: var(--navy-800);
  box-shadow: 8px 8px 0 #000;
}

.banner {
  text-align: center;
  padding: 1.25rem 1rem;
  background: linear-gradient(180deg, var(--navy-600), var(--navy-800));
  border-bottom: 4px double var(--yellow);
}

.banner h1 {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  letter-spacing: 0.08em;
  color: var(--yellow);
  text-shadow: 3px 3px 0 #000, -1px -1px 0 var(--navy-400);
}

.banner p {
  margin: 0.25rem 0 0;
  font-style: italic;
  color: var(--paper);
}

/* ---------- layout: side menu + content ---------- */

.layout {
  display: grid;
  grid-template-columns: 13rem 1fr;
  align-items: start;
}

.sidebar {
  padding: 1rem;
  background: var(--navy-900);
  border-right: 4px groove var(--yellow);
  position: sticky;
  top: 0;
}

.sidebar h2 {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--yellow);
  border-bottom: 1px dotted var(--yellow);
}

.sidebar nav ul {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.sidebar nav li { margin: 0 0 0.4rem; }

/* chunky bevelled "button" links */
.sidebar nav a {
  display: block;
  padding: 0.35rem 0.6rem;
  text-decoration: none;
  font-weight: bold;
  color: var(--navy-900);
  background: var(--yellow);
  border: 3px outset var(--yellow);
}
.sidebar nav a:visited { color: var(--navy-900); }
.sidebar nav a:hover   { background: #fff; color: var(--navy-900); border-style: inset; }
.sidebar nav a[aria-current="page"] {
  background: var(--navy-600);
  color: var(--yellow);
  border: 3px inset var(--navy-400);
}

.sidebar .small {
  font-size: 0.75rem;
  text-align: center;
  color: var(--paper);
}

/* fake hit counter */
.counter {
  display: block;
  margin: 0.5rem auto 1rem;
  padding: 0.2rem 0.4rem;
  width: fit-content;
  font: bold 1rem "Courier New", monospace;
  letter-spacing: 0.2em;
  color: #39ff14;
  background: #000;
  border: 2px inset #555;
}

/* 88x31 style badge */
.badge {
  display: block;
  margin: 0 auto 0.5rem;
  width: 88px;
  height: 31px;
  line-height: 27px;
  text-align: center;
  font: bold 11px Verdana, sans-serif;
  color: var(--navy-900);
  background: linear-gradient(90deg, var(--yellow), #fff3a0);
  border: 2px outset var(--yellow);
  text-decoration: none;
}

main {
  padding: 1.25rem 1.5rem 2rem;
  min-width: 0;
}

main h2 {
  margin-top: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.9rem;
  color: var(--yellow);
  border-bottom: 3px double var(--yellow);
}

main h3 { color: var(--yellow); }

hr {
  border: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--yellow) 0 8px, transparent 8px 12px);
  margin: 1.5rem 0;
}

/* ---------- panels / boxes ---------- */

.panel {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--navy-700);
  border: 3px ridge var(--yellow-d);
}

.panel > h3:first-child { margin-top: 0; }

.notice {
  text-align: center;
  padding: 0.4rem;
  font-weight: bold;
  color: var(--navy-900);
  background: repeating-linear-gradient(45deg, var(--yellow) 0 12px, #1a1a1a 12px 24px);
}
.notice span {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  background: var(--yellow);
}

/* scrolling marquee, done in CSS instead of the old <marquee> tag */
.ticker {
  overflow: hidden;
  white-space: nowrap;
  background: #000;
  color: var(--yellow);
  border-top: 2px solid var(--yellow);
  border-bottom: 2px solid var(--yellow);
  font-family: "Courier New", monospace;
}
.ticker span {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 22s linear infinite;
}
@keyframes ticker { to { transform: translateX(-100%); } }

.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .ticker span { animation: none; padding-left: 0; }
  .blink       { animation: none; }
  html         { scroll-behavior: auto; }
}

/* ---------- project list ---------- */

.project-list { list-style: none; margin: 0; padding: 0; }
.project-list li { margin-bottom: 1rem; }
.project-list h3 { margin: 0 0 0.25rem; }
.tag {
  display: inline-block;
  margin-right: 0.3rem;
  padding: 0 0.4rem;
  font-size: 0.75rem;
  color: var(--navy-900);
  background: var(--yellow);
}

/* ---------- Mastodon feed ---------- */

#mastodon-feed { max-height: 28rem; overflow-y: auto; }

.toot {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--navy-800);
  border: 2px inset var(--navy-400);
}
.toot time, .toot .meta { font-size: 0.75rem; color: var(--paper); }
.toot .content p { margin: 0.3rem 0; }
.toot .content a { word-break: break-word; }
.toot img { max-width: 100%; height: auto; border: 2px solid var(--yellow-d); }
.toot .cw { font-style: italic; color: var(--yellow); }
.feed-status { font-style: italic; }

/* ---------- forms / tables / misc ---------- */

table { border-collapse: collapse; width: 100%; }
th, td { padding: 0.4rem 0.6rem; border: 2px solid var(--yellow-d); text-align: left; }
th { background: var(--navy-600); color: var(--yellow); }

footer {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--paper);
  background: var(--navy-900);
  border-top: 4px double var(--yellow);
}

/* ---------- small screens: menu goes on top ---------- */

@media (max-width: 40rem) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; border-right: 0; border-bottom: 4px groove var(--yellow); }
  .sidebar nav ul { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
  .sidebar nav li { flex: 1 1 40%; margin: 0; }
  .sidebar .extras { display: none; }
  main { padding: 1rem; }
}
