/* Moondog portal: a moonlit night over a medieval world.
   Silver and parchment for text, candle-gold for anything you can act on,
   thin ruled borders instead of glow. */

:root {
  --night-0: #05070d;
  --night-1: #0a0e18;
  --night-2: #111726;
  --panel: rgba(13, 17, 28, 0.84);
  --panel-raised: rgba(19, 24, 38, 0.92);
  --ink: #ece6d6;          /* parchment-white: headings and body */
  --ink-soft: #c9c2b0;
  --ink-muted: #918a7a;
  --moon: #cfd8e6;         /* cool silver, used sparingly */
  --gold: #c9a45c;         /* candle-gold: links, buttons, accents */
  --gold-bright: #e2c07a;
  --gold-deep: #8a6d33;
  --rule: rgba(201, 164, 92, 0.22);
  --rule-strong: rgba(201, 164, 92, 0.45);
  --danger: #c8664f;
  --ok: #8fb07a;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: Consolas, Menlo, monospace;
  --radius: 3px;
}

html {
  background: var(--night-0);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

* { scroll-margin-top: 92px; }

body {
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink-soft);
  background:
    radial-gradient(ellipse at 78% 8%, rgba(207, 216, 230, .07), transparent 40%),
    radial-gradient(ellipse at 50% 110%, rgba(201, 164, 92, .06), transparent 45%),
    linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 55%, var(--night-2) 100%);
  background-attachment: fixed;
  position: relative;
}

#moondog-starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* above body's own gradient (body is positioned), below .main-shell */
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .8;
}

.main-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-shell > main { flex: 1; }

/* ---- Type ---- */

h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: .005em;
}

.display-title {
  font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3rem);
  line-height: 1.12;
}

.eyebrow {
  font-family: var(--serif);
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: .14em;
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: .4rem;
}

.lead-text {
  font-size: 1.1rem;
  max-width: 38rem;
}

.body-muted { color: var(--ink-muted); }

a {
  color: var(--gold);
  text-decoration-color: rgba(201, 164, 92, .4);
  text-underline-offset: .18em;
}

a:hover { color: var(--gold-bright); }

code {
  color: var(--moon);
  background: rgba(207, 216, 230, .06);
  padding: .1em .35em;
  border-radius: 2px;
}

pre,
textarea { font-family: var(--mono); }

/* A short gold rule with a diamond, used under page headings. */
.ornament {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 9rem;
  margin: 1rem 0 1.4rem;
  color: var(--gold);
}

.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule-strong);
}

.ornament span {
  width: .45rem;
  height: .45rem;
  transform: rotate(45deg);
  border: 1px solid var(--gold);
}

.ornament.centered { margin-inline: auto; }

/* ---- Navigation ---- */

.site-nav {
  position: relative;
  z-index: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(7, 9, 16, .9);
  border-bottom: 1px solid var(--rule);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink) !important;
  letter-spacing: .02em;
}

/* A crescent: a pale disc with a night-coloured disc offset over it. */
.brand-icon {
  height: 2.1rem;
  width: auto;
  filter: drop-shadow(0 0 10px rgba(207, 216, 230, .25));
}

.site-nav .nav-link {
  color: var(--ink-soft) !important;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.site-nav .nav-link:hover,
.site-nav .nav-link:focus-visible {
  color: var(--ink) !important;
}

.site-nav .nav-link.active {
  color: var(--gold-bright) !important;
  border-bottom-color: var(--gold);
}

.site-nav .nav-user {
  color: var(--ink-muted);
  font-size: .95rem;
}

.navbar-toggler { border-color: var(--rule-strong); }

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(236,230,214,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* ---- Layout blocks ---- */

.page-head { padding: 3rem 0 .5rem; }

.page-head.home { padding: 4.5rem 0 2rem; }
.home-logo {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 0 28px rgba(207, 216, 230, .18));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  /* A second hairline just inside the border, like a ruled margin. */
  box-shadow: inset 0 0 0 4px var(--panel), inset 0 0 0 5px rgba(201, 164, 92, .08);
}

.panel-raised { background: var(--panel-raised); }

.panel h2,
.panel h3 { margin-bottom: .5rem; }

.panel > :last-child { margin-bottom: 0; }

.section-title {
  font-size: 1.35rem;
  margin: 2.5rem 0 1rem;
}

/* Cards that link somewhere: the whole card is the target. */
.link-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, background-color .15s ease;
}

