/* Softwash Technologies tag site. Brand: /projects/DESIGN.md. Three brand colours plus black and white only. */

@font-face {
  font-family: "Teko";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/teko-600.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 600; /* one variable file covers 400, 500 and 600 */
  font-display: swap;
  src: url("fonts/dmsans-var.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/dmsans-italic-400.woff2") format("woff2");
}

:root {
  --graphite: #1A1D21;
  --signal: #DAEC0C;
  --ocean: #0077B6;
  --white: #FFFFFF;
  --black: #000000;
  --head: "Teko", "Arial Narrow", sans-serif;
  --body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
  --max: 1200px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  color: var(--black);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.4;
  font-size-adjust: from-font; /* keeps the fallback the same size while DM Sans loads; ignored where unsupported */
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

h1, h2, h3, h4 {
  font-family: var(--head);
  font-weight: 600;
  line-height: 1.1;
  color: var(--graphite);
  margin: 0 0 16px;
}
h1 { font-size: clamp(40px, 10vw, 64px); letter-spacing: 1px; text-transform: uppercase; }
h2 { font-size: clamp(32px, 8vw, 48px); letter-spacing: 1px; text-transform: uppercase; }
h3 { font-size: 32px; letter-spacing: .5px; }
h4 { font-size: 24px; }

a { color: var(--ocean); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--ocean); outline-offset: 2px; }
.band :focus-visible { outline-color: var(--signal); }
main:focus { outline: none; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--signal);
  color: var(--graphite);
  font-weight: 600;
  border-radius: 12px;
}
.skip:focus { top: 8px; }

/* header band */
.band { background: var(--graphite); color: var(--white); }
.band-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.mark {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 8px;
  color: var(--white);
  text-decoration: none;
}
.mark-sw, .mark-site {
  font-family: var(--head);
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.mark-tech { font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.mark-site { color: var(--signal); }
.signout {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--white);
  font-weight: 500;
  white-space: nowrap;
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--white);
  font-family: var(--head);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  touch-action: manipulation;
}
.nav a:hover { border-bottom-color: var(--white); }
.nav a[aria-current="page"] { color: var(--signal); border-bottom-color: var(--signal); }

main { flex: 1; padding-block: 32px 48px; }

.foot { background: var(--graphite); color: var(--white); font-size: 16px; }
.foot p { margin: 0; padding-block: 8px; }
.foot .wrap { padding-block: 16px; }
.freshness:empty { display: none; }

/* buttons: height 48, radius = height / 4 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 4px 24px 0; /* Teko sits high in its box */
  border: 0;
  border-radius: 12px;
  font-family: var(--head);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.btn:hover { filter: brightness(.92); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--signal); color: var(--graphite); }
.btn-secondary { background: var(--ocean); color: var(--white); }

/* forms */
.form { display: grid; gap: 24px; }
.field { display: grid; gap: 8px; }
label { font-weight: 500; color: var(--graphite); }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 8px 16px;
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming on focus */
  color: var(--black);
  background: var(--white);
  border: 2px solid var(--graphite);
  border-radius: 12px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--ocean); outline-offset: 2px; }

/* a message in words with an icon, never colour alone */
.notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 0 0 24px;
  padding: 12px 16px;
  border: 2px solid var(--graphite);
  border-radius: 12px;
  color: var(--graphite);
  font-weight: 500;
}
.notice svg { flex: none; margin-top: 1px; }

.login { max-width: 400px; margin-inline: auto; }
.login .lede { margin: 0 0 32px; color: var(--graphite); }
.login .btn { width: 100%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
main section + section { margin-top: 48px; }
.lede { margin: 0 0 16px; color: var(--graphite); }
.download { margin: 0 0 16px; }
.download a { display: inline-block; padding: 12px 0; }  /* a 44px tap target */

/* range picker (every page) */
.range { margin-bottom: 32px; }
.range-now { margin: 0 0 8px; color: var(--graphite); }
.range-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.range-presets a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 4px 16px 0;
  border: 2px solid var(--graphite);
  border-radius: 12px;
  color: var(--graphite);
  font-family: var(--head);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: .5px;
  text-decoration: none;
  touch-action: manipulation;
}
.range-presets a:hover { background: var(--graphite); color: var(--white); }
.range-presets a[aria-current="true"] { background: var(--graphite); color: var(--signal); }
.range-custom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  align-items: end;
  margin-bottom: 16px;
}
.range-custom .btn { grid-column: 1 / -1; }
.bots { margin: 0; color: var(--graphite); font-size: 16px; }

