/*
 * waterexams.com: the app's sign world, set for the web. DESIGN.md is the system; the colors, the framed sign panel,
 * the filled bands, the plaque and the two faces all come from the app. Dark only, as the app is: the sign blank is
 * the page.
 */

@font-face {
  font-family: "Barlow Condensed";
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/BarlowCondensed-Bold.ttf") format("truetype");
}
@font-face {
  font-family: "Barlow";
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/Barlow-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Barlow";
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/Barlow-ExtraBold.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  --ground: #0b2b3c;
  --sheeting: #dcebf4;
  --attention: #f2b63d;
  --miss: #2e9bd6;
  --destination: #ffffff;
  --band: #12384b;
  --band-raised: #174559;
  --legend: #7fa3b8;
  --hairline: #1c455b;
  --sign: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --edge: clamp(16px, 4vw, 56px);
  --measure: 1200px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  background: var(--ground);
  scrollbar-color: var(--legend) var(--ground);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--sheeting);
  font: 400 17px/1.55 var(--text);
  caret-color: var(--attention);
}

::selection {
  background: var(--attention);
  color: var(--ground);
}

a {
  color: inherit;
  text-decoration-color: var(--legend);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration-color: var(--attention);
}

:focus-visible {
  outline: 3px solid var(--sheeting);
  outline-offset: 3px;
  border-radius: 5px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--edge));
  margin: 0 auto;
  padding: 0 var(--edge);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--edge);
  top: 12px;
  z-index: 2;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--attention);
  color: var(--ground);
  font: 700 16px/1 var(--sign);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  text-decoration: none;
}

/* The header: the handwheel and the wordmark, and the two other pages. */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  text-decoration: none;
}
.brand img {
  width: 40px;
  height: 40px;
}
.wordmark {
  font-family: "Barlow", var(--text);
  font-size: 26px;
  letter-spacing: -0.25px;
  color: var(--destination);
  line-height: 1;
}
.wordmark span {
  font-weight: 600;
}
.wordmark b {
  font-weight: 800;
}
.nav {
  display: flex;
  gap: 26px;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font: 700 16px/1 var(--sign);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--legend);
  text-decoration: none;
}
.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--sheeting);
}
.nav a[aria-current="page"] {
  color: var(--attention);
}

/* The rail: what this is at the left, where it is going at the right, as the app's rail sits over its sign. */

.rail {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
  flex-wrap: wrap;
  margin: 26px 0 0;
  font: 700 16px/1.3 var(--sign);
  letter-spacing: 1.6px;
  text-transform: uppercase;
}
.rail h1 {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--legend);
}
.rail .soon {
  color: var(--attention);
}

/* The gantry: a truss across the road on a post at each side, the four signs hung from it, and a lane under each. */

.frame {
  position: relative;
  margin-top: 22px;
  padding: 0 26px;
}
.frame::before,
.frame::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  background: var(--hairline);
}
.frame::before {
  left: 0;
}
.frame::after {
  right: 0;
}
.truss {
  height: 12px;
  margin: 0 -26px;
  background: var(--hairline);
}
.gantry {
  display: grid;
  grid-template-columns: 1.15fr 1.3fr 1.3fr 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hang {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
}
.hooks {
  display: flex;
  justify-content: space-around;
  height: 14px;
}
.hooks i {
  display: block;
  width: 6px;
  background: var(--hairline);
}
/* A roadside sign's 10px corner on a phone, a gantry sign's 14px from a tablet up, as in the app. */
.panel {
  border: 3px solid var(--sheeting);
  border-radius: 10px;
  padding: 16px 20px 18px;
}
@media (min-width: 601px) {
  .panel {
    border-radius: 14px;
  }
}
.sign {
  display: flex;
  flex-direction: column;
}
.dest {
  margin: 0;
  font: 700 clamp(36px, 4.4vw, 58px)/1 var(--sign);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--destination);
}
.topic {
  margin-top: 10px;
  font: 600 13px/1.35 var(--text);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--legend);
}
.legends {
  display: grid;
  gap: 4px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font: 700 18px/1.2 var(--sign);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sheeting);
}
.legends li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
/* A legend with a long and a short form: the short one only where a quarter of the road is too narrow. */
.legends .short {
  display: none;
}
.legends em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  color: var(--attention);
}
.arrow {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding-top: 16px;
  color: var(--sheeting);
}
.lane {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--band);
}
.lane b {
  display: block;
  font: 600 16px/1.3 var(--text);
  color: var(--sheeting);
}
.lane span {
  display: block;
  margin-top: 2px;
  font: 400 14px/1.4 var(--text);
  color: var(--legend);
}
.lane.free {
  background: var(--attention);
}
.lane.free b,
.lane.free span {
  color: var(--ground);
}

.lede {
  max-width: 60ch;
  margin: 34px 0 0;
  font: 400 clamp(18px, 1.6vw, 20px)/1.55 var(--text);
  color: var(--sheeting);
}
.lede strong {
  font-weight: 600;
  color: var(--destination);
}

/* Sections below the gantry. */

