/* Traderbot design system.
 *
 * One accent colour, two semantic market colours, and a type pairing where
 * every number is monospaced so a column of prices lines up on the decimal.
 * Sections alternate between paper and ink; nothing is a floating card on a
 * gradient.
 */

:root {
  /* ink and paper */
  --ink: #101312;
  --ink-2: #191E1C;
  --ink-3: #242A27;
  --paper: #F4F2EC;
  --paper-2: #FFFFFF;
  --paper-3: #EAE7DE;

  /* text */
  --text: #101312;
  --text-soft: #4E5551;
  --text-faint: #7C8480;
  --text-on-ink: #F2F0EA;
  --text-on-ink-soft: #A8B0AB;

  /* one accent, two market colours */
  --accent: #E5A00D;
  --accent-deep: #B87A00;
  --accent-wash: rgba(229, 160, 13, 0.14);
  --up: #12795C;
  --up-wash: rgba(18, 121, 92, 0.12);
  --down: #C13E28;
  --down-wash: rgba(193, 62, 40, 0.12);

  /* lines */
  --line: rgba(16, 19, 18, 0.13);
  --line-strong: rgba(16, 19, 18, 0.26);
  --line-on-ink: rgba(242, 240, 234, 0.16);

  /* type */
  --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --serif: 'Instrument Serif', ui-serif, Georgia, 'Times New Roman', serif;

  /* rhythm */
  --page: 1240px;
  --reading: 68ch;
  --gap: 24px;
  --section: 104px;

  /* motion: one curve for movement, one for colour */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --quick: 160ms;
  --calm: 320ms;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: 'kern' 1;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection { background: var(--accent-wash); }

/* ---------------------------------------------------------------- layout */

.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 28px; }
/* A narrow column keeps the left edge of the page: centring it moved the text
 * clear of every other section and read as two different layouts. */
.wrap-narrow > * { max-width: 840px; }

.section { padding: var(--section) 0; }
.section-tight { padding: 64px 0; }

.on-ink {
  background: var(--ink);
  color: var(--text-on-ink);
}
.on-ink h1, .on-ink h2, .on-ink h3 { color: var(--text-on-ink); }
.on-ink .lede, .on-ink .muted { color: var(--text-on-ink-soft); }
.on-ink .rule { background: var(--line-on-ink); }

.on-paper-2 { background: var(--paper-2); }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* --------------------------------------------------------------- headings */

h1, h2 {
  margin: 0 0 0.32em;
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.04;
  text-wrap: balance;
}
h3, h4 {
  margin: 0 0 0.4em;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.25;
}

h1 { font-size: clamp(46px, 6.6vw, 82px); }
h2 { font-size: clamp(34px, 4.4vw, 56px); }
h3 { font-size: 21px; }
h4 { font-size: 17px; line-height: 1.35; }

/* The display accent: a serif italic word inside a grotesk headline. It
 * carries the emphasis so the sentence never needs a colour or a bold run. */
.say {
  font-style: italic;
  color: var(--accent-deep);
}
.on-ink .say { color: var(--accent); }

.lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 56ch;
  margin: 0 0 40px;
}
/* Body copy never runs the width of the window. */
.column { max-width: var(--reading); }

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

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- numbers */

