/* Half Decent website. Plain CSS, no build step. Colours and type follow the posters. */

@font-face {
  font-family: "Half Decent Sans";
  src: url("fonts/half-decent-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Half Decent Sans";
  src: url("fonts/half-decent-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Commit Mono";
  src: url("fonts/commit-mono-latin-500-subset.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #e8e4dc;
  --ink: #151515;
  --text: #151515;
  --muted: #5f5a53;
  --soft: #7d776e;
  --red: #d9381e;
  --rule: rgba(21, 21, 21, 0.16);
  --band: #151515;
  --band-text: #ece8e0;
  --band-muted: #a39e95;
  --band-rule: rgba(236, 232, 224, 0.16);
  --fill-bg: rgba(217, 56, 30, 0.1);
  --sans: "Half Decent Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Commit Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pad: clamp(20px, 5.4vw, 64px);
  --wide: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1d1c1a;
    --text: #ece8e0;
    --muted: #b0aba2;
    --soft: #8f8a81;
    --red: #ef5a40;
    --rule: rgba(236, 232, 224, 0.16);
    --band: #0e0e0e;
    --fill-bg: rgba(239, 90, 64, 0.16);
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}
a:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip:focus {
  left: var(--pad);
  top: 12px;
  background: var(--band);
  color: var(--band-text);
  padding: 8px 12px;
  z-index: 10;
}

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

/* Small capitals in mono, as on the posters' header rows and split labels. */
.label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* The header row, laid out like a poster's: a name on the left, a detail on the right. */
.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-top: clamp(28px, 6vw, 56px);
}
.top .label {
  margin: 0;
}
.top .sub {
  color: var(--muted);
}
.top a {
  text-decoration: none;
}
.top a:hover {
  text-decoration: underline;
}
.top nav {
  text-align: right;
}

/* The headline: two lines, the second softer, set tight like the posters. */
.headline {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(2.5rem, 10.4vw, 6.25rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: clamp(28px, 7vw, 72px) 0 0;
  text-wrap: balance;
}
.headline span {
  display: block;
}
.headline .soft {
  color: var(--soft);
}

.lede {
  font-size: clamp(1.0625rem, 2.2vw, 1.3125rem);
  line-height: 1.45;
  max-width: 34em;
  margin: clamp(18px, 3vw, 28px) 0 0;
  color: var(--text);
}

/* The one place an App Store link drops in at launch. */
.store {
  margin: clamp(20px, 3.4vw, 32px) 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.store .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  flex: none;
}

/* The hill that rises into the dark band, with the red turn dot at the top. */
.hill {
  position: relative;
  height: clamp(56px, 11vw, 132px);
  margin-top: clamp(24px, 5vw, 56px);
}
.hill svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--band);
}
.hill .turn {
  position: absolute;
  left: 61.2%;
  top: 2%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--red);
}

.band {
  background: var(--band);
  color: var(--band-text);
  margin-top: -1px;
}
.band .label,
.band .muted {
  color: var(--band-muted);
}
.band a:focus-visible {
  outline-color: var(--band-text);
}

/* Sample posters. A row that scrolls sideways on a phone and sits in a line on a laptop. */
.posters {
  list-style: none;
  margin: 0;
  padding: 8px var(--pad) 4px;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--pad);
  scrollbar-width: none;
  max-width: calc(var(--wide) + 2 * var(--pad));
  margin-inline: auto;
}
.posters::-webkit-scrollbar {
  display: none;
}
.posters li {
  flex: 0 0 min(66vw, 300px);
  scroll-snap-align: start;
  margin: 0;
}
.posters img {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  background: #e8e4dc;
}
.posters .label {
  display: block;
  margin-top: 12px;
}
.posters .label b {
  font-weight: 500;
  color: var(--band-text);
}
.posters::after {
  content: "";
  flex: 0 0 1px;
}
.samples-note {
  margin-top: 18px;
  margin-bottom: 0;
}

@media (min-width: 900px) {
  .posters {
    justify-content: center;
    gap: clamp(28px, 3.4vw, 48px);
    overflow: visible;
  }
  .posters li {
    flex: 0 1 300px;
  }
  .posters li:nth-child(2) {
    margin-top: -48px;
  }
  .posters::after {
    display: none;
  }
  .samples-note {
    text-align: center;
  }
}

/* Numbered steps and house rules, set on the dark band like the bottom of a poster. */
.section {
  padding-top: clamp(64px, 10vw, 128px);
}
.section > .label {
  margin: 0 0 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--band-rule);
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.steps li {
  display: grid;
  grid-template-columns: 3.2em 1fr;
  gap: 0 12px;
  padding: 22px 0;
  border-bottom: 1px solid var(--band-rule);
}
.steps .n {
  grid-row: 1 / span 2;
  padding-top: 0.5em;
}
.steps h3 {
  font-weight: 500;
  font-size: clamp(1.5rem, 4.4vw, 2.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0;
}
.steps p {
  margin: 8px 0 0;
  color: var(--band-muted);
  max-width: 34em;
}

@media (min-width: 900px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 0 clamp(28px, 3.4vw, 48px);
  }
  .steps li {
    grid-template-columns: 1fr;
    align-content: start;
    border-bottom: 0;
    padding: 20px 0 0;
  }
  .steps .n {
    grid-row: auto;
    padding: 0 0 14px;
  }
}

.more {
  margin: 28px 0 0;
}

/* Footer: the business name, the contact line and the Mark in the corner, as on a poster. */
.foot {
  padding-top: clamp(72px, 11vw, 140px);
  padding-bottom: clamp(28px, 5vw, 48px);
}
.foot .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px 32px;
  border-top: 1px solid var(--band-rule);
  padding-top: 20px;
}
.foot p {
  margin: 0;
}
.foot .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.foot .mark {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--band-muted);
}

/* Privacy page: a reading column on paper. */
.doc {
  max-width: 40rem;
  padding-bottom: clamp(56px, 9vw, 112px);
}
.doc .stamp {
  color: var(--muted);
  margin: 20px 0 0;
}
.doc h2 {
  font-weight: 500;
  font-size: clamp(1.5rem, 4.2vw, 2rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: clamp(48px, 7vw, 72px) 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.doc h2 .label {
  display: block;
  color: var(--muted);
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}
.doc h3 {
  font-weight: 500;
  font-size: 1.1875rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 28px 0 0;
}
.doc p,
.doc ul {
  margin: 14px 0 0;
}
.doc ul {
  padding-left: 1.2em;
}
.doc li {
  margin: 6px 0 0;
  padding-left: 0.2em;
}
.doc li::marker {
  color: var(--soft);
}
.short {
  list-style: none;
  padding: 0 !important;
  margin-top: 28px !important;
  border-top: 1px solid var(--rule);
}
.short li {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.short b {
  font-weight: 500;
}

/* A gap to fill before this page goes live. Easy to find: search the file for class="fill". */
.fill {
  background: var(--fill-bg);
  color: inherit;
  border-bottom: 1px dashed var(--red);
  padding: 0 3px;
  border-radius: 2px;
}

.contact {
  font-size: clamp(1.25rem, 4vw, 1.625rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-top: 16px !important;
}

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

.band-title {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 8px;
  padding-bottom: 20px;
}

.short li:last-child {
  border-bottom: 0;
}

/* A footer that starts its own dark band, so it needs no gap or rule above it. */
.foot-short {
  padding-top: clamp(28px, 5vw, 48px);
}
.foot-short .row {
  border-top: 0;
  padding-top: 0;
}

.links a[href^="mailto:"] {
  text-transform: none;
  letter-spacing: 0.04em;
}
