/* DOCUMENTED tokens. Do not change the four brand values without Golsa. */
:root {
  --takt-near-black: #242121;
  --takt-grey-4: #434343;
  --takt-grey-3: #666666;
  --takt-blue: #74aec8;

  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-sans: "Archivo", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, monospace;

  --ground: #242121;
  --surface: #2e2a2a;
  --surface-raised: #383333;
  --line: rgb(255 255 255 / 0.14);
  --line-strong: rgb(255 255 255 / 0.3);
  --ink: #ffffff;
  --ink-muted: #c2c1c1;
  --ink-dim: #a7a6a6;
  --interactive: #74aec8;

  --text-label: 0.75rem;
  --text-body-sm: 0.875rem;
  --text-body: 1rem;
  --text-lede: 1.125rem;
  --text-figure-sm: 1.75rem;
  --text-figure: 2.75rem;
  --text-title: 3.5rem;

  --radius: 0.25rem;
  --radius-pill: 3rem;
  --shell: 84rem;
}

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

/* Any author rule setting display beats the browser's own [hidden] rule, so
   hidden has to be stated here or an element with the attribute still shows. */
[hidden] { display: none !important; }

html {
  color-scheme: dark;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--ground);
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  letter-spacing: -0.02em;
}

:focus-visible {
  outline: 2px solid var(--interactive);
  outline-offset: 3px;
  scroll-margin-top: 6rem;
}

button:not(:disabled), [role="button"]:not(:disabled), summary { cursor: pointer; }

a { color: var(--interactive); text-underline-offset: 4px; }

/* Type roles */
.display {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-title);
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
}

.label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  margin: 0;
}

.eyebrow { color: var(--interactive); }

.lede {
  margin: 0;
  max-width: 60ch;
  font-size: var(--text-body);
  color: var(--ink-muted);
}

.figure {
  margin: 0;
  font-weight: 600;
  font-size: var(--text-figure);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* Controls */
.button {
  display: inline-block;
  border: 1px solid var(--interactive);
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--interactive);
  background: transparent;
  transition: background-color 0.5s ease, color 0.5s ease;
}

.button:hover, .button:focus-visible {
  background-color: var(--interactive);
  color: var(--ground);
}

.notice {
  max-width: 60ch;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: var(--text-body-sm);
  color: var(--ink);
}

/* Sign in */
.signin {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: 1.5rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  text-align: center;
}

/* The mask a heading rises out of */
.mask {
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

/* Shell */
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 1.5rem; }
.main { padding-block: 2.5rem; }

.skip {
  position: absolute; left: -9999px;
  background: var(--surface-raised); color: var(--ink);
  padding: 0.5rem 1rem; border-radius: var(--radius); z-index: 30;
}
.skip:focus { left: 1.5rem; top: 1.5rem; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: var(--ground); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; padding-block: 1rem; }
.wordmark { display: flex; flex-direction: column; gap: 0.125rem; }
.wordmark-name { font-family: var(--font-display); font-size: var(--text-figure-sm); line-height: 1; text-transform: uppercase; color: var(--ink); text-decoration: none; }

.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; }
.link { text-decoration: none; }
.link:hover { text-decoration: underline; }

.button-small { padding: 0.5rem 1rem; font-size: var(--text-label); }

/* Page head */
.page-head { display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 2rem; }

/* Stat strip */
.stats { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); margin: 0 0 2.5rem; }
@media (min-width: 40rem) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { display: flex; flex-direction: column; gap: 0.25rem; background: var(--ground); padding: 1rem 1.5rem 1rem 0; }
@media (min-width: 40rem) { .stat + .stat { padding-left: 1.5rem; } }
.stat-value { margin: 0; font-size: var(--text-lede); color: var(--ink); }

/* Sections and tiles */
.sections { display: flex; flex-direction: column; gap: 2.5rem; }
.section { display: flex; flex-direction: column; gap: 1rem; }
.section-head { display: flex; align-items: center; gap: 0.75rem; }
.ink { color: var(--ink); }

.grid { display: grid; gap: 1px; background: var(--line); }
@media (min-width: 40rem) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 68rem) { .grid { grid-template-columns: repeat(3, 1fr); } }

