/*
 * Hypehammer, the game.
 * Same identity as the landing page: an encyclopedia page turned into a quote board.
 * Navy ink on cool paper, link blue for articles, and one signal colour, the yellow mark
 * the hammer leaves under a price.
 */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --paper: #f2f4fa;
  --paper-raised: #ffffff;
  --paper-sunken: #e6e9f3;
  --ink: #1a2340;
  --ink-soft: #4b5576;
  --ink-faint: #6b7493;
  --rule: #cbd1e1;
  --grid: #dfe3ee;
  --link: #2e59d1;
  --strike: #ffd43b;
  --strike-hover: #f5c400;
  --on-strike: #1a2340;
  --up: #0b7a51;
  --down: #c63a31;
  --up-wash: #e2f3ec;
  --down-wash: #fdf0ee;
  --me-wash: #fff6d4;
  --danger-text: #ffffff;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 34rem;
  --radius: 6px;
  --tabbar: 4.25rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121830;
    --paper-raised: #1a2242;
    --paper-sunken: #0d1226;
    --ink: #e9edf8;
    --ink-soft: #a6aecb;
    --ink-faint: #8a93b3;
    --rule: #2f3a5c;
    --grid: #263052;
    --link: #93adff;
    --up: #43c98f;
    --down: #ff8177;
    --up-wash: #143329;
    --down-wash: #3a1d22;
    --me-wash: #313441;
    --danger-text: #1a0f12;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-stretch: 112%;
  font-weight: 760;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0;
}

h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem);
}

h2 {
  font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.65rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--strike);
  color: var(--on-strike);
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.is-up {
  color: var(--up);
}

.is-down {
  color: var(--down);
}

.is-flat {
  color: var(--ink-soft);
}

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

.small {
  font-size: 0.9rem;
}

/* Top bar ------------------------------------------------------------------ */

.topbar {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.topbar-inner {
  max-width: 74rem;
  margin-inline: auto;
  padding: 0.75rem var(--gutter);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wordmark {
  color: var(--ink);
  font-size: 1.3rem;
  font-stretch: 125%;
  font-weight: 820;
  letter-spacing: -0.02em;
  text-decoration: none;
  box-shadow: inset 0 -0.36em 0 var(--strike);
  padding-inline: 0.06em;
  flex: none;
}

.wordmark:hover {
  text-decoration: none;
}

.mainnav {
  display: none;
  gap: 0.25rem;
  margin-left: 1rem;
}

.mainnav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 620;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
}

.mainnav a:hover {
  color: var(--ink);
  background: var(--paper-sunken);
}

.mainnav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--ink);
  border-radius: 0;
}

.topbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

/* League switcher: a <details> menu, works without JavaScript. */
.switcher {
  position: relative;
  min-width: 0;
}

.switcher > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 14rem;
  min-height: 2.5rem;
  padding: 0.3rem 0.7rem;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink);
  font-weight: 650;
  font-size: 0.92rem;
  cursor: pointer;
}

.switcher > summary::-webkit-details-marker {
  display: none;
}

.switcher > summary::after {
  content: "";
  flex: none;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.12rem) rotate(45deg);
  margin-left: 0.15rem;
}

.switcher-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switcher-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 10;
  width: min(19rem, calc(100vw - 2rem));
  padding: 0.4rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--ink);
  border-radius: 2px 2px 10px 10px;
  box-shadow: 0 12px 30px rgb(10 16 40 / 0.18);
}

.switcher-menu form {
  margin: 0;
}

.switcher-menu button,
.switcher-menu a {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 560;
  text-align: left;
  text-decoration: none;
}

.switcher-menu button:hover,
.switcher-menu a:hover {
  background: var(--paper-sunken);
}

.switcher-menu [aria-current="true"] {
  font-weight: 760;
}

.switcher-menu [aria-current="true"]::after {
  content: "✓";
}

.switcher-menu hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0.35rem 0;
}

.profile-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 760;
  text-decoration: none;
  text-transform: uppercase;
}

.profile-link:hover {
  text-decoration: none;
  background: var(--link);
}

/* Session strip: when the next order is executed. */
.sessionbar {
  display: block;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.88rem;
}

.sessionbar-inner {
  max-width: 74rem;
  margin-inline: auto;
  padding: 0.45rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.9rem;
  align-items: baseline;
}

.sessionbar strong {
  font-weight: 700;
}

