/* The house style for screens: the parts every Tüccar web page shares, by the rules in
   tuccar/design/README.md (Web). Values come from tokens.css, which `screen.write` puts beside this
   file with the fonts and the logo. A page's own stylesheet lays out that page and never restyles
   these parts; change one here and every screen takes it on its next build. */

@font-face { font-family: Spectral; font-weight: 400; font-display: swap; src: url(fonts/Spectral-Regular.ttf); }
@font-face { font-family: Spectral; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/Spectral-Italic.ttf); }
@font-face { font-family: Spectral; font-weight: 600; font-display: swap; src: url(fonts/Spectral-SemiBold.ttf); }
@font-face { font-family: 'Inter Tight'; font-weight: 400; font-display: swap; src: url(fonts/InterTight-Regular.ttf); }
@font-face { font-family: 'Inter Tight'; font-weight: 500; font-display: swap; src: url(fonts/InterTight-Medium.ttf); }
@font-face { font-family: 'Inter Tight'; font-weight: 600; font-display: swap; src: url(fonts/InterTight-SemiBold.ttf); }

/* One measure for every screen: the bar and the content share its left edge. */
:root {
  color-scheme: light only;
  --measure: 1120px;
  --gutter: max(24px, calc((100vw - var(--measure)) / 2));
  --rail: 176px;
  --bar: 64px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: var(--bar); }
/* A reading page (the website) is set in the serif. An app screen (the console) puts `app` on its
   body: Inter Tight at table size, with tabular figures. */
body { margin: 0; background: var(--color-paper); color: var(--color-ink);
  font: var(--type-body)/1.6 var(--font-serif); -webkit-font-smoothing: antialiased; }
body.app { font: var(--type-table)/1.5 var(--font-sans); font-variant-numeric: tabular-nums; }
::selection { background: var(--color-accent); color: var(--color-paper); }
a { color: var(--color-ink); text-decoration-color: var(--color-accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--font-serif); font-weight: 600; letter-spacing: -.012em; text-wrap: balance; }

/* Words: the tracked-capital marker over a section, the dek under a headline. */
.kicker { margin: 0; font: 600 var(--type-kicker)/1.4 var(--font-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--color-accent); }
.dek { font: var(--type-lede)/1.5 var(--font-serif); color: var(--color-ink-soft); }
.muted { color: var(--color-muted); }
.error { color: var(--color-loss-text); }
/* A signed figure takes its sign's colour, and always shows the + or −. */
.gain { color: var(--color-gain); }
.loss { color: var(--color-loss-text); }

/* Actions: the main one filled in ink, the others outlined. */
.button { display: inline-block; font: 500 var(--type-table)/1 var(--font-sans); letter-spacing: .02em; text-decoration: none;
  color: var(--color-paper); background: var(--color-ink); border: 1px solid var(--color-ink); border-radius: 0; padding: 12px 19px; cursor: pointer; }
.button:hover { background: var(--color-accent); border-color: var(--color-accent); }
.button.quiet { color: var(--color-ink); background: transparent; border-color: var(--color-hairline); }
.button.quiet:hover { border-color: var(--color-ink); }
.button:disabled { opacity: .55; cursor: default; }

/* The bar: the lockup, the sections, the main action at the right. */
.bar { position: sticky; top: 0; z-index: 2; height: var(--bar); padding: 0 var(--gutter); display: flex; align-items: center; gap: 36px;
  background: var(--color-paper); border-bottom: 1px solid var(--color-hairline); }
.bar .home { margin-right: auto; display: flex; align-items: center; gap: var(--space-3); text-decoration: none; }
.bar .lockup { display: block; height: 30px; width: auto; }
.bar nav { display: flex; gap: 30px; }
.bar nav a { font: 500 var(--type-table)/1 var(--font-sans); text-decoration: none; color: var(--color-ink-soft); white-space: nowrap; }
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent); }
.bar .button { padding: 10px 15px; }

/* A section: its marker in the left rail, its content on the grid. */
.rail { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }
.rail > .kicker { padding-top: .9em; }

/* Plain forms: a label above each field, one column. */
label { display: block; font: 500 var(--type-caption)/1.5 var(--font-sans); color: var(--color-ink); }
label .note { color: var(--color-muted); margin-left: 8px; }
input, textarea, select { display: block; width: 100%; margin-top: 6px; padding: 9px 11px; color: var(--color-ink);
  font: 400 var(--type-body)/1.45 var(--font-serif); background: var(--color-paper); border: 1px solid var(--color-hairline); border-radius: 0; }
textarea { resize: vertical; min-height: 4.4em; }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--color-ink); box-shadow: inset 0 -2px 0 var(--color-accent); }
[aria-invalid="true"] { border-color: var(--color-loss-text); }

/* A ruled panel holds one form or one notice. */
.panel { padding: var(--space-5); border: 1px solid var(--color-hairline); background: var(--color-paper); }
.panel > * + * { margin-top: var(--space-4); }

/* Ruled tables: tracked-capital heads, figures right-aligned (`num`), row rules in grid, inactive
   and child rows muted, the total in bold. A `secondary` column drops on a phone; a `long` cell (an
   address, a link) may break inside a word. */
.table { width: 100%; border-collapse: collapse; font: var(--type-table)/1.5 var(--font-sans); font-variant-numeric: tabular-nums; }
.table th { color: var(--color-muted); font-size: var(--type-kicker); font-weight: 600; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
.table th, .table td { padding: var(--space-2) var(--space-4) var(--space-2) 0; border-bottom: 1px solid var(--color-grid); vertical-align: top; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table .num { text-align: right; }
.table .long { overflow-wrap: anywhere; }
.table tr.inactive td { color: var(--color-muted); }
.table tr.child td { color: var(--color-muted); }
.table tr.total td { font-weight: 600; border-top: 1px solid var(--color-ink); }

@media (max-width: 900px) {
  .rail { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .rail > .kicker { padding-top: 0; }
}
@media (max-width: 700px) {
  :root { --bar: 56px; }
  /* On a phone the bar is two rows: the lockup and the action, then the sections, which scroll. */
  .bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: calc(var(--bar) - 1px); height: auto; gap: 0 var(--space-4); }
  .bar .lockup { height: 26px; }
  .bar nav { grid-row: 2; grid-column: 1 / -1; gap: var(--space-5); overflow-x: auto; padding-bottom: 14px; }
  .table .secondary { display: none; }
}
