/* Wayangle public site. The Trade Catalogue.
   Coated white stock, black ink, three flat spot colours. No shadows, radii or gradients. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --stock: #fbfbf8;
  --paper: #ffffff;
  --ink: #101010;
  --blue: #1638d6;
  --orange: #ff5a1f;
  --yellow: #ffd400;

  --run: 54px;
  --tabs: 84px;
  --strip: 0px;
  --gutter: clamp(20px, 2.8vw, 40px);
  --col-gap: 28px;
  --rule: 2px;
  --rule-heavy: 6px;

  --font: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --fg: var(--ink);
  --bg: var(--stock);
}

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

html {
  scrollbar-color: var(--ink) var(--stock);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0 var(--tabs) 0 0;
  background: var(--stock);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  font-stretch: 100%;
  font-kerning: normal;
}

::selection {
  background: var(--ink);
  color: var(--yellow);
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
blockquote,
table {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

.display {
  font-stretch: 62%;
  font-weight: 800;
  line-height: 0.9;
  text-transform: uppercase;
  text-wrap: balance;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--fg);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 50;
  padding: 12px 16px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
}

.skip:focus {
  top: 8px;
}

/* Running head */

.run {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--run);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-inline: var(--gutter);
  background: var(--ink);
  color: var(--stock);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  --fg: var(--stock);
}

.run__name {
  font-weight: 800;
  letter-spacing: 0.2em;
  text-decoration: none;
}

/* Thumb-index tabs */

.tabs {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: var(--tabs);
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  background: var(--ink);
}

.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  writing-mode: vertical-rl;
  rotate: 180deg;
  border-right: var(--rule) solid var(--ink);
  border-top: var(--rule) solid var(--ink);
  background: var(--tab, var(--stock));
  color: var(--tab-fg, var(--ink));
  font-stretch: 62%;
  font-weight: 800;
  font-size: clamp(14px, 2.35vh, 22px);
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.tab:first-child {
  border-top: 0;
}

.tab b {
  font-weight: inherit;
}

.tab b::after {
  content: " ·";
}

.tab--problem,
.tab--contact {
  --tab: var(--orange);
}

.tab--how {
  --tab: var(--yellow);
}

.tab--plan {
  --tab: var(--blue);
  --tab-fg: var(--paper);
}

.tab[aria-current="true"] {
  background: var(--ink);
  color: var(--stock);
}

.tab:focus-visible {
  outline-color: currentColor;
  outline-offset: -8px;
}

/* Sections */

.sec {
  --fg: var(--ink);
  position: relative;
  padding: clamp(56px, 8vw, 112px) var(--gutter);
  border-top: var(--rule) solid var(--ink);
  background: var(--bg);
  color: var(--fg);
  scroll-margin-top: calc(var(--run) + var(--strip));
}

.sec--problem,
.sec--contact {
  --bg: var(--orange);
}

.sec--how {
  --bg: var(--yellow);
}

.sec--plan {
  --bg: var(--blue);
  --fg: var(--paper);
}

.sec__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--col-gap);
  align-items: end;
}

.sec__title {
  grid-column: 1 / span 7;
  font-size: clamp(40px, 6vw, 88px);
}

.sec__body {
  grid-column: 9 / span 4;
  display: grid;
  gap: 1em;
  font-size: 18px;
}

.sec__grid--lower {
  align-items: start;
  margin-top: clamp(48px, 6vw, 88px);
}

.sec__grid--lower > div {
  grid-column: span 6;
  border-top: var(--rule-heavy) solid var(--fg);
  padding-top: 12px;
}

.sub {
  font-size: 30px;
  margin-bottom: 12px;
}

.note {
  font-size: 13px;
  line-height: 1.4;
}

.label,
.keeps dt,
.facts dt,
.table thead th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* A. Rate card */

.sec--rate {
  padding: 0;
  border-top: 0;
}

.rate__head {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 330px);
  column-gap: var(--col-gap);
  align-items: end;
  padding: 26px var(--gutter) 20px;
}

.rate__head h1 {
  font-size: clamp(44px, min(6.4vw, 10.2vh), 92px);
}

.lede {
  font-size: 16px;
  line-height: 1.4;
  padding-bottom: 6px;
}