.sessionbar .hammer-dot {
  display: inline-block;
  width: 0.8rem;
  height: 0.5rem;
  margin-right: 0.4rem;
  border-radius: 2px;
  background: var(--strike);
}

@media (prefers-color-scheme: dark) {
  .sessionbar {
    background: var(--paper-raised);
    color: var(--ink);
    border-bottom: 1px solid var(--rule);
  }
}

/* Bottom tab bar on phones. */
.tabbar {
  position: fixed;
  inset: auto 0 0;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--paper-raised);
  border-top: 2px solid var(--ink);
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 650;
  text-decoration: none;
}

.tabbar svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar a[aria-current="page"] {
  color: var(--ink);
}

.tabbar a[aria-current="page"] svg {
  stroke-width: 2.4;
}

.tabbar a[aria-current="page"] span {
  box-shadow: inset 0 -0.4em 0 var(--strike);
}

@media (prefers-color-scheme: dark) {
  .tabbar a[aria-current="page"] span {
    box-shadow: inset 0 -0.18em 0 var(--strike);
  }
}

body.has-tabbar {
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}

@media (min-width: 52rem) {
  .mainnav {
    display: flex;
  }

  .tabbar {
    display: none;
  }

  body.has-tabbar {
    padding-bottom: 0;
  }
}

/* Page frame --------------------------------------------------------------- */

main {
  flex: 1;
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) var(--gutter) 3rem;
}

.narrow {
  max-width: 40rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.75rem;
}