.section {
  padding-top: clamp(64px, 9vw, 112px);
}
.section h2 {
  margin: 0 0 18px;
  font: 700 clamp(30px, 3.4vw, 44px)/1.05 var(--sign);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--destination);
  text-wrap: balance;
}
.section p {
  max-width: 64ch;
  margin: 0 0 16px;
}
.quiet {
  color: var(--legend);
}

/* The sample question: the app's question screen in its gantry form, the question on the left, the lanes on the
   right, the plaque under the lanes once an answer is chosen. */

.question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "head bands"
    "plaque bands";
  column-gap: 28px;
  align-items: start;
  margin-top: 10px;
}
.q-head {
  grid-area: head;
}
.question .choices {
  grid-area: bands;
}
.question .plaque {
  grid-area: plaque;
  margin-top: 26px;
}
.q-rail {
  margin-top: 22px;
  padding-left: 21px;
}
.q-rail .lic {
  color: var(--legend);
}
.panel.small {
  padding: 14px 18px 16px;
}
.panel.small .dest {
  font-size: clamp(30px, 3.2vw, 42px);
}
.panel-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.panel-row .topic {
  margin: 0;
}
.dots {
  display: inline-flex;
  gap: 5px;
}
.dots i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(127, 163, 184, 0.65);
}
.dots i.on {
  background: var(--attention);
}
.question .stem {
  max-width: none;
  margin: 26px 0 0;
  /* On the panel's legend axis: its 18px padding plus its 3px border. */
  padding-left: 21px;
  font: 700 clamp(23px, 2.4vw, 34px)/1.25 var(--text);
  letter-spacing: -0.2px;
  color: var(--destination);
  text-wrap: pretty;
}
.choices {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.choice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 15px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--band);
  color: var(--sheeting);
  font: 500 17px/1.35 var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.15s ease-out,
    color 0.15s ease-out,
    opacity 0.15s ease-out;
}
.choice:hover {
  background: var(--band-raised);
}
.choice .plate {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  background: var(--sheeting);
  color: var(--ground);
  font: 700 22px/1 var(--sign);
}
.choice .text {
  flex: 1;
  padding-top: 3px;
}
.choice .verdict {
  flex: none;
  padding-top: 6px;
}
.choice .verdict svg {
  display: none;
}
.choice[data-state] {
  cursor: default;
}
.choice[data-state="right"] {
  background: var(--attention);
  color: var(--ground);
  font-weight: 600;
}
.choice[data-state="wrong"] {
  background: var(--miss);
  color: var(--ground);
  font-weight: 600;
}
.choice[data-state="right"] .plate,
.choice[data-state="wrong"] .plate {
  background: var(--ground);
}
.choice[data-state="right"] .plate {
  color: var(--attention);
}
.choice[data-state="wrong"] .plate {
  color: var(--miss);
}
.choice[data-state="right"] .check,
.choice[data-state="wrong"] .cross {
  display: block;
}
.choice[data-state="dim"] {
  opacity: 0.6;
}
.plaque {
  margin-top: 16px;
  padding: 18px 20px 20px;
  border-radius: 8px;
  background: var(--band);
}
.plaque[data-arrive] {
  animation: arrive 0.36s var(--ease) both;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.plaque .verdict-line {
  margin: 0;
  font: 700 20px/1.1 var(--sign);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--attention);
}
.plaque .verdict-line.no {
  color: var(--miss);
}
.plaque p {
  margin: 12px 0 14px;
  font: 400 16px/1.55 var(--text);
}
.cite {
  font: 700 clamp(26px, 2.6vw, 34px)/1 var(--sign);
  letter-spacing: 0.6px;
  color: var(--attention);
}
.cite-detail {
  margin-top: 4px;
  font: 400 14px/1.4 var(--text);
  color: var(--legend);
}
.again {
  margin-top: 14px;
  padding: 0;
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--sheeting);
  font: 600 16px/1 var(--text);
  text-decoration: underline;
  text-decoration-color: var(--legend);
  text-underline-offset: 3px;
  cursor: pointer;
}
.after-question {
  margin-top: 22px;
}

/* What is free: the picker's filled bands, a label and a note at the left, the count in amber at the right. */

.bands {
  display: grid;
  gap: 8px;
  margin: 26px 0 22px;
  padding: 0;
  list-style: none;
}
.bands li {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--band);
}
.bands .what {
  flex: 1;
}
.bands b {
  display: block;
  font: 500 17px/1.3 var(--text);
  color: var(--sheeting);
}
.bands span {
  display: block;
  margin-top: 2px;
  font: 400 14px/1.4 var(--text);
  color: var(--legend);
}
.bands .count {
  flex: none;
  font: 700 22px/1 var(--sign);
  letter-spacing: 0.6px;
  font-variant-numeric: tabular-nums;
  color: var(--attention);
}

/* A section that stands its words at the left and its sign or bands at the right, on a wide screen. */

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.split .bands {
  margin: 8px 0 0;
}

/* Sources: the authorities the plaques name, as one sign's destinations, each with what it is. */