.band {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: var(--col-gap);
  align-items: center;
  /* Height-aware: the two bands take what the head and the foot leave, so the
     coupon button stays above the fold on laptop screens. */
  min-height: clamp(112px, min(14.6vw, calc(40.8vh - 186px)), 211px);
  padding-inline: var(--gutter);
  border-top: var(--rule) solid var(--ink);
  overflow: hidden;
}

.band--market {
  background: var(--yellow);
}

.band--way {
  background: var(--blue);
  color: var(--paper);
  border-bottom: var(--rule) solid var(--ink);
}

.band__who {
  padding-block: 10px;
}

.band__who h2 {
  font-size: clamp(26px, 3.2vw, 46px);
  line-height: 0.95;
}

.band__who p {
  margin-top: 10px;
  max-width: 36ch;
  font-size: 16px;
  line-height: 1.4;
}

.band__rate {
  font-size: clamp(84px, min(16vw, calc(45.3vh - 207px)), 232px);
  line-height: 0.8;
  padding-top: 0.1em;
}

.rate__foot {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  column-gap: var(--col-gap);
  padding: 20px var(--gutter) 16px;
}

.entry {
  border-top: var(--rule-heavy) solid var(--ink);
  padding-top: 12px;
}

.entry h3 {
  font-size: 30px;
}

.entry output {
  font-variant-numeric: tabular-nums;
}

.entry--calc .label {
  display: block;
  margin-top: 10px;
}

.keeps {
  display: grid;
  margin-top: 6px;
}

.keeps > div {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--ink);
}

.keeps dd {
  font-size: 16px;
}

.keeps b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.entry--calc .note {
  margin-top: 6px;
}

.facts {
  display: grid;
  margin-top: 10px;
}

.facts > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  column-gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--fg);
  font-size: 15px;
  line-height: 1.4;
}

/* Range control */

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 28px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--ink);
}

input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--ink);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -10px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--orange);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--orange);
}

input[type="range"]:focus-visible {
  outline-offset: 2px;
}

@media (pointer: coarse) {
  input[type="range"] {
    height: 44px;
  }

  input[type="range"]::-webkit-slider-thumb {
    width: 30px;
    height: 30px;
    margin-top: -14px;
  }

  input[type="range"]::-moz-range-thumb {
    width: 26px;
    height: 26px;
  }
}

/* Coupons and buttons */

.coupon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 2px dashed var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  --fg: var(--ink);
}