.kicker {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lead {
  margin-top: 0.75rem;
  max-width: var(--measure);
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

@media (min-width: 60rem) {
  .grid-2 {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
  }

  .grid-2-even {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.stack > * + * {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

/* A board: raised paper with the ink rule on top, like the landing page. */
.board {
  background: var(--paper-raised);
  border-top: 5px solid var(--ink);
  border-radius: 2px 2px 14px 14px;
  padding: 1rem clamp(1rem, 3vw, 1.5rem) 1.1rem;
  min-width: 0;
}

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-bottom: 0.6rem;
}

.board-head h2 {
  font-size: 1.2rem;
}

.board-note {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.board-foot {
  margin-top: 0.75rem;
  font-size: 0.92rem;
}

.section-title {
  margin-bottom: 0.9rem;
}

/* Hero figure: the value of the portfolio, with the hammer's mark. */
.figure-block {
  display: grid;
  gap: 0.35rem;
}

.figure-label {
  color: var(--ink-soft);
  font-weight: 620;
}

.hero-figure {
  justify-self: start;
  position: relative;
  font-size: clamp(2.8rem, 2rem + 4vw, 4.4rem);
  font-stretch: 112%;
  font-weight: 760;
  letter-spacing: -0.02em;
  line-height: 1;
  padding-inline: 0.08em;
  white-space: nowrap;
}

.hero-figure::before,
.price-mark::before {
  content: "";
  position: absolute;
  inset: auto 0 0.05em;
  height: 0.42em;
  background: var(--strike);
  z-index: -1;
}

.hero-figure,
.price-mark {
  isolation: isolate;
}

.hero-unit {
  font-size: 0.4em;
  font-weight: 650;
  margin-left: 0.2em;
  letter-spacing: 0;
}

.figure-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  color: var(--ink-soft);
}

.figure-meta strong {
  color: var(--ink);
}

.change-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.change-pill.is-up {
  background: var(--up-wash);
}

.change-pill.is-down {
  background: var(--down-wash);
}

.change-pill.is-flat {
  background: var(--paper-sunken);
}

@media (prefers-reduced-motion: no-preference) {
  .strike-in::before {
    animation: strike 560ms cubic-bezier(0.2, 0.9, 0.3, 1.3) 200ms both;
  }

  .strike-in > .figure {
    animation: land 560ms steps(1, end) 200ms both;
  }
}

@keyframes strike {
  0% {
    opacity: 0;
    transform: translateY(-1.4em) rotate(-9deg) scaleX(0.7);
  }
  55% {
    opacity: 1;
    transform: translateY(0.05em) rotate(0) scaleX(1.06);
  }
  78% {
    transform: translateY(-0.03em) scaleX(0.98);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes land {
  0% { opacity: 0; }
  55% { opacity: 1; }
  100% { opacity: 1; }
}

/* Stats: small labelled figures. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1rem 1.5rem;
  margin: 0;
}

.stats > div {
  border-top: 1px solid var(--rule);
  padding-top: 0.6rem;
}

.stats dt {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.stats dd {
  margin: 0.15rem 0 0;
  font-size: 1.25rem;
  font-weight: 720;
  font-stretch: 108%;
}

.stats dd small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 500;
}

/* Quote rows ---------------------------------------------------------------- */

.quotes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.quote {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px 5.2rem 4.8rem;
  grid-template-areas:
    "title spark price change"
    "sector spark price change";
  column-gap: 0.9rem;
  align-items: center;
  padding-block: 0.7rem;
  border-top: 1px solid var(--rule);
}

.quote-title {
  grid-area: title;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* The whole row is the link. */
.quote-title::after {
  content: "";
  position: absolute;
  inset: 0;
}

.quote:hover .quote-title {
  color: var(--link);
  text-decoration: underline;
}

.quote-sector {
  grid-area: sector;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.quote-spark {
  grid-area: spark;
  width: 84px;
  height: 26px;
}

.spark-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.spark-ref {
  stroke: var(--ink-soft);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  opacity: 0.6;
  vector-effect: non-scaling-stroke;
}

.quote-price {
  grid-area: price;
  justify-self: end;
  position: relative;
  isolation: isolate;
  color: var(--ink);
  font-size: 1.3rem;
  font-stretch: 112%;
  font-weight: 720;
  line-height: 1;
  padding-inline: 0.12em;
  font-variant-numeric: tabular-nums;
}

.quote-price::before {
  content: "";
  position: absolute;
  inset: auto 0 0.04em;
  height: 0.46em;
  background: var(--strike);
  z-index: -1;
}

.quote-change {
  grid-area: change;
  justify-self: end;
  font-size: 0.92rem;
  font-weight: 650;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.quote-empty {
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}

@media (max-width: 30rem) {
  .quote {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title price"
      "sector change";
    row-gap: 0.25rem;
  }

  .quote-spark {
    display: none;
  }
}

/* Tables ---------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  margin-inline: calc(-1 * clamp(1rem, 3vw, 1.5rem));
  padding-inline: clamp(1rem, 3vw, 1.5rem);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.6rem 0.5rem;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: middle;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

thead th {
  border-top: 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.t-num {
  text-align: right;
  white-space: nowrap;
}

.t-title {
  font-family: var(--serif);
  font-size: 1.08rem;
}

.t-title a {
  color: var(--ink);
  text-decoration: none;
}

.t-title a:hover {
  color: var(--link);
  text-decoration: underline;
}

.rank {
  width: 2.5rem;
  font-weight: 760;
  font-stretch: 112%;
}

tr.is-me td {
  background: var(--me-wash);
}

tr.is-me td:first-child {
  box-shadow: inset 4px 0 0 var(--strike);
  padding-left: 0.6rem;
}

.podium-1 .rank::before {
  content: "";
  display: inline-block;
  width: 0.7rem;
  height: 0.45rem;
  margin-right: 0.3rem;
  border-radius: 2px;
  background: var(--strike);
}

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

form {
  margin: 0;
}

.field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.field label,
.label {
  font-weight: 650;
}

.hint {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

input[type="email"],
input[type="text"],
input[type="search"],
input[type="number"] {
  width: 100%;
  min-height: 3rem;
  padding: 0 0.85rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

input[aria-invalid="true"] {
  border-color: var(--down);
}

.input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.input-row > input {
  flex: 1 1 12rem;
  width: auto;
}

.input-suffix {
  position: relative;
  flex: 1 1 12rem;
}

.input-suffix input {
  padding-right: 4.5rem;
}

.input-suffix span {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  font-size: 0.9rem;
  pointer-events: none;
}

.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.check input {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  margin: 0.15rem 0 0;
  accent-color: var(--ink);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 3rem;
  padding: 0 1.25rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--strike);
  color: var(--on-strike);
  font: inherit;
  font-stretch: 110%;
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--strike-hover);
  text-decoration: none;
}

.button-secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.button-secondary:hover {
  background: var(--paper-sunken);
}

.button-quiet {
  min-height: 2.4rem;
  padding: 0 0.75rem;
  background: transparent;
  color: var(--link);
  font-weight: 650;
}

.button-quiet:hover {
  background: var(--paper-sunken);
}

.button-danger {
  background: var(--down);
  color: var(--danger-text);
}

.button-danger:hover {
  background: color-mix(in srgb, var(--down) 85%, #000);
}

.button-sell {
  background: var(--ink);
  color: var(--paper);
}

.button-sell:hover {
  background: color-mix(in srgb, var(--ink) 85%, var(--link));
}

.button-small {
  min-height: 2.3rem;
  padding: 0 0.8rem;
  font-size: 0.92rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.presets button {
  min-height: 2.2rem;
  padding: 0 0.7rem;
  background: var(--paper-sunken);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
}

.presets button:hover {
  background: var(--rule);
}

.estimate {
  min-height: 1.5em;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* Chips: sector filters. */
.chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin-bottom: 1.25rem;
  scrollbar-width: thin;
}

.chips a {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.3rem;
  padding: 0 0.85rem;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  background: var(--paper-raised);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 620;
  text-decoration: none;
  white-space: nowrap;
}

.chips a:hover {
  border-color: var(--ink);
}

.chips a[aria-current="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* Messages ------------------------------------------------------------------------- */

.flash {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  background: var(--paper-raised);
  border-left: 5px solid var(--ink);
}

.flash.is-ok {
  border-left-color: var(--up);
}

.flash.is-error {
  border-left-color: var(--down);
}

.flash.is-warning {
  border-left-color: var(--strike);
}

.callout {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--paper-sunken);
  font-size: 0.95rem;
}

.callout.is-warning {
  background: color-mix(in srgb, var(--strike) 26%, var(--paper-raised));
  color: var(--ink);
}

.callout strong {
  font-weight: 720;
}

.error-text {
  color: var(--down);
  font-weight: 620;
}

/* Value page ------------------------------------------------------------------------ */

.article-title {
  font-family: var(--serif);
  font-weight: 560;
  font-stretch: normal;
  letter-spacing: -0.01em;
  font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-top: 0.6rem;
  color: var(--ink-soft);
}

.price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-top: 1.25rem;
}

.price-mark {
  position: relative;
  font-size: clamp(2.6rem, 2rem + 3vw, 3.8rem);
  font-stretch: 112%;
  font-weight: 760;
  letter-spacing: -0.02em;
  line-height: 1;
  padding-inline: 0.08em;
}

.ratio-note {
  color: var(--ink-soft);
}

.ratio-note strong {
  color: var(--ink);
}

.order-panels {
  display: grid;
  gap: 1.25rem;
}

.order-panel h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
}

.order-panel + .order-panel {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
}

/* Charts ----------------------------------------------------------------------------- */

.chart {
  position: relative;
  margin: 0;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: var(--grid);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.chart-ref {
  stroke: var(--ink-soft);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.chart-axis {
  fill: var(--ink-faint);
  font-size: 12.5px;
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
}

.chart-ref-label,
.chart-end-label {
  paint-order: stroke;
  stroke: var(--paper-raised);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.chart-ref-label {
  fill: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
}

.chart-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-area {
  fill: var(--ink);
  opacity: 0.07;
}

.chart-bar {
  fill: var(--ink-soft);
  opacity: 0.35;
}

.chart-end {
  fill: var(--ink);
  stroke: var(--paper-raised);
  stroke-width: 2;
}

.chart-end-label {
  fill: var(--ink);
  font-size: 13.5px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.chart-cross {
  stroke: var(--ink-soft);
  stroke-width: 1;
}

.chart-dot {
  fill: var(--ink);
  stroke: var(--paper-raised);
  stroke-width: 2;
}

.chart-tip {
  position: absolute;
  top: 0;
  z-index: 2;
  min-width: 8.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.85rem;
  line-height: 1.35;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart-tip strong {
  display: block;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.key-line,
.key-ref,
.key-bar {
  display: inline-block;
  width: 1.4rem;
  margin-right: 0.4rem;
  vertical-align: middle;
}

.key-line {
  border-top: 2px solid var(--ink);
}

.key-ref {
  border-top: 1px dashed var(--ink-soft);
}

.key-bar {
  height: 0.6rem;
  background: var(--ink-soft);
  opacity: 0.35;
  width: 0.6rem;
}

.data-table {
  margin-top: 0.75rem;
  font-size: 0.92rem;
}

.data-table summary {
  color: var(--link);
  cursor: pointer;
  font-weight: 600;
}

.data-table table {
  margin-top: 0.5rem;
}

.data-table-scroll {
  max-height: 18rem;
  overflow-y: auto;
}

/* Invite --------------------------------------------------------------------------------- */

.invite {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.invite input {
  flex: 1 1 14rem;
  font-size: 0.95rem;
  background: var(--paper-sunken);
  border-color: var(--rule);
}

/* Empty states and welcome ------------------------------------------------------------- */

.empty {
  padding: 1.5rem 0 0.5rem;
  color: var(--ink-soft);
}

.empty strong {
  display: block;
  color: var(--ink);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.steps {
  counter-reset: step;
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

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

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.05rem;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--strike);
  color: var(--on-strike);
  font-weight: 800;
  font-size: 0.95rem;
}

.steps strong {
  display: block;
}

/* Sign-in -------------------------------------------------------------------------------- */

.auth {
  max-width: 30rem;
  margin: clamp(1rem, 6vw, 4rem) auto 0;
}

.auth h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem);
}

.auth .lead {
  margin-bottom: 1.75rem;
}

.auth-board {
  margin-top: 2rem;
}

/* Rules and legal pages -------------------------------------------------------------------- */

.prose {
  max-width: 44rem;
}

.prose h2 {
  margin-top: 2.25rem;
  font-size: 1.4rem;
}

.prose p,
.prose ul,
.prose ol {
  margin-top: 0.8rem;
}

.prose ul,
.prose ol {
  padding-left: 1.3rem;
}

.prose li + li {
  margin-top: 0.45rem;
}

.formula {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 5px solid var(--strike);
  background: var(--paper-raised);
  font-family: var(--serif);
  font-size: 1.2rem;
}

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

.site-footer {
  max-width: 74rem;
  width: 100%;
  margin-inline: auto;
  padding: 1.5rem var(--gutter) 2rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-top: 0.5rem;
}

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

/* Dark theme: light figures cannot sit on the yellow, so the mark moves under the baseline. */
@media (prefers-color-scheme: dark) {
  .wordmark {
    box-shadow: inset 0 -0.2em 0 var(--strike);
    padding-bottom: 0.24em;
  }

  .quote-price::before,
  .hero-figure::before,
  .price-mark::before {
    inset: auto 0 -0.24em;
    height: 0.18em;
  }

  .chart-end {
    stroke: var(--paper-raised);
  }
}

@media (forced-colors: active) {
  .quote-price::before,
  .hero-figure::before,
  .price-mark::before {
    background: Highlight;
  }
}

@media print {
  .topbar,
  .sessionbar,
  .tabbar,
  .site-footer {
    display: none;
  }
}

/* Order lists ---------------------------------------------------------------------------- */

.order-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.order-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-block: 0.55rem;
  border-top: 1px solid var(--rule);
}

.order-page {
  font-family: var(--serif);
  font-size: 1.08rem;
  color: var(--ink);
}

.order-detail {
  display: block;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.chart-subtitle {
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.board-foot h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.check .hint {
  display: block;
  font-weight: 400;
}

.check > span {
  font-weight: 620;
}

/* A jump in the ranking (top of the table, then the player's neighbourhood). */
tr.is-gap td {
  border-top: 4px double var(--rule);
}


h1.figure-label {
  font-size: 1.0625rem;
  font-stretch: 100%;
  font-weight: 620;
  letter-spacing: 0;
  line-height: 1.5;
}

.table-wrap:focus-visible {
  outline-offset: -3px;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* On phones, wide tables become stacked rows: the title on its own line, figures below. */
@media (max-width: 40rem) {
  .table-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .table-stack,
  .table-stack tbody {
    display: block;
  }

  .table-stack tr {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(5.6rem, 1fr));
    gap: 0.45rem 0.75rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--rule);
  }

  .table-stack td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .table-stack td.t-wide {
    grid-column: 1 / -1;
    order: -1;
  }

  .table-stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .table-stack .t-num {
    text-align: left;
  }

  .table-wrap:has(.table-stack) {
    overflow-x: visible;
  }
}

/* Charts scale down with the screen: their labels are drawn larger so they stay readable. */
@media (max-width: 40rem) {
  .chart-axis,
  .chart-ref-label {
    font-size: 21px;
  }

  .chart-end-label {
    font-size: 23px;
  }

  .chart-ref-label,
  .chart-end-label {
    stroke-width: 6px;
  }
}
