:root {
  --bg: #0d1117;
  --fg: #e6edf3;
  --muted: #7d8590;
  --accent: #e3b341;
  --border: #30363d;
  --grid: rgba(255, 255, 255, 0.025);
  --font-mono: ui-monospace, "JetBrains Mono", "Fira Code", SFMono-Regular,
               Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: 100vh;
}

.plate {
  position: relative;
  width: 100%;
  max-width: 720px;
  border: 1px solid var(--border);
  background: rgba(13, 17, 23, 0.65);
  padding: 2rem;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: stretch;
  gap: 1.75rem;
}

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

/* Mascot is optional -- if @@MASCOT@@ is empty the .plate just has one flex
   child (.info) and lays out as before. */
.mascot {
  flex: 0 0 auto;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}
.mascot__frame {
  position: relative;
  padding: 4px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}
.mascot__frame::before,
.mascot__frame::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent);
}
.mascot__frame::before { top: -1px; left: -1px; }
.mascot__frame::after  { bottom: -1px; right: -1px; }
.mascot__frame img {
  display: block;
  width: 100%;
  height: auto;
  filter: contrast(1.05);
}
.mascot__caption {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-align: center;
}

.spec__hint {
  color: var(--muted);
  font-style: italic;
  margin-left: 0.4rem;
}

.attribution {
  color: var(--muted);
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  margin-top: 0.75rem;
  opacity: 0.75;
  text-align: center;
}

@media (max-width: 600px) {
  .plate { flex-direction: column; gap: 1.25rem; padding: 1.5rem; }
  .mascot { width: 160px; align-self: center; }
}

/* ---------- walkthrough button ---------- */
.walk-btn {
  appearance: none;
  margin-top: 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: transparent;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.walk-btn:hover, .walk-btn:focus-visible {
  background: rgba(227, 179, 65, 0.08);
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}
.walk-btn__arrow { color: var(--accent); transition: transform 0.15s; }
.walk-btn:hover .walk-btn__arrow { transform: translateX(3px); }

/* ---------- walkthrough dialog ---------- */
.walkthrough {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  padding: 0;
  max-width: 640px;
  width: calc(100% - 2rem);
  border-radius: 0;
  font-family: var(--font-mono);
  line-height: 1.55;
  position: relative;
  overflow: hidden;
}
.walkthrough::backdrop {
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(4px);
}
.walkthrough[open] { animation: walkIn 0.25s ease-out; }
@keyframes walkIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.walkthrough__head {
  position: relative;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px dashed var(--border);
}
.walkthrough__eyebrow {
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  margin-bottom: 0.35rem;
}
.walkthrough__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  padding-right: 2.5rem;
}
.walkthrough__close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 2rem; height: 2rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.walkthrough__close:hover { color: var(--accent); border-color: var(--accent); }

.walkthrough__step {
  padding: 1.5rem;
  min-height: 220px;
  animation: stepIn 0.3s ease-out;
}
@keyframes stepIn {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.walkthrough__step[hidden] { display: none; }
.walkthrough__step h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
  letter-spacing: -0.005em;
}
.walkthrough__step p {
  font-size: 0.875rem;
  margin-bottom: 0.8rem;
  max-width: 56ch;
}
.walkthrough__step code {
  font-family: inherit;
  background: rgba(227, 179, 65, 0.1);
  color: var(--accent);
  padding: 0.05em 0.4em;
  border-radius: 2px;
  font-size: 0.85em;
  overflow-wrap: anywhere;
}
.walkthrough__step p a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  transition: border-bottom-style 0.15s, background 0.15s;
}
.walkthrough__step p a:hover,
.walkthrough__step p a:focus-visible {
  border-bottom-style: solid;
  background: rgba(227, 179, 65, 0.06);
  outline: none;
}
.walkthrough__step p a::after {
  content: " \2197";  /* north-east arrow indicates external link */
  font-size: 0.75em;
  opacity: 0.7;
  margin-left: 0.05em;
}
.walkthrough__signature {
  color: var(--muted);
  font-style: italic;
  margin-top: 1.5rem;
  font-size: 0.8rem;
}