.coupon__to {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.button {
  display: block;
  padding: 17px 12px 13px;
  border: 2px solid var(--ink);
  background: var(--orange);
  color: var(--ink);
  font-size: 30px;
  text-align: center;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 120ms ease, color 120ms ease;
}

.rate__foot .button {
  font-size: clamp(20px, 1.8vw, 26px);
}

.button--ink {
  background: var(--ink);
  color: var(--stock);
}

.button:active {
  transform: scale(0.97);
}

/* Tables */

.table {
  width: 100%;
  margin-top: clamp(40px, 5vw, 72px);
  border-collapse: collapse;
  font-size: 17px;
  line-height: 1.4;
}

.table caption {
  padding-bottom: 14px;
  font-stretch: 62%;
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  text-align: left;
  text-transform: uppercase;
}

.table th,
.table td {
  padding: 14px 20px 14px 0;
  border-bottom: 1px solid var(--fg);
  text-align: left;
  vertical-align: top;
}

.table th:last-child,
.table td:last-child {
  padding-right: 0;
}

.table thead th {
  border-top: var(--rule-heavy) solid var(--fg);
  border-bottom-width: var(--rule);
}

.table tbody th {
  font-weight: 700;
  white-space: nowrap;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* C. How it works */

.steps,
.stages {
  display: grid;
  column-gap: var(--col-gap);
  row-gap: 32px;
  margin-top: clamp(40px, 5vw, 72px);
  counter-reset: step;
}

.steps {
  grid-template-columns: repeat(3, 1fr);
}

.stages {
  grid-template-columns: 1fr;
  row-gap: 0;
  border-bottom: var(--rule) solid var(--fg);
}

.stages li {
  display: grid;
  grid-template-columns: 88px minmax(0, 5fr) minmax(0, 6fr);
  column-gap: var(--col-gap);
  align-items: baseline;
  padding: 14px 0 16px;
  border-top-width: var(--rule);
}

.stages li::before {
  font-size: 46px;
}

.stages h3,
.stages p {
  margin-top: 0;
}

.stages h3 {
  font-size: clamp(30px, 3.2vw, 46px);
}

.stages p {
  max-width: 46ch;
}

.steps li,
.stages li {
  counter-increment: step;
  border-top: var(--rule-heavy) solid var(--fg);
  padding-top: 12px;
}

.steps li::before,
.stages li::before {
  content: counter(step);
  display: block;
  font-stretch: 62%;
  font-weight: 800;
  font-size: 64px;
  line-height: 0.9;
}

.steps h3,
.stages h3 {
  margin-top: 10px;
  font-size: 30px;
}

.steps p,
.stages p {
  margin-top: 8px;
  max-width: 38ch;
}

.specimen {
  margin-top: clamp(40px, 5vw, 72px);
  padding: 24px 24px 20px;
  border: var(--rule) solid var(--ink);
  background: var(--paper);
}

.table--specimen {
  margin-top: 0;
}

.table--specimen .is-chosen th,
.table--specimen .is-chosen td {
  background: var(--ink);
  color: var(--stock);
  border-bottom-color: var(--ink);
}

.table--specimen .is-chosen th {
  padding-left: 12px;
}

.table--specimen .is-chosen td:last-child {
  padding-right: 12px;
}

.chosen {
  margin-left: 8px;
  padding: 4px 8px 3px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.specimen .note {
  margin-top: 14px;
}

.nots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: clamp(40px, 5vw, 72px);
  border-top: var(--rule) solid var(--ink);
  border-bottom: var(--rule) solid var(--ink);
  font-stretch: 62%;
  font-weight: 800;
  font-size: clamp(26px, 2.6vw, 38px);
  line-height: 1;
  text-transform: uppercase;
}

.nots li {
  padding: 20px 0 16px;
}

.nots li + li {
  padding-left: var(--col-gap);
  border-left: var(--rule) solid var(--ink);
}

/* D. The plan */

.truths li {
  padding: 10px 0;
  border-bottom: 1px solid var(--fg);
}

.truths li:first-child {
  padding-top: 0;
}

/* E. Founder */

.sec--founder .sec__grid {
  align-items: start;
}

.sec--founder .sec__title {
  grid-column: 1 / span 6;
  overflow-wrap: anywhere;
}

.sec--founder .sec__body {
  grid-column: 7 / span 6;
}

.quote {
  border-top: var(--rule-heavy) solid var(--ink);
  padding-top: 16px;
}

.quote p {
  font-size: clamp(24px, 2.9vw, 42px);
  font-weight: 500;
  font-stretch: 88%;
  line-height: 1.16;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.facts--wide {
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--col-gap);
  margin-top: clamp(48px, 6vw, 88px);
}

.facts--wide > div {
  grid-template-columns: 150px 1fr;
  padding: 14px 0;
  font-size: 17px;
}

/* F. Contact */

.sec--contact .sec__title {
  max-width: 12ch;
}

.coupons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--col-gap);
  margin-top: clamp(40px, 5vw, 72px);
}

.coupon--large {
  gap: 18px;
  padding: 28px;
  font-size: 18px;
  line-height: 1.45;
}

.coupon--large h3 {
  font-size: 46px;
}

.coupon--large p {
  max-width: 44ch;
}

.colophon {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: var(--col-gap);
  margin-top: clamp(56px, 7vw, 96px);
  border-top: var(--rule) solid var(--ink);
  padding-top: 16px;
  font-size: 14px;
  line-height: 1.5;
}

/* Hover states: drawn, not faded. Pointer devices only. */

@media (hover: hover) and (pointer: fine) {
  .tab:hover {
    background: var(--ink);
    color: var(--stock);
  }

  .button:hover {
    background: var(--ink);
    color: var(--stock);
  }

  .button--ink:hover {
    background: var(--orange);
    color: var(--ink);
  }

  p a:hover,
  td a:hover {
    background: var(--fg);
    color: var(--bg);
    text-decoration-color: transparent;
  }
}