.num, .money, td.num, th.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.up { color: var(--up); }
.down { color: var(--down); }
.big-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* --------------------------------------------------------------- controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  background: var(--ink);
  color: var(--paper-2);
  transition: background var(--quick) var(--ease), color var(--quick) var(--ease),
              border-color var(--quick) var(--ease), transform var(--quick) var(--ease),
              box-shadow var(--quick) var(--ease);
}
.btn:hover { background: var(--ink-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-accent {
  background: linear-gradient(102deg, var(--accent) 0%, #F2B93E 52%, var(--accent-deep) 100%);
  color: #1A1200;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}
.btn-accent:hover { background: linear-gradient(102deg, #F0AE24 0%, #FFC65A 52%, var(--accent) 100%); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: rgba(16, 19, 18, 0.05); border-color: var(--ink); }
.on-ink .btn-ghost { color: var(--text-on-ink); border-color: var(--line-on-ink); }
.on-ink .btn-ghost:hover { background: rgba(242, 240, 234, 0.09); border-color: var(--text-on-ink); }

.btn-small { min-height: 38px; padding: 8px 16px; font-size: 14px; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; transform: none; }

.link-quiet {
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
  transition: border-color var(--quick) var(--ease), color var(--quick) var(--ease);
}
.link-quiet:hover { border-color: var(--accent); color: var(--accent-deep); }

/* ------------------------------------------------------------------ chips */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--paper-3);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  white-space: nowrap;
}
.chip-accent { background: var(--accent-wash); color: var(--accent-deep); }
.chip-up { background: var(--up-wash); color: var(--up); }
.chip-down { background: var(--down-wash); color: var(--down); }
.on-ink .chip { background: rgba(242, 240, 234, 0.1); color: var(--text-on-ink-soft); }

.ticker {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
}

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

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
}

/* The readout: a label on the left, a number on the right, a hairline
 * between. It replaces the tile of a big number over a small grey caption,
 * which is the shape every generated dashboard reaches for. */
.readout { border-top: 1px solid var(--line); }
.readout div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.readout dt, .readout .k { font-size: 15px; color: var(--text-soft); }
.readout dd, .readout .v {
  margin: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.readout-lead .v { font-size: 27px; }
.on-ink .readout, .on-ink .readout div { border-color: var(--line-on-ink); }
.on-ink .readout dt, .on-ink .readout .k { color: var(--text-on-ink-soft); }

/* The entry: a category, a number, a name, a line about it, and a foot with
 * the fact and the action. Taken from the reference site, where a list of
 * twelve things reads as a list and not as twelve identical boxes. */
.entries { border-top: 1px solid var(--line); }
.entry {
  display: block;
  padding: 26px 0 22px;
  border-bottom: 1px solid var(--line);
  transition: background var(--quick) var(--ease);
}
a.entry:hover { background: rgba(16, 19, 18, 0.028); }
.entry-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}
.entry-kind {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.entry-no { font-family: var(--mono); font-size: 13px; color: var(--text-faint); }
.entry-name {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 6px;
  transition: color var(--quick) var(--ease);
}
a.entry:hover .entry-name { color: var(--accent-deep); }
.entry-line { color: var(--text-soft); max-width: 62ch; margin: 0 0 14px; }
.entry-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 26px;
  font-size: 14px;
  color: var(--text-soft);
}
.entry-foot b {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
  margin-right: 5px;
}
.entry-do {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-deep);
}
.on-ink .entries, .on-ink .entry { border-color: var(--line-on-ink); }
.on-ink .entry-line, .on-ink .entry-foot { color: var(--text-on-ink-soft); }
.on-ink .entry-foot b { color: var(--text-on-ink); }
.on-ink a.entry:hover { background: rgba(242, 240, 234, 0.04); }
.on-ink a.entry:hover .entry-name, .on-ink .entry-do { color: var(--accent); }

@media (max-width: 620px) {
  .entry-name { font-size: 25px; }
  .entry-do { margin-left: 0; width: 100%; }
}
.on-ink .panel { background: var(--ink-2); border-color: var(--line-on-ink); }

.panel-flush { padding: 0; overflow: hidden; }

/* A row list beats a grid of identical cards where the items are of one
 * kind and differ only by their numbers. */
.rows { border-top: 1px solid var(--line); }
.row {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.on-ink .rows, .on-ink .row { border-color: var(--line-on-ink); }

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

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-soft);
  white-space: nowrap;
}
td.right, th.right { text-align: right; }
tbody tr { transition: background var(--quick) var(--ease); }
tbody tr:hover { background: rgba(16, 19, 18, 0.03); }
.on-ink th, .on-ink td { border-color: var(--line-on-ink); }
.on-ink tbody tr { transition: background var(--quick) var(--ease); }
.on-ink tbody tr:hover { background: rgba(242, 240, 234, 0.05); }

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

label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'],
input[type='search'], input[type='date'], select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color var(--quick) var(--ease), box-shadow var(--quick) var(--ease);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
  outline: none;
}
.field { margin-bottom: 18px; }
.field-note { font-size: 13px; color: var(--text-soft); margin-top: 6px; }
.field-error { font-size: 14px; color: var(--down); margin-top: 6px; }

input[type='range'] {
  width: 100%;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent-deep);
}

/* ---------------------------------------------------------------- notices */

.notice {
  padding: 14px 18px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  font-size: 15px;
}
.notice-bad { border-left-color: var(--down); background: var(--down-wash); }
.notice-good { border-left-color: var(--up); background: var(--up-wash); }

/* ------------------------------------------------------------------- grid */

.cols { display: grid; gap: var(--gap); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-sidebar { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
.cols-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }

@media (max-width: 1000px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-sidebar, .cols-split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 760px) {
  :root { --section: 68px; --gap: 18px; }
  .wrap { padding: 0 18px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); }
  body { font-size: 16px; }
  .lede { font-size: 18px; }
  .panel { padding: 20px; }
}

/* --------------------------------------------------------------- skeleton */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper-2);
  padding: 12px 18px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ------------------------------------------------------------------ reveal */

/* Sections fade in once, on opacity only, so nothing shifts under a reader. */
.reveal { opacity: 0; transition: opacity var(--calm) var(--ease); }
.reveal.shown { opacity: 1; }

/* Twelve entries in one column run for three screens. Two columns read the
 * way the reference site sets a list of products, and the eye takes the whole
 * set in at once. */
.entries-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 56px;
  border-top: 0;
}
.entries-two .entry { border-top: 1px solid var(--line); border-bottom: 0; }
.on-ink .entries-two .entry { border-color: var(--line-on-ink); }
@media (max-width: 900px) { .entries-two { grid-template-columns: minmax(0, 1fr); } }