.walkthrough__data {
  display: grid;
  gap: 0.15rem;
  margin-top: 1rem;
  border: 1px dashed var(--border);
  border-left: 2px solid var(--accent);
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
}
.walkthrough__data > div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.75rem;
  padding: 0.25rem 0;
  font-size: 0.75rem;
}
.walkthrough__data dt {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.65rem;
  align-self: center;
}
.walkthrough__data dd { overflow-wrap: anywhere; color: var(--fg); }

/* ---------- trolley ---------- */
.trolley-track {
  position: relative;
  height: 50px;
  margin: 0 1rem;
  border-top: 2px solid var(--border);
  border-bottom: 2px dotted var(--border);
  background: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent 18px,
    rgba(227, 179, 65, 0.15) 18px,
    rgba(227, 179, 65, 0.15) 20px
  );
}
.trolley {
  --progress: 0;
  position: absolute;
  bottom: 4px;
  width: 70px;
  height: 38px;
  left: calc(var(--progress) * (100% - 70px));
  transition: left 0.6s cubic-bezier(0.5, 0, 0.1, 1);
}
.trolley__pole {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 1px;
  height: 12px;
  background: var(--muted);
  transform: translateX(-50%);
}
.trolley__pole::before {
  content: "";
  position: absolute;
  top: -3px; left: -2px;
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
}
.trolley__body {
  position: absolute;
  top: 0;
  width: 70px;
  height: 26px;
  background: #b9342b;
  border-radius: 4px 4px 1px 1px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 6px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}
.trolley__window {
  width: 10px;
  height: 12px;
  background: #f9d77c;
  border-radius: 1px;
}
.trolley__wheel {
  position: absolute;
  bottom: 0;
  width: 12px;
  height: 12px;
  background: #1a1a1a;
  border: 2px solid #595959;
  border-radius: 50%;
}
.trolley__wheel--front { left: 8px; }
.trolley__wheel--back  { right: 8px; }

.walkthrough__nav {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.5rem 1.5rem;
  gap: 1rem;
}
.walkthrough__nav button {
  appearance: none;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.walkthrough__nav button:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}
.walkthrough__nav button:disabled {
  color: rgba(125, 133, 144, 0.4);
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .walkthrough__step { padding: 1.25rem; min-height: 0; }
  .walkthrough__data > div { grid-template-columns: 1fr; gap: 0.15rem; }
  .walkthrough__data dt { font-size: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .walkthrough, .walkthrough__step, .trolley { animation: none; transition: none; }
}

.corner {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent);
}
.corner--tl { top: -1px; left: -1px; }
.corner--tr { top: -1px; right: -1px; }
.corner--bl { bottom: -1px; left: -1px; }
.corner--br { bottom: -1px; right: -1px; }

.head {
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.label {
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.1);  }
}

.hostname {
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;        /* break only when needed, prefer natural boundaries */
  word-break: normal;
  hyphens: none;
  line-height: 1.15;
}

.parent {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.parent a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}
.parent a:hover { border-bottom-style: solid; }

.spec dd.agent {
  font-size: 0.75rem;
  overflow-wrap: anywhere;
  opacity: 0.85;
}

.spec { display: grid; gap: 0.25rem; }

.spec > div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dotted var(--border);
}
.spec > div:last-child { border-bottom: 0; }

.spec dt {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  align-self: center;
}
.spec dd {
  color: var(--fg);
  font-size: 0.875rem;
  word-break: break-all;
}

.foot {
  border-top: 1px dashed var(--border);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}
.serial {
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
}

@media (max-width: 480px) {
  .spec > div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .plate { padding: 1.25rem; }
}

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