.link-card:hover,
.link-card:focus-visible {
  color: inherit;
  border-color: var(--rule-strong);
  background: var(--panel-raised);
}

.link-card p { flex: 1; }

.link-card .card-go {
  color: var(--gold);
  font-family: var(--serif);
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: .1em;
}

.link-card:hover .card-go { color: var(--gold-bright); }

/* Numbered steps (Quick start, Play checklist). */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1.1rem;
}

.steps > li:last-child { margin-bottom: 0; }

.steps > li::before {
  content: counter(step, upper-roman);
  position: absolute;
  left: 0;
  top: .05rem;
  width: 1.9rem;
  text-align: center;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--gold);
  border-bottom: 1px solid var(--rule-strong);
  line-height: 1.5;
}

.steps h2,
.steps h3 {
  font-size: 1.15rem;
  margin: 0 0 .25rem;
}

/* A step already behind you: its numeral becomes a tick. */
.steps > li.done::before {
  content: "¹3";
  color: var(--ok);
  border-bottom-color: rgba(143, 176, 122, .45);
}

.steps > li.done h2,
.steps > li.done h3 { color: var(--ink-soft); }

/* The three steps across the home page. */
.way-in {
  list-style: none;
  counter-reset: way;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0;
}

.way-in > li {
  counter-increment: way;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.way-in > li::before {
  content: counter(way, upper-roman);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--gold);
}

.way-in h3 {
  font-size: 1.15rem;
  margin: 0;
}

.way-in p { margin: 0; flex: 1; }

.way-in .btn-moon,
.way-in .btn-quiet { align-self: flex-start; margin-top: .4rem; }

/* Label/value pairs: server address, connection details. */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .4rem 1.2rem;
  margin: 0;
}

.facts dt {
  font-family: var(--serif);
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: .08em;
  color: var(--ink-muted);
  font-weight: 400;
}

.facts dd {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  word-break: break-all;
}

/* ---- Buttons ---- */

.btn-moon,
.btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: .08em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

/* Solid colour under the gradient, so the hover fade runs gold to gold
   rather than through transparent. */
.btn-moon {
  background-color: var(--gold);
  background-image: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: 1px solid var(--gold-deep);
  color: #1a1408;
  font-weight: 600;
}

.btn-moon:hover,
.btn-moon:focus-visible {
  background-color: var(--gold-bright);
  background-image: none;
  color: #1a1408;
}

.btn-quiet {
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
}

