/* infr.ad — amber phosphor.
   One committed look: warm black ground, parchment body, amber for anything
   that carries a number or a decision. Monospace throughout, because the
   product lives in a terminal. */

:root {
  --bg:        #0B0A07;
  --raised:    #131009;
  --raised-2:  #1A160D;
  --line:      #2A2318;
  --line-soft: #1E1911;

  --fg:        #E9DFC6;   /* parchment: body copy, easier than amber at length */
  --dim:       #9A8A64;   /* secondary */
  --faint:     #6B6047;   /* captions, table headers */

  --amber:     #FFC145;   /* headlines, figures, links */
  --amber-dim: #C9922A;
  --amber-glow: rgba(255, 193, 69, .10);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
          Consolas, "Liberation Mono", monospace;

  --measure: 62ch;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-variant-ligatures: none;
}

/* ---------- shell ---------- */

.wrap { max-width: 54rem; margin: 0 auto; padding: 0 1.5rem; }

.topbar {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(11, 10, 7, .92);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 3.5rem;
}

.brand {
  color: var(--amber);
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
  font-size: 1rem;
}

.brand::before { content: "▚ "; color: var(--amber-dim); }

.nav { display: flex; gap: 1.5rem; font-size: .82rem; }
.nav a { color: var(--dim); text-decoration: none; }
.nav a:hover, .nav a:focus-visible { color: var(--amber); }

main { padding: 0 0 5rem; }

/* clearance from the sticky bar lives on the opening section rather than on
   main, so it cannot be eaten by margin collapsing */
main > section:first-child { padding-top: 2.25rem; }

section { margin-bottom: 4rem; }

/* ---------- type ---------- */

h1 {
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.035em;
  color: var(--amber);
  margin: 0 0 1rem;
  text-wrap: balance;
}

h2 {
  font-size: .74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--faint);
  margin: 0 0 1.25rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
}

h3 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--amber);
  margin: 2rem 0 .6rem;
  letter-spacing: -.01em;
}

h3:first-child { margin-top: 0; }

p { margin: 0 0 1rem; max-width: var(--measure); text-wrap: pretty; }

.lead {
  font-size: 1.05rem;
  color: var(--fg);
  max-width: 58ch;
}

.dim { color: var(--dim); }

small, .small { font-size: .82rem; }

a { color: var(--amber); text-decoration: none; border-bottom: 1px solid var(--amber-dim); }
a:hover { background: var(--amber-glow); }
a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 2px; }

ul { margin: 0 0 1rem; padding-left: 0; list-style: none; max-width: var(--measure); }
ul li { position: relative; padding-left: 1.4rem; margin: .4rem 0; }
ul li::before { content: "·"; position: absolute; left: .35rem; color: var(--amber-dim); }

code {
  font-family: var(--mono);
  font-size: .88em;
  color: var(--amber);
  background: var(--raised-2);
  padding: .1em .38em;
  border-radius: 2px;
}

pre {
  margin: 0 0 1.25rem;
  padding: 1.1rem 1.15rem;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow-x: auto;
  font-size: .82rem;
  line-height: 1.65;
  color: var(--fg);
}

pre code { background: none; padding: 0; color: inherit; font-size: 1em; }

/* ---------- the specimen: the one place that glows ---------- */

.specimen {
  background: var(--raised);
  border: 1px solid var(--line);
  border-left: 2px solid var(--amber-dim);
  border-radius: 4px;
  padding: 1.35rem 1.4rem;
  overflow-x: auto;
  font-size: .8rem;
  line-height: 1.55;
  white-space: pre;
  color: var(--dim);
  box-shadow: 0 0 40px -12px var(--amber-glow);
  margin-bottom: 1rem;
}

.specimen .box { color: var(--amber); }

/* ---------- centred layout ----------
   Headings, leads and captions centre. Anything the eye has to track along a
   line — code, ascii, table cells — stays left aligned inside its own block,
   because centred body copy has a ragged left edge and reads badly. */

.center { text-align: center; }
.center p, .center .lead { margin-left: auto; margin-right: auto; }
.center h2 { border-bottom: none; padding-bottom: 0; margin-bottom: .5rem; }
.center h2 + p { margin-bottom: 2rem; }
.center .actions { justify-content: center; }

.rule {
  width: 3rem;
  height: 1px;
  background: var(--amber-dim);
  margin: 0 auto 2rem;
  opacity: .5;
}

.center pre,
.center .specimen,
.center .tablewrap { text-align: left; }

.center .specimen {
  display: inline-block;
  text-align: left;
  min-width: min(100%, 34rem);
}

.center pre { display: block; }

/* ---------- copy buttons ---------- */

.codewrap { position: relative; }