.tile-slot { position: relative; display: flex; flex-direction: column; }
.tile {
  position: relative; flex: 1;
  display: flex; flex-direction: column; gap: 1rem;
  background: var(--surface); padding: 1.5rem;
  transition: background-color 0.5s ease;
}
.tile:hover, .tile:focus-within { background: var(--surface-raised); }

.tile-title { margin: 0; font-size: var(--text-body-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink); }
.tile-title a { color: inherit; text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 10; }

.tile-body { display: flex; flex: 1; flex-direction: column; gap: 0.75rem; }
.no-data { font-size: var(--text-lede); color: var(--ink); }
.sentence { text-transform: none; letter-spacing: normal; line-height: 1.5; }
.dim { color: var(--ink-dim); }
.unit { margin-left: 0.25rem; font-size: var(--text-figure-sm); color: var(--ink-muted); }
.ytd { padding-top: 0.5rem; }
.pair { display: flex; gap: 2rem; }
.pair p:first-child { margin-bottom: 0.25rem; }

.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.row-name { font-size: var(--text-body-sm); color: var(--ink); }
.row-meta { flex-shrink: 0; }

.freshness { margin: 0; }
.pill { display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 0.25rem 0.75rem; color: var(--ink); }

/* Rearranging */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-bottom: 1.5rem; }

.link-button { background: none; border: 0; padding: 0; color: var(--interactive); text-decoration: underline; text-underline-offset: 4px; font: inherit; font-family: var(--font-mono); font-size: var(--text-label); text-transform: uppercase; letter-spacing: 0.08em; }
.link-button:disabled { color: var(--ink-dim); text-decoration: none; }

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

.move { display: inline-flex; align-items: center; gap: 0.25rem; }
.tile-slot > .move { position: absolute; right: 0.75rem; top: 0.75rem; z-index: 20; border-radius: var(--radius); background: var(--surface-raised); padding: 0.25rem; }

.move-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5rem; height: 1.5rem; flex-shrink: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: transparent; color: var(--ink-muted);
  transition: border-color 0.3s ease, color 0.3s ease;
}
.move-button:hover:not(:disabled) { border-color: var(--interactive); color: var(--interactive); }
.move-button:disabled { border-color: var(--line); color: var(--ink-dim); }

.grip { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; color: var(--ink-dim); cursor: grab; }
.grip:active { cursor: grabbing; }

.chev.down { transform: rotate(180deg); }
.chev.left { transform: rotate(-90deg); }
.chev.right { transform: rotate(90deg); }

.section.editing { border-radius: var(--radius); padding: 0.75rem; outline: 1px dashed var(--line-strong); outline-offset: -1px; }
.dragging { opacity: 0.6; }

/* Settings and source detail */
.connections { gap: 1px; background: var(--line); }
.connection { display: flex; flex-direction: column; gap: 0.75rem; background: var(--surface); padding: 1.5rem; }
.connection-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; }

.detail { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; }
.detail-row { display: flex; flex-direction: column; gap: 0.25rem; }
@media (min-width: 40rem) { .detail-row { flex-direction: row; gap: 1.5rem; } .detail-row .label { width: 12rem; flex-shrink: 0; } .detail-row .wide { width: 16rem; } }
.detail-row dd { margin: 0; }
.bordered { border-bottom: 1px solid var(--line); padding-block: 1rem; }
.bordered-top { border-top: 1px solid var(--line); }

.mono { font-family: var(--font-mono); font-size: var(--text-body-sm); color: var(--ink-muted); }
.break { word-break: break-all; }
.small { font-size: var(--text-body-sm); }

.setup { border-top: 1px solid var(--line); padding-top: 0.75rem; }
.setup summary { color: var(--interactive); }
.setup-body { display: flex; flex-direction: column; gap: 0.75rem; padding-top: 1rem; }

/* Spacing corrections
   The dashboard wraps its sections in .sections, which carries the gap. The
   settings and source pages put sections straight into main, where nothing
   separated them. */
.main > .section + .section { margin-top: 2.5rem; }

/* Bordered rows carry their own padding, so a gap on top of it reads as a
   broken rule between them. */
.detail.bordered-top { gap: 0; }

/* A label and the list it introduces sat flush against each other. */
.setup-body > div { display: flex; flex-direction: column; gap: 0.25rem; }
