/* SS12 — ss12.org
   Palette is lifted from the SS13/SS14 chat window and UI:
   orange = system, green = announcement, red = admin, yellow = command. */

:root {
  --bg: #0a0b10;
  --bg-2: #10121b;
  --panel: #1a1c29;
  --panel-2: #23263a;
  --edge: #4a527f;
  --edge-hi: #7b86c4;
  --edge-lo: #0c0d14;
  --text: #d8dbe8;
  --muted: #8c91a8;
  --sys: #ffa31a;
  --announce: #3fd45a;
  --admin: #ff3b3b;
  --command: #ffd23f;
  --cyan: #5fe0d8;
  --radius: 2px;
  --font: Verdana, Tahoma, "Segoe UI", Geneva, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Lucida Console", "DejaVu Sans Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background-color: var(--bg);
  /* faint station-floor tiles + a few stars */
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 71% 9%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 62%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 47%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 88%, #fff6 50%, transparent 51%),
    linear-gradient(#ffffff06 1px, transparent 1px),
    linear-gradient(90deg, #ffffff06 1px, transparent 1px);
  background-size: 640px 640px, 800px 800px, 520px 520px, 700px 700px, 900px 900px, 32px 32px, 32px 32px;
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* CRT scanlines, very light */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, #00000018 2px 3px);
  z-index: 100;
}

a { color: var(--cyan); text-underline-offset: 3px; }
a:hover { color: #fff; }
img, video { max-width: 100%; height: auto; display: block; }
.grid > *, .two > *, .cols > * { min-width: 0; }
code, kbd { font-family: var(--mono); }
kbd {
  background: var(--panel-2);
  border: 1px solid var(--edge);
  border-bottom-width: 3px;
  border-radius: 3px;
  padding: 0 .4em;
  font-size: .9em;
  color: #fff;
  white-space: nowrap;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: #000; padding: .5rem 1rem; z-index: 200; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- top bar (styled like the SS14 hotbar buttons) ---------- */
.bar {
  position: sticky; top: 0; z-index: 50;
  background: #0d0e16f0;
  border-bottom: 2px solid var(--edge);
  backdrop-filter: blur(4px);
}
.bar .wrap { display: flex; align-items: center; gap: 1rem; min-height: 3.4rem; flex-wrap: wrap; }
.logo {
  font-family: var(--mono); font-weight: 700; font-size: 1.5rem; letter-spacing: .05em;
  color: #fff; text-decoration: none; user-select: none;
  text-shadow: 2px 2px 0 var(--edge), 0 0 14px #7b86c455;
}
.logo b { color: var(--sys); font-weight: 700; }
.nav { display: flex; gap: .35rem; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--text); text-decoration: none; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  padding: .35rem .75rem;
  background: var(--panel-2);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}
.nav a:hover, .nav a:focus-visible { background: var(--edge); color: #fff; }
.nav a.play { background: #1c5a2a; border-color: var(--announce); color: #eaffee; }
.nav a.play:hover { background: #26823b; }

/* ---------- generic panel with beveled "BYOND window" look ---------- */
.window {
  background: var(--panel);
  border: 2px solid var(--edge);
  border-top-color: var(--edge-hi);
  border-left-color: var(--edge-hi);
  border-bottom-color: var(--edge-lo);
  border-right-color: var(--edge-lo);
  box-shadow: 0 10px 30px #0009;
}
.titlebar {
  display: flex; align-items: center; gap: .6rem;
  background: linear-gradient(#3a4272, #2a3055);
  padding: .3rem .6rem;
  font-size: .78rem; color: #e8ebff;
  border-bottom: 1px solid var(--edge-lo);
}
.titlebar .dots { margin-left: auto; display: flex; gap: .3rem; }
.titlebar .dots i { width: .8rem; height: .8rem; border: 1px solid var(--edge-hi); background: #20254a; display: block; }
.titlebar .dots i:last-child { background: #7c2430; }

/* ---------- hero ---------- */
.hero { padding: 3.5rem 0 2.5rem; }
.hero .grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 2.2rem; align-items: center; }
.eyebrow { font-family: var(--mono); color: var(--sys); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 .6rem; }
h1 {
  margin: 0; font-family: var(--mono); font-size: clamp(3.4rem, 11vw, 6.6rem); line-height: .95; letter-spacing: -.02em; color: #fff;
  text-shadow: 4px 4px 0 var(--edge), 8px 8px 0 #20254a, 0 0 40px #7b86c433;
}
h1 span { color: var(--sys); }
.tagline { font-size: clamp(1.05rem, 2.4vw, 1.3rem); margin: 1.2rem 0 1.4rem; color: #fff; }
.tagline em { font-style: normal; color: var(--command); }

.chat {
  font-size: .95rem; line-height: 1.45; padding: .8rem 1rem;
  background: #0006; border: 1px solid #ffffff14; border-left: 3px solid var(--sys);
  margin: 0 0 1.6rem;
}
.chat p { margin: 0 0 .35rem; }
.chat p:last-child { margin: 0; }
.chat .a { color: var(--announce); font-weight: 700; }
.chat .s { color: var(--sys); font-weight: 700; }
.chat .c { color: var(--command); }
.chat .r { color: var(--admin); font-weight: 700; }
.chat .big { font-size: 1.1em; }

.cta { display: flex; flex-wrap: wrap; gap: .8rem; align-items: stretch; }
.connect {
  display: flex; align-items: center; gap: .6rem;
  background: #000; border: 2px solid var(--announce); color: var(--announce);
  font-family: var(--mono); font-size: 1.05rem; padding: .55rem .9rem;
  cursor: pointer; text-align: left; text-decoration: none;
}
.connect:hover { background: #07210d; }
.connect .prompt { color: var(--muted); }
.connect .cursor { display: inline-block; width: .6em; height: 1.05em; background: var(--announce); vertical-align: -.15em; animation: blink 1.1s steps(1) infinite; }
.connect .hint { font-size: .72rem; color: var(--muted); border-left: 1px solid #ffffff22; padding-left: .6rem; }
@keyframes blink { 50% { opacity: 0; } }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; text-decoration: none;
  color: #fff; background: var(--panel-2); border: 2px solid var(--edge); padding: .6rem 1rem; cursor: pointer;
}
.btn:hover { background: var(--edge); color: #fff; }

.hero figure { margin: 0; }
.hero figure img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.hero figcaption { font-size: .75rem; color: var(--muted); padding: .4rem .6rem; border-top: 1px solid var(--edge-lo); background: #0003; }

/* ---------- sections ---------- */
section { padding: 3.2rem 0; }
h2 {
  font-family: var(--mono); font-size: clamp(1.4rem, 3.6vw, 2rem); margin: 0 0 .4rem; color: #fff; text-transform: uppercase; letter-spacing: .06em;
}
h2::before { content: "> "; color: var(--sys); }
.lede { color: var(--muted); max-width: 62ch; margin: 0 0 1.8rem; }

.shot img { width: 100%; height: auto; }
.shot figcaption { padding: .55rem .8rem; font-size: .85rem; color: var(--muted); }
.shot figcaption b { color: var(--text); }

/* features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.feature { padding: 1rem 1.1rem 1.2rem; background: var(--panel); border: 1px solid var(--edge); border-top: 3px solid var(--sys); }
.feature:nth-child(3n+2) { border-top-color: var(--announce); }
.feature:nth-child(3n+3) { border-top-color: var(--cyan); }
.feature h3 { margin: 0 0 .4rem; font-size: 1rem; color: #fff; }
.feature p { margin: 0; color: var(--muted); font-size: .9rem; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.gallery button {
  padding: 0; border: 2px solid var(--edge); background: var(--panel); cursor: zoom-in; position: relative; font: inherit; color: inherit; text-align: left;
}
.gallery button:hover, .gallery button:focus-visible { border-color: var(--sys); }
.gallery img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.gallery span { display: block; padding: .4rem .6rem; font-size: .8rem; color: var(--muted); }

dialog.lightbox { border: 2px solid var(--edge-hi); background: #000; padding: 0; max-width: min(96vw, 1400px); color: var(--text); }
dialog.lightbox::backdrop { background: #000c; }
dialog.lightbox img { max-height: 80vh; width: auto; margin: 0 auto; }
dialog.lightbox p { margin: 0; padding: .6rem 1rem; font-size: .85rem; display: flex; justify-content: space-between; gap: 1rem; }
dialog.lightbox button { background: none; border: 0; color: var(--cyan); font: inherit; cursor: pointer; text-decoration: underline; }

/* how to join */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 3rem 1fr; gap: 1rem; padding: 1rem; background: var(--panel); border: 1px solid var(--edge); }
.steps li::before { content: counter(step); font-family: var(--mono); font-size: 2rem; color: var(--sys); text-shadow: 2px 2px 0 #20254a; line-height: 1; text-align: center; }
.steps h3 { margin: 0 0 .25rem; font-size: 1rem; color: #fff; }
.steps p { margin: 0; color: var(--muted); font-size: .92rem; }
.steps code { color: var(--announce); background: #000; padding: .05em .4em; }

.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.4rem; align-items: start; }
table.keys { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.keys th, table.keys td { padding: .45rem .7rem; text-align: left; border-bottom: 1px solid #ffffff12; vertical-align: top; }
table.keys th { font-weight: 400; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
table.keys td:first-child { white-space: nowrap; }
.note { font-size: .85rem; color: var(--muted); margin-top: 1rem; border-left: 3px solid var(--sys); padding: .2rem .8rem; }

/* faq */
details { background: var(--panel); border: 1px solid var(--edge); margin-bottom: .6rem; }
summary { cursor: pointer; padding: .8rem 1rem; color: #fff; list-style: none; display: flex; gap: .7rem; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; font-family: var(--mono); color: var(--sys); width: 1ch; flex: none; }
details[open] summary::before { content: "−"; }
details[open] summary { border-bottom: 1px solid var(--edge-lo); background: #0003; }
details p { margin: 0; padding: .8rem 1rem 1rem 2.4rem; color: var(--muted); }

/* footer */
footer { border-top: 2px solid var(--edge); background: #07080c; padding: 2.4rem 0 3rem; font-size: .82rem; color: var(--muted); }
footer .cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; }
footer h4 { margin: 0 0 .5rem; font-family: var(--mono); font-size: .8rem; letter-spacing: .15em; text-transform: uppercase; color: var(--sys); }
.laws { font-family: var(--mono); font-size: .78rem; color: #5fe0d8cc; margin: 0; padding-left: 1.6em; }
.laws li { margin: .15rem 0; }
.laws li::marker { color: var(--admin); }
footer p { margin: 0 0 .7rem; }

/* toast (easter eggs) */
#toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 140%);
  z-index: 150; transition: transform .25s ease;
  background: #000e; border: 1px solid #ffffff22; border-left: 3px solid var(--sys);
  padding: .6rem 1rem; max-width: min(92vw, 560px); font-size: .9rem;
}
#toast.on { transform: translate(-50%, 0); }

/* 404 */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 3rem 16px; }
.lost h1 { font-size: clamp(3.4rem, 14vw, 7rem); }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .hero { padding-top: 2rem; }
  .hero .grid, .two, footer .cols { grid-template-columns: 1fr; }
  .nav { margin-left: 0; width: 100%; }
  .nav a { flex: 1 1 auto; text-align: center; }
  .connect .hint { display: none; }
  .steps li { grid-template-columns: 2rem 1fr; }
}