/* headline tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tile {
  padding: 16px;
  border: 2px solid var(--graphite);
  border-radius: 12px;
}
.tile p { margin: 0; }
.tile-label { font-weight: 500; color: var(--graphite); }
.tile-value {
  font-family: var(--head);
  font-weight: 600;
  font-size: 40px;
  line-height: 1.1;
  padding-top: 4px;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
}
.tile-value[data-tile="revenue"], .tile-value[data-tile="aov"] { color: var(--ocean); }
.tile-live {
  display: inline-block;
  margin-top: 4px !important;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--graphite);
  color: var(--signal);
  font-size: 16px;
  font-weight: 600;
}
.tile-note { font-size: 16px; font-style: italic; color: var(--graphite); }
.prev { margin-top: 8px !important; font-size: 16px; color: var(--graphite); font-variant-numeric: tabular-nums; }
.change { font-weight: 600; }

.notice ul.missing { margin: 0; padding: 0; list-style: none; }

/* charts: colours here only, never inline */
.chart { display: block; width: 100%; }
.chart-fig { margin: 0; }
.chart-bars { height: 160px; }
.chart-bar { fill: var(--ocean); }
.chart-bar:hover { fill: var(--graphite); }
.chart-axis { stroke: var(--graphite); stroke-width: 2; }
.chart-scale {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 0;
  font-size: 16px;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
}
.chart-scale span:nth-child(2) { text-align: center; }
.chart-empty { margin: 0; color: var(--graphite); }
.funnel-all { max-width: 480px; margin-bottom: 32px; }
.chart-funnel { height: auto; }
.funnel-label, .funnel-value { font-family: var(--body); font-size: 16px; fill: var(--graphite); }
.funnel-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.funnel-bar { fill: var(--ocean); }
.trend { display: grid; gap: 32px; }
.trend h3 { font-size: 24px; margin-bottom: 8px; }

/* tables scroll inside their own box */
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 32px;
  border: 2px solid var(--graphite);
  border-radius: 12px;
}
table.data { border-collapse: separate; border-spacing: 0; min-width: 100%; font-variant-numeric: tabular-nums; }
table.data caption {
  padding: 12px 16px 4px;
  text-align: left;
  font-family: var(--head);
  font-weight: 600;
  font-size: 24px;
  color: var(--graphite);
}
table.data th, table.data td {
  padding: 8px 16px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--graphite);
}
table.data tbody tr:last-child > * { border-bottom: 0; }
table.data thead th { font-weight: 600; color: var(--graphite); }
table.data th[scope="row"], table.data thead th:first-child {
  position: sticky;
  inset-inline-start: 0;
  text-align: left;
  background: var(--white);
  font-weight: 500;
}
table.data .rate { display: block; font-size: 16px; color: var(--ocean); }
table.data td.money { color: var(--ocean); }
table.data .text { text-align: left; }
table.data th[scope="row"] { max-width: min(60vw, 480px); overflow: hidden; text-overflow: ellipsis; }
/* sortable headers: a link per column, the sorted one marked with aria-sort and an arrow */
table.data thead th:has(> a.sort) { padding-block: 0; }
table.data a.sort { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 600; }
table.data th[aria-sort] a.sort { text-decoration-thickness: 3px; }

@media (min-width: 768px) {
  .mark-sw, .mark-site { font-size: 28px; }
  .nav ul { column-gap: 32px; }
  .nav a { font-size: 22px; }
  .login { padding-top: 32px; }
  .range-custom { grid-template-columns: repeat(2, minmax(0, 200px)) auto; }
  .range-custom .btn { grid-column: auto; justify-self: start; }
  .trend { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* health page: status in words; colour is only a second cue */
.status {
  display: inline-block;
  padding: 0 8px;
  border: 2px solid var(--graphite);
  border-radius: 4px;
  color: var(--graphite);
  font-weight: 600;
  white-space: nowrap;
}
.status-ok { background: var(--signal); }
.status-bad { background: var(--graphite); color: var(--white); }
.health-line { margin: 0 0 8px; font-size: 18px; }
.health-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.health-cols { display: grid; gap: 0 16px; }
@media (min-width: 768px) {
  .health-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
}
