@font-face {
  font-family: "Bricolage Grotesque";
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
}
@font-face {
  font-family: "Martian Mono";
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
  src: url("/fonts/martian-mono.woff2") format("woff2");
}

:root {
  --bg: #0b0f17;        /* ink */
  --panel: #111723;     /* raised ink */
  --line: #212a3b;
  --line-strong: #344057;
  --text: #e6e8ee;
  --muted: #8a94a8;
  --amber: #ffb648;     /* things */
  --violet: #a9a2ff;    /* systems; also Curio's own accent */
  --ok: #7bd88f;

  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 8px 14px; background: var(--amber); color: var(--bg); text-decoration: none; }
.skip:focus { top: 12px; }

/* Small mono text used for everything that names part of the system. */
.top, .dir p, .term, .facts dt, .status, .used, .empty, .foot {
  font-family: var(--mono); font-stretch: 87.5%; font-size: 13px; line-height: 1.7;
}

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; justify-content: space-between; align-items: center; height: 52px; }
.top a { text-decoration: none; }
.top nav { display: flex; gap: 28px; color: var(--muted); }
.top nav a:hover { color: var(--text); }

/* Hero */
.hero {
  padding-block: clamp(48px, 9vw, 120px) clamp(56px, 8vw, 104px);
  background-image: radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 0);
  background-size: 28px 28px;
}
h1 {
  font: 800 clamp(64px, 15.5vw, 232px)/.84 var(--sans);
  letter-spacing: -.055em;
  margin-left: -.04em;
}
.amp { color: var(--amber); font-weight: 300; }

.hero-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: end; margin-top: clamp(40px, 6vw, 80px); }
.lede { font-size: clamp(20px, 2vw, 26px); line-height: 1.35; max-width: 22em; text-wrap: balance; }

/* Terminal */
.term { border: 1px solid var(--line-strong); background: var(--panel); }
.term-bar { display: flex; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.term-hint b { color: var(--amber); font-weight: 500; }
.term-out { padding: 14px 16px 0; max-height: 300px; overflow-y: auto; }
.term-out p { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-out .out { color: var(--muted); margin-bottom: 8px; }
.term-out .out a, .term-out .out b { color: var(--text); font-weight: 400; }
.term-out .err { color: var(--amber); }
.term-out [hidden] { display: none; }
.ps { color: var(--amber); }
.term-form { display: flex; gap: 1ch; padding: 0 16px 14px; }
.term-form[hidden] { display: none; }
.term:not(:has(.term-form:not([hidden]))) .term-out { padding-bottom: 6px; }
.term-form input {
  flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; caret-color: var(--amber);
}
.term:focus-within { border-color: var(--amber); }

/* Sections */
.section { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.dir { display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.dir h2 { font: 500 clamp(28px, 4vw, 44px)/1 var(--mono); font-stretch: 80%; letter-spacing: -.03em; }
.dir p { color: var(--muted); }
#things .dir h2 { color: var(--amber); }
#systems .dir h2 { color: var(--violet); }

/* A thing */
.thing { border: 1px solid var(--line-strong); background: var(--panel); border-left: 3px solid var(--amber); }
.thing-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: 32px; border-bottom: 1px solid var(--line); }
.thing-top img { width: 96px; height: 96px; border-radius: 22px; }
.thing h3 { font: 800 clamp(44px, 6vw, 72px)/.9 var(--sans); letter-spacing: -.04em; }
.thing-line { margin-top: 10px; font-size: 20px; line-height: 1.3; color: var(--muted); }
.status { color: var(--muted); padding-left: 20px; position: relative; }
.led { position: absolute; left: 0; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.thing-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.prose p { max-width: 34em; }
.prose p + p { margin-top: 1em; }
.thing .prose { padding: 32px; border-right: 1px solid var(--line); }
.credit { color: var(--muted); }

.facts > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 20px; align-items: baseline; padding: 16px 32px; }
.facts > div + div { border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { font-size: 16px; line-height: 1.5; }
.facts a, .used a { font-family: var(--mono); font-stretch: 87.5%; font-size: 13px; color: var(--violet); }
.used a[href="#curio"] { color: var(--amber); }

.empty { margin-top: 20px; padding: 20px 32px; border: 1px dashed var(--line-strong); color: var(--muted); }

/* Systems */
.systems { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-top: 3px solid var(--violet); background: var(--panel); }
.systems li { display: flex; flex-direction: column; gap: 14px; padding: 28px 32px 24px; }
.systems li + li { border-left: 1px solid var(--line); }
.systems h3 { font: 500 20px/1.2 var(--mono); font-stretch: 87.5%; letter-spacing: -.02em; }
.systems p { font-size: 16px; line-height: 1.5; }
.systems .used { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* A section jumped to from a link or the terminal is marked briefly. */
:is(.thing, .systems li):target { animation: mark 1.6s ease-out; }
@keyframes mark { from { background: color-mix(in srgb, var(--amber) 16%, var(--panel)); } }

.about { font-size: clamp(20px, 2vw, 24px); line-height: 1.45; }
.about p:last-child { color: var(--muted); }

.foot { border-top: 1px solid var(--line); color: var(--muted); }
.foot-row { display: flex; justify-content: space-between; padding-block: 24px; }

@media (max-width: 900px) {
  .hero-row, .thing-body { grid-template-columns: 1fr; }
  .hero-row { gap: 32px; }
  .thing-top { grid-template-columns: auto minmax(0, 1fr); }
  .status { grid-column: 1 / -1; }
  .thing .prose { border-right: 0; border-bottom: 1px solid var(--line); }
  .systems { grid-template-columns: 1fr; }
  .systems li + li { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap { width: calc(100% - 32px); }
  .top nav { gap: 16px; }
  .home { display: none; }
  .top-row { justify-content: flex-start; }
  .thing-top, .thing .prose { padding: 22px; }
  .thing-top { gap: 18px; }
  .thing-top img { width: 64px; height: 64px; border-radius: 15px; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; padding: 14px 22px; }
  .systems li { padding: 22px; }
  .empty { padding: 18px 22px; }
  .term-form input { font-size: 16px; } /* smaller text makes iOS zoom the page on focus */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  :is(.thing, .systems li):target { animation: none; }
}
