/* Autodev: one printed spec sheet. Three colours, hairline rules, two faces.
   Built to art/ref/specimen-sheet.jpg (see NOTE.md > Reference teardown). */

@font-face {
  font-family: "Eightgon";
  src: url("/fonts/Eightgon-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Proto";
  src: url("/fonts/0xProto-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --grey: #9f9f9f;
  --orange: #e05028;
  --ink: #000000;
  --rule: 3px;
  --radius: 26px;
  --pad: 32px;
  --pad-y: 28px;
  --gap: 24px;
  --display: clamp(28px, 5vw, 104px);
  --display-slim: clamp(22px, 2.3vw, 44px);
  --label: 20px;
  --body: 19px;
  --value: 22px;
  --big: clamp(44px, 4.4vw, 84px);
  font-synthesis: none;
}

@media (max-width: 1023px) {
  :root { --rule: 2px; --radius: 18px; --pad: 32px; --pad-y: 24px; --gap: 24px; --label: 19px; --body: 18px; --value: 20px; }
}

* { box-sizing: border-box; }

html { background: var(--grey); }

body {
  margin: 0;
  background: var(--grey);
  color: var(--ink);
  font-family: "Proto", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1920px;
  margin: 0 auto;
  padding: clamp(20px, 2.6vw, 48px) clamp(16px, 6.25vw, 120px) clamp(40px, 5vw, 96px);
}

a { color: inherit; }

/* ---------- the display plate ------------------------------------------- */

.plate {
  display: grid;
  gap: var(--rule);
  background: var(--ink);
  border: var(--rule) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}

.band {
  background: var(--orange);
  /* Eightgon's own ascent and descent overhang the 1.04 line box by about 0.05em on each side, so the
     band's vertical padding is sized off the display, never off the viewport */
  padding: calc(23px + 0.05 * var(--display)) clamp(32px, 1.8vw, 34px);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.band--slim { padding: calc(23px + 0.05 * var(--display-slim)) clamp(32px, 1.8vw, 34px); }

.word {
  font-family: "Eightgon", sans-serif;
  font-size: var(--display);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0;
}

.band--slim .word { font-size: var(--display-slim); }

/* the mark sits on the ticker's own baseline, not above it */
.word sup {
  font-size: max(16px, 0.26em);
  letter-spacing: 0.06em;
  vertical-align: baseline;
  margin-left: 0.14em;
}

.band__note {
  font-family: "Eightgon", sans-serif;
  font-size: clamp(16px, 1.05vw, 20px);
  letter-spacing: 0.09em;
  text-align: right;
  align-self: flex-end;
  padding-bottom: clamp(18px, 1.6vw, 30px);
  max-width: 34%;
}

/* ---------- the sheet ---------------------------------------------------- */

.sheet {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--rule);
  background: var(--ink);
  border: var(--rule) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: var(--gap);
}

.strip {
  margin: 0;
  grid-column: 1 / -1;
  background: var(--orange);
  padding: clamp(18px, 1.5vw, 28px) clamp(32px, 1.8vw, 34px);
  font-family: "Eightgon", sans-serif;
  font-size: clamp(17px, 1.75vw, 34px);
  letter-spacing: 0.055em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 0.85em;
  align-items: baseline;
}

.strip b { font-weight: 400; }
.strip .end { margin-left: auto; }
.strip .arrow { opacity: 0.75; }

.cell {
  background: var(--grey);
  padding: var(--pad-y) var(--pad);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cell--index { grid-column: span 4; padding: 0; gap: 0; display: block; background: var(--ink); }
.cell--mid { grid-column: span 5; }
.cell--narrow { grid-column: span 3; }
.cell--wide { grid-column: span 9; }
.cell--eight { grid-column: span 8; }
.cell--quarter { grid-column: span 3; }
.cell--full { grid-column: 1 / -1; }
.cell--half { grid-column: span 6; }

.label {
  font-family: "Eightgon", sans-serif;
  font-size: var(--label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}

.value {
  font-size: var(--value);
  margin: 0;
  overflow-wrap: anywhere;
}

.big {
  font-family: "Eightgon", sans-serif;
  font-size: var(--big);
  line-height: 1;
  margin: 0;
  padding: 0.08em 0 0.06em;
}

.muted { opacity: 0.72; }

/* a labelled row: the label left, the value on the right edge of the cell, as a spec sheet sets it */
.pair {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin: 0 calc(-1 * var(--pad));
  padding: 22px var(--pad);
  border-bottom: 2px solid rgba(0, 0, 0, 0.28);
}
.pair:last-child { border-bottom: 0; }
.pair .value, .pair .big { text-align: right; }
.pair .label { flex: 0 0 auto; }

.sheet p, .sheet ul, .sheet ol, .sheet h1, .sheet h2 { margin: 0; }
.plate p, .plate h1 { margin: 0; }

/* the index column: the sheets of the series, the open one inverted */

.index { display: flex; flex-direction: column; gap: var(--rule); height: 100%; background: var(--ink); }

.index a {
  background: var(--grey);
  text-decoration: none;
  font-family: "Eightgon", sans-serif;
  font-size: clamp(19px, 1.3vw, 25px);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: clamp(14px, 1.1vw, 20px) var(--pad);
  display: flex;
  align-items: center;
  gap: 0.8em;
  flex: 1 1 0;
  min-height: 60px;
}

.index a[aria-current="page"] { background: var(--ink); color: var(--orange); }
.index a:hover { background: var(--orange); }
.index a[aria-current="page"]:hover { background: var(--ink); }
.index a:focus-visible { outline: var(--rule) solid var(--ink); outline-offset: calc(-2 * var(--rule)); }
.index a[aria-current="page"]:focus-visible { outline-color: var(--orange); }
.index .n { opacity: 0.55; }

/* the empty slot: the reference draws a diagonal across a cell that holds nothing */

.slot {
  background-image: url("/img/slot.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  flex: 1 1 auto;
  min-height: 140px;
}

/* ---------- rows, tables, lists ----------------------------------------- */

.rows { display: flex; flex-direction: column; gap: var(--rule); background: var(--ink); margin: 0; padding: 0; list-style: none; }
.rows > li { background: var(--grey); padding: var(--pad-y) var(--pad); display: grid; gap: 10px 24px; }

.log > li { grid-template-columns: 150px 1fr auto; align-items: start; }
.log .time { font-family: "Eightgon", sans-serif; letter-spacing: 0.06em; font-size: var(--label); }
.log .what { min-width: 0; }
.log .verdict {
  font-family: "Eightgon", sans-serif;
  letter-spacing: 0.08em;
  font-size: var(--label);
  text-transform: uppercase;
  white-space: nowrap;
}
.log .verdict--launch { background: var(--ink); color: var(--orange); padding: 10px 20px; }

/* the rule belongs to the row, never to the cell: a narrow value column cannot carry the padding,
   and the row runs the full width of the cell while its text keeps the cell's own inset */
.tbl { width: calc(100% + 2 * var(--pad)); margin: 0 calc(-1 * var(--pad)); border-collapse: collapse; font-size: var(--value); }
.tbl th, .tbl td { padding: 16px 20px; text-align: left; }
.tbl th:first-child, .tbl td:first-child { padding-left: var(--pad); }
.tbl th:last-child, .tbl td:last-child { padding-right: var(--pad); }
.tbl th {
  font-family: "Eightgon", sans-serif;
  font-size: var(--label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
  border-bottom: var(--rule) solid var(--ink);
}
.tbl tbody tr { border-bottom: 2px solid rgba(0, 0, 0, 0.28); }
.tbl tbody tr:last-child { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- keys (buttons and links) ------------------------------------- */

.keys { display: flex; flex-wrap: wrap; gap: 12px; }

.key {
  font-family: "Eightgon", sans-serif;
  font-size: var(--label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--orange);
  border: var(--rule) solid var(--ink);
  border-radius: 10px;
  min-height: 60px;
  padding: 14px 1.3em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  text-decoration: none;
  cursor: pointer;
  font-family: "Eightgon", sans-serif;
}

.key img { height: 21px; width: auto; display: block; filter: invert(1); }
.key:hover { background: var(--orange); color: var(--ink); }
.key:hover img { filter: none; }
.key:active { transform: translateY(2px); }
.key:focus-visible { outline: var(--rule) solid var(--ink); outline-offset: 4px; }

.key[aria-disabled="true"], .key:disabled {
  background: transparent;
  color: var(--ink);
  opacity: 0.8;
  cursor: not-allowed;
  border-style: dashed;
}
.key[aria-disabled="true"]:hover, .key:disabled:hover { background: transparent; color: var(--ink); }
.key[aria-disabled="true"] img, .key:disabled img { filter: none; opacity: 0.8; }

.key--wide { width: 100%; }

/* ---------- forms --------------------------------------------------------- */

input[type="text"], textarea {
  font-family: "Proto", monospace;
  font-size: var(--value);
  background: var(--grey);
  color: var(--ink);
  border: var(--rule) solid var(--ink);
  border-radius: 10px;
  padding: 14px 18px;
  width: 100%;
  min-height: 56px;
}
textarea { min-height: 128px; resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(0, 0, 0, 0.5); }
input:focus-visible, textarea:focus-visible { outline: var(--rule) solid var(--ink); outline-offset: 3px; }

/* ---------- small print ---------------------------------------------------- */

.note { font-size: var(--body); margin: 0; }
.note + .note { margin-top: 12px; }

.ca {
  font-size: var(--value);
  overflow-wrap: anywhere;
  letter-spacing: 0.01em;
  margin: 0;
}

.live { font-variant-numeric: tabular-nums; }

/* ---------- phone --------------------------------------------------------- */

@media (max-width: 860px) {
  .sheet { grid-template-columns: repeat(6, 1fr); }
  /* a seven column scorecard cannot be a table on a phone: every row becomes its own labelled block */
  .tbl thead { display: none; }
  .tbl tbody tr { display: block; padding: 10px 0; }
  .tbl td { display: flex; justify-content: space-between; gap: 16px; padding: 7px var(--pad); text-align: left; }
  .tbl td::before { content: attr(data-label); font-family: "Eightgon", sans-serif; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
  .tbl td:first-child, .tbl td:last-child { padding-left: var(--pad); padding-right: var(--pad); }
  .tbl .num { text-align: right; }
  .pair { flex-direction: column; align-items: flex-start; gap: 6px; }
  .pair .value, .pair .big { text-align: left; }
  .cell--index, .cell--mid, .cell--narrow, .cell--wide, .cell--half, .cell--eight, .cell--quarter { grid-column: 1 / -1; }
  .index { display: grid; grid-template-columns: 1fr 1fr; }
  .index a { min-height: 64px; }
  .strip { flex-direction: column; gap: 10px; }
  .strip .end { margin-left: 0; }
  .strip .arrow { display: none; }
  .log > li { grid-template-columns: 1fr; }
  .log .verdict { justify-self: start; }
  .band { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
  .band__note { text-align: left; max-width: 100%; align-self: flex-start; padding-bottom: 0; }
}

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

/* a 320 phone cannot carry two index cells: "02 Launches" is clipped, so the index goes to one column */
@media (max-width: 479px) {
  .index { grid-template-columns: 1fr; }
}