/* The one authored moment: the two rates are printed onto their bands. */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  /* site.js adds .is-blank for one frame, then .is-printing. Without the
     script, or in a tab that is not painting, the numerals simply show. */
  .band__rate.is-blank {
    clip-path: inset(0 0 100% 0);
  }

  .band__rate.is-printing {
    clip-path: inset(0 0 0 0);
    transition: clip-path 900ms var(--ease-out);
  }

  .band--way .band__rate.is-printing {
    transition-delay: 140ms;
  }
}

/* Narrower desktops */

@media (max-width: 1180px) {
  .facts--wide {
    grid-template-columns: 1fr;
  }
}

/* Phones and small tablets: the tabs become a strip under the running head. */

@media (max-width: 899px) {
  :root {
    --run: 44px;
    --strip: 44px;
  }

  body {
    margin-right: 0;
    font-size: 16px;
  }

  .run__edition {
    display: none;
  }

  .run {
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .tabs {
    position: sticky;
    top: var(--run);
    bottom: auto;
    width: auto;
    height: var(--strip);
    grid-template-rows: none;
    grid-template-columns: repeat(6, 1fr);
    border-bottom: var(--rule) solid var(--ink);
  }

  .tab {
    font-size: 22px;
    writing-mode: horizontal-tb;
    rotate: none;
    border-top: 0;
    border-right: 0;
    border-left: var(--rule) solid var(--ink);
  }

  .tab:first-child {
    border-left: 0;
  }

  .tab b::after {
    content: none;
  }

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

  .rate__head {
    grid-template-columns: 1fr;
    row-gap: 12px;
    padding-top: 24px;
  }

  .band {
    grid-template-columns: 1fr;
    align-items: start;
    row-gap: 4px;
    padding-block: 18px 10px;
  }

  .band__rate {
    justify-self: end;
    font-size: min(27vw, 232px);
  }

  .rate__foot,
  .steps,
  .coupons,
  .colophon,
  .nots {
    grid-template-columns: 1fr;
  }

  .rate__foot {
    row-gap: 32px;
    padding-bottom: 28px;
  }

  .stages li {
    grid-template-columns: 44px 1fr;
    row-gap: 6px;
  }

  .stages li::before {
    grid-row: span 2;
    font-size: 36px;
  }

  .keeps > div {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }

  .keeps dd {
    font-size: 18px;
  }

  .rate__foot .coupon {
    grid-column: auto;
  }

  .colophon {
    row-gap: 10px;
  }

  .nots li + li {
    padding-left: 0;
    border-left: 0;
    border-top: var(--rule) solid var(--ink);
  }

  .sec__grid {
    grid-template-columns: 1fr;
    row-gap: 20px;
  }

  .sec__title,
  .sec__body,
  .sec--founder .sec__title,
  .sec--founder .sec__body,
  .sec__grid--lower > div {
    grid-column: 1 / -1;
  }

  .sec__grid--lower {
    row-gap: 36px;
  }

  .facts--wide > div {
    grid-template-columns: 130px 1fr;
  }

  .coupon--large {
    padding: 20px;
  }

  .coupon--large h3 {
    font-size: 36px;
  }

  .button,
  .rate__foot .button {
    font-size: 26px;
  }

  /* Tables become stacked entries. */

  .table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .table,
  .table tbody,
  .table tr,
  .table th,
  .table td {
    display: block;
  }

  .table tr {
    padding: 12px 0;
    border-top: var(--rule) solid var(--fg);
  }

  .table tbody th,
  .table td {
    padding: 3px 0;
    border-bottom: 0;
    white-space: normal;
  }

  .table caption {
    display: block;
    font-size: 26px;
    text-wrap: wrap;
  }

  .table td[data-label] {
    padding-top: 8px;
  }

  .table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.4;
    text-transform: uppercase;
  }

  .table--specimen td[data-label] {
    display: grid;
    grid-template-columns: 130px 1fr;
    column-gap: 12px;
    align-items: baseline;
    padding-top: 3px;
  }

  .table .num {
    text-align: left;
  }

  .specimen {
    padding: 16px;
  }

  .table--specimen .is-chosen {
    margin-inline: -16px;
    padding-inline: 16px;
    background: var(--ink);
    color: var(--stock);
  }

  .table--specimen .is-chosen th,
  .table--specimen .is-chosen td:last-child {
    padding-inline: 0;
  }
}