.panel.sources {
  margin-top: 8px;
  padding: 18px 22px 20px;
}
.panel.sources .dest {
  font-size: clamp(34px, 3.6vw, 46px);
}
.legends.wide {
  gap: 0;
  margin-top: 14px;
}
.legends.wide li {
  align-items: baseline;
  padding: 9px 0;
  border-top: 1px solid var(--hairline);
  color: var(--attention);
}
.legends.wide span {
  font: 400 15px/1.35 var(--text);
  letter-spacing: 0;
  text-transform: none;
  text-align: right;
  color: var(--sheeting);
}

/* The last sign on the route. */

.closing {
  padding-top: clamp(72px, 10vw, 128px);
  padding-bottom: 24px;
}
.closing .panel {
  padding: 22px 26px 24px;
}
.closing .dest {
  font-size: clamp(40px, 6vw, 72px);
}
.closing .topic {
  font-size: 14px;
}

/* The footer. */

.foot {
  margin-top: 56px;
  padding-top: 22px;
  padding-bottom: 40px;
  border-top: 1px solid var(--hairline);
  font: 400 14px/1.55 var(--text);
  color: var(--legend);
}
.foot p {
  margin: 0 0 8px;
  max-width: 70ch;
}
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin-bottom: 10px;
}
.foot nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--sheeting);
}

/* The two reading pages: the page's name on a sign, then plain reading at a reading measure. */

.doc {
  max-width: 760px;
}
.doc .panel {
  margin-top: 26px;
}
.doc h1.dest {
  font-size: clamp(40px, 6vw, 64px);
}
.doc h2 {
  margin: 52px 0 12px;
  font: 700 clamp(30px, 3.2vw, 38px)/1.05 var(--sign);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--destination);
}
.doc h3 {
  margin: 28px 0 6px;
  font: 600 19px/1.35 var(--text);
  color: var(--destination);
}
.doc p,
.doc li {
  max-width: 68ch;
}
.doc p {
  margin: 0 0 14px;
}
.doc ul {
  margin: 0 0 14px;
  padding-left: 22px;
}
.doc li {
  margin-bottom: 6px;
}
.doc li::marker {
  color: var(--attention);
}
.doc .short {
  margin-top: 30px;
  padding: 18px 20px;
  border-radius: 8px;
  background: var(--band);
}
.doc .short p:last-child {
  margin-bottom: 0;
}
.mail {
  font: 700 clamp(24px, 3vw, 32px)/1.2 var(--sign);
  letter-spacing: 0.6px;
  color: var(--attention);
  text-decoration-color: var(--attention);
}

/* A tablet stands the signs two by two; a phone stands them one under another, as roadside signs. */

/* A tablet keeps the gantry, as the app does on an iPad: the same four signs, set smaller. Below 820 wide the
   longest legend ("Surface water 1,031") no longer fits a quarter of the road, so the signs stand as roadside signs. */
@media (min-width: 820px) and (max-width: 960px) {
  .gantry {
    column-gap: 10px;
  }
  .panel.sign {
    padding: 14px 14px 16px;
  }
  .panel.sign .dest {
    font-size: 30px;
    white-space: nowrap;
  }
  .panel.sign .topic {
    font-size: 12px;
    letter-spacing: 1.2px;
  }
  .legends {
    font-size: 14px;
    letter-spacing: 0.4px;
  }
  .legends li {
    gap: 6px;
  }
  .legends .long {
    display: none;
  }
  .legends .short {
    display: inline;
  }
  .lane {
    padding: 12px 12px;
  }
  .lane b {
    font-size: 15px;
  }
  .lane span {
    font-size: 13px;
  }
  .split {
    grid-template-columns: 1fr;
  }
}

/* Under 820 wide the gantry gives way to roadside signs, two side by side, each with its lane, so no sign stretches
   wider than a roadside sign would; a phone stands them one under another. */
@media (max-width: 819px) {
  .frame {
    padding: 0;
  }
  .frame::before,
  .frame::after,
  .truss,
  .hooks,
  .arrow {
    display: none;
  }
  .gantry {
    grid-template-columns: 1fr 1fr;
    row-gap: 22px;
  }
  .hang {
    grid-row: auto;
    grid-template-rows: none;
    display: flex;
    flex-direction: column;
  }
  .hang .sign {
    flex: 1;
  }
  .split {
    grid-template-columns: 1fr;
  }
}

/* Under 700 wide, the app's own roadside threshold, the sample question stands in one column with the plaque under
   the bands, as on a phone in the app. */
@media (max-width: 699px) {
  .question {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas:
      "head"
      "bands"
      "plaque";
  }
  .question .choices {
    margin-top: 24px;
  }
  .question .plaque {
    margin-top: 16px;
  }
}

@media (max-width: 600px) {
  .gantry {
    grid-template-columns: 1fr;
  }
  .nav {
    gap: 18px;
  }
  .wordmark {
    font-size: 22px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .bands li {
    padding: 12px 16px;
  }
  .legends.wide li {
    flex-direction: column;
    gap: 2px;
  }
  .legends.wide span {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .plaque[data-arrive] {
    animation: none;
  }
  .choice {
    transition: none;
  }
}