.copy {
  position: absolute;
  top: .5rem;
  right: .5rem;
  font: inherit;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .6rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  color: var(--faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease, border-color .12s ease;
}

.codewrap:hover .copy,
.copy:focus-visible { opacity: 1; }

.copy:hover { color: var(--amber); border-color: var(--amber-dim); }
.copy.done { opacity: 1; color: var(--amber); border-color: var(--amber-dim); }
.copy:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* no hover to reveal it on touch, so keep it visible there */
@media (hover: none) {
  .copy { opacity: 1; }
}

/* ---------- tabs ----------
   One bounded surface with a chrome strip, rather than loose buttons floating
   above loose text. The active tab is joined to the body it opens. */

.tabbox {
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: var(--raised);
  text-align: left;
}

.tablist {
  display: flex;
  background: var(--raised-2);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tablist::-webkit-scrollbar { display: none; }

.tab {
  font: inherit;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .01em;
  padding: .75rem 1.15rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s ease, background .12s ease;
}

.tab:hover { color: var(--fg); }

.tab[aria-selected="true"] {
  color: var(--amber);
  background: var(--raised);
  border-bottom-color: var(--amber);
}

.tab:focus-visible { outline: 2px solid var(--amber); outline-offset: -3px; }

.panel { padding: 1.35rem 1.4rem 1.15rem; }
.panel[hidden] { display: none; }

/* nested one level down, so it reads as inside the panel rather than beside it */
.panel pre {
  background: var(--bg);
  margin-bottom: .85rem;
}

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

.panel .step {
  font-size: .84rem;
  color: var(--dim);
  margin: 0 0 .75rem;
  max-width: none;
}

.panel .step b { color: var(--fg); font-weight: 600; }

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  text-align: left;
}

.card { background: var(--bg); padding: 1.35rem 1.25rem; }

.card h4 {
  margin: 0 0 .5rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: .02em;
}

.card h4 code { background: none; padding: 0; font-size: 1em; }

.card p {
  margin: 0;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--dim);
  max-width: none;
}

.card .meta {
  display: block;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--faint);
  margin-bottom: .55rem;
}

/* ---------- sponsorship ladder ----------
   An ordered list because the order is the offer: each slot costs more than the
   one before it, so the numbering carries the mechanic rather than decorating. */

.slots {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  text-align: left;
}

.slot {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: .95rem 1.2rem;
  border-bottom: 1px solid var(--line-soft);
}

.slot:last-child { border-bottom: none; }

.slot .no {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--faint);
}

.slot .what { font-size: .85rem; color: var(--dim); }

.slot .price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.slot.next {
  background: var(--raised);
  border-left: 2px solid var(--amber);
  padding-left: calc(1.2rem - 2px);
}

.slot.next .no { color: var(--amber); }
.slot.next .what { color: var(--fg); }
.slot.next .price { color: var(--amber); }

/* ---------- figures ---------- */

.figures {
  display: grid;
  /* fixed three across: both pages carry a multiple of three figures, and
     auto-fit leaves an orphan cell whenever the count does not divide evenly */
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.figure { background: var(--bg); padding: 1.15rem 1.1rem; text-align: center; }

.figure .n {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.figure .k {
  min-height: 2.1em;   /* two-line labels must not make one cell taller */
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--faint);
  margin-top: .35rem;
}

.figures.loading .n { color: var(--faint); }

/* ---------- tables ---------- */

.tablewrap { overflow-x: auto; margin-bottom: 1.25rem; }

table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: .85rem; }

th, td {
  text-align: left;
  padding: .6rem 1rem .6rem 0;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

th {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--faint);
  font-weight: 600;
  border-bottom-color: var(--line);
}

td.model { color: var(--amber); white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: .88rem;
  padding: .7rem 1.4rem;
  border: 1px solid var(--amber);
  border-radius: 3px;
  background: transparent;
  color: var(--amber);
  cursor: pointer;
  text-decoration: none;
  transition: background .12s ease;
}

.btn:hover { background: var(--amber); color: var(--bg); }
.btn.solid { background: var(--amber); color: var(--bg); }
.btn.solid:hover { background: var(--amber-dim); border-color: var(--amber-dim); }

.actions { display: flex; gap: .85rem; flex-wrap: wrap; align-items: center; margin: 1.75rem 0 0; }

/* ---------- notes ---------- */

.note {
  border-left: 2px solid var(--line);
  padding: .1rem 0 .1rem 1.1rem;
  color: var(--dim);
  max-width: var(--measure);
}

.note strong { color: var(--fg); font-weight: 600; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 3rem;
  color: var(--faint);
  font-size: .78rem;
}

footer .wrap { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
footer a { color: var(--dim); border-bottom-color: var(--line); }

@media (max-width: 40rem) {
  body { font-size: 14px; }
  .figures { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .nav { gap: 1rem; font-size: .76rem; }
  main { padding: 0 0 3.5rem; }
  main > section:first-child { padding-top: 1.25rem; }
  section { margin-bottom: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