.btn-quiet:hover,
.btn-quiet:focus-visible {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.btn-danger-quiet {
  background: transparent;
  border: 1px solid rgba(200, 102, 79, .45);
  color: var(--danger);
  border-radius: var(--radius);
  padding: .35rem .9rem;
  font-size: .9rem;
}

.btn-danger-quiet:hover {
  background: rgba(200, 102, 79, .12);
  border-color: var(--danger);
}

:is(.btn-moon, .btn-quiet, .btn-danger-quiet, a, button):focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

/* ---- Forms ---- */

.form-control,
.form-select {
  background-color: rgba(5, 7, 13, .7);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  border-radius: var(--radius);
  padding: .6rem .8rem;
}

.form-control:focus,
.form-select:focus {
  background-color: rgba(5, 7, 13, .9);
  color: var(--ink);
  border-color: var(--gold);
  box-shadow: 0 0 0 .18rem rgba(201, 164, 92, .18);
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23c9a45c' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.form-label {
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: .3rem;
}

.form-check-input {
  background-color: rgba(5, 7, 13, .7);
  border-color: var(--rule-strong);
}

.form-check-input:checked {
  background-color: var(--gold);
  border-color: var(--gold);
}

.field-error,
.validation-summary-errors {
  color: var(--danger);
  font-size: .9rem;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

.validation-summary-valid { display: none; }

/* A line under a field saying what goes in it. */
.field-help {
  color: var(--ink-muted);
  font-size: .88rem;
  margin-top: .3rem;
}

.form-control.input-validation-error { border-color: var(--danger); }

.form-control::placeholder { color: var(--ink-muted); opacity: .7; }

.key-input {
  font-family: var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.key-input::placeholder { letter-spacing: .08em; }

/* Keyboard users' way past the navigation. Off screen until focused. */
.skip-link {
  position: absolute;
  left: .75rem;
  top: -4rem;
  z-index: 2000;
  padding: .5rem .9rem;
  background: var(--gold);
  color: #1a1408;
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus { top: .75rem; color: #1a1408; }

.token-box {
  font-size: .85rem;
  color: var(--moon);
  resize: vertical;
}

/* ---- Character roster ---- */

.character-card {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  height: 100%;
}

.character-card h2 {
  font-size: 1.5rem;
  margin: 0;
}

.level-mark {
  font-family: var(--serif);
  font-variant: small-caps;
  text-transform: lowercase;
  letter-spacing: .08em;
  color: var(--gold);
  white-space: nowrap;
}

.character-card .actions {
  margin-top: auto;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ---- Screenshots ---- */

/* A captured frame: thin gold rule, opens full size in a new tab. */
.shot {
  display: block;
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--night-1);
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform .3s ease;
}

a.shot:hover img { transform: scale(1.02); }

a.shot:hover { border-color: var(--rule-strong); }

.shot-caption {
  font-size: .85rem;
  color: var(--ink-muted);
  margin-top: .4rem;
}

/* Home showcase: text beside a large frame and two small ones; every other
   feature flips sides. */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem 2rem;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}

.feature:nth-of-type(even) .feature-text { order: 2; }

.feature-text h3 {
  font-size: 1.6rem;
  margin-bottom: .6rem;
}

.feature-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}

.feature-shots .shot:first-child { grid-column: 1 / -1; }

/* Home: features that have no screenshot yet, as a grid of short cards. */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 2rem 0 0;
  border-top: 1px solid var(--rule);
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: .4rem;
}

.feature-card .eyebrow {
  font-size: .95rem;
  margin-bottom: .2rem;
}

.feature-card p:last-child { margin-bottom: 0; }

/* Home: what is planned and not in the game yet. */
.later-list {
  columns: 2;
  column-gap: 2.5rem;
  padding-left: 1.2rem;
  margin: 0;
}

.later-list li { break-inside: avoid; margin-bottom: .4rem; }

/* Guide: numbered sections, each a step's text beside its screenshot. */
.guide-step {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 1.25rem 2rem;
  align-items: start;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  counter-increment: guide;
}

.guide { counter-reset: guide; }

.guide-step h2 {
  font-size: 1.5rem;
  margin-bottom: .75rem;
}

.guide-step h2::before {
  content: counter(guide, upper-roman) ".";
  color: var(--gold);
  margin-right: .5rem;
}

.guide-step ul,
.guide-step ol { padding-left: 1.2rem; }

.guide-step li { margin-bottom: .35rem; }

.guide-step strong { color: var(--ink); font-weight: 600; }

.callout {
  border-left: 2px solid var(--gold);
  background: rgba(201, 164, 92, .06);
  padding: .7rem 1rem;
  margin: 1rem 0;
  color: var(--ink-soft);
}

.callout > :last-child { margin-bottom: 0; }

.price-list {
  display: grid;
  grid-template-columns: 1fr max-content;
  gap: .25rem 1.5rem;
  margin: .75rem 0 1rem;
  max-width: 22rem;
}

.price-list dt { font-weight: 400; color: var(--ink-soft); }

.price-list dd {
  margin: 0;
  text-align: right;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.price-list .total {
  border-top: 1px solid var(--rule);
  padding-top: .25rem;
  color: var(--ink);
}

.toc {
  columns: 2;
  column-gap: 2rem;
  padding-left: 1.2rem;
  margin: 0;
}

.toc li { break-inside: avoid; margin-bottom: .3rem; }

kbd {
  font-family: var(--mono);
  font-size: .85em;
  color: var(--ink);
  background: rgba(207, 216, 230, .08);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: .05em .4em;
}

@media (max-width: 991.98px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .feature,
  .guide-step { grid-template-columns: 1fr; }
  .feature:nth-of-type(even) .feature-text { order: 0; }
  .toc,
  .later-list { columns: 1; }
  .way-in,
  .feature-grid { grid-template-columns: 1fr; }
}

/* ---- Footer ---- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: rgba(5, 7, 13, .85);
  color: var(--ink-muted);
  margin-top: 4rem;
  font-size: .92rem;
}

.site-footer a { color: var(--ink-soft); }

.site-footer a:hover { color: var(--gold-bright); }

@media (max-width: 767.98px) {
  .page-head { padding-top: 2rem; }
  .page-head.home { padding: 2.5rem 0 1.5rem; }
  .panel { padding: 1.15rem 1.1rem; }
  .site-nav .nav-link.active { border-bottom-color: transparent; }
}
