/*
 * The site's tokens: the TV brand from docs/design/tv.md (the app at app.tvroutine.com keeps its own palette).
 * Night #000, Walnut #1A120C, Linen #EEE6DA, Ash #A0978C, Candle #F2B661; light mode prints the same timetable on
 * white paper (Walnut ink, Candle only as a fill: as text it is 1.8:1 on white, so links use Ember #8A5410, 6.3:1).
 */
.landing {
  --l-page: #ffffff;
  --l-ink: #1a120c;
  --l-quiet: #625a51;
  --l-rule: rgb(26 18 12 / 14%);
  --l-link: #8a5410;
  --l-candle: #f2b661;
  --l-on-candle: #1a120c;
  --l-screen: #1a120c;
  --l-focus: #8a5410;
  --l-font: Overpass, system-ui, sans-serif;
  --l-measure: 38rem;
  --l-wide: 75rem;
  --l-radius-screen: 14px;
}

@media (prefers-color-scheme: dark) {
  .landing {
    --l-page: #000000;
    --l-ink: #eee6da;
    --l-quiet: #a0978c;
    --l-rule: rgb(238 230 218 / 16%);
    --l-link: #f2b661;
    --l-screen: #1a120c;
    --l-focus: #f2b661;
  }
}

/* The landing page and the site chrome (../DESIGN.md). Scoped under .landing (the body wrapper); colours: tokens.css. */

@font-face {
  font-family: "Overpass";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/overpass-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Overpass";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/overpass-latin-700-normal.woff2") format("woff2");
}

.landing {
  min-height: 100vh;
  overflow-x: clip; /* the now line reaches the page edge */
  background: var(--l-page);
  color: var(--l-ink);
  font-family: var(--l-font);
  font-size: 1.125rem;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  padding: 0 clamp(1.25rem, 5vw, 4rem);
}

.landing > * {
  max-width: var(--l-wide);
  margin-left: auto;
  margin-right: auto;
}

.landing a {
  color: var(--l-link);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.landing a:focus-visible {
  outline: 3px solid var(--l-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.landing h1,
.landing h2,
.landing p,
.landing dl,
.landing dd,
.landing ol,
.landing ul,
.landing figure {
  margin: 0;
}

/* ---- Top bar ---- */

.l-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.5rem;
}

.landing .l-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--l-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.l-mark {
  height: 2.2rem;
  width: auto;
}
.l-mark-rail {
  fill: var(--l-ink);
}
.l-mark-tick {
  fill: var(--l-quiet);
}
.l-mark-now {
  fill: var(--l-candle);
}

.l-top > a:last-child {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}

/* ---- Hero ---- */

.l-hero {
  padding: clamp(1.5rem, 4.5vw, 3.5rem) 0 clamp(2rem, 3.5vw, 2.75rem);
}

.landing h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 14ch;
}

.landing .l-lead {
  max-width: var(--l-measure);
  margin-top: 1.25rem;
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--l-quiet);
}

.l-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.landing .l-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.1rem 1.4rem 0;
  border: 2px solid var(--l-ink);
  border-radius: 10px;
  color: var(--l-ink);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
}

.landing .l-primary {
  background: var(--l-candle);
  border-color: var(--l-candle);
  color: var(--l-on-candle);
}

/* ---- The TV screenshot and the now line that leads into it ---- */

.l-screen {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.l-frame {
  position: relative;
}

.l-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--l-radius-screen);
  background: var(--l-screen);
}

/* From the page's left edge into the TV, ending at the TV's time pill, at the height of the TV's own now line. */
.l-nowline {
  position: absolute;
  left: -50vw;
  top: calc(var(--now-y) * 100%);
  width: calc(50vw + var(--pill-x) * 100% - 4px);
  height: 2px;
  margin-top: -1px;
  background: var(--l-candle);
  transform-origin: left center;
  animation: l-draw 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 250ms both;
}

@keyframes l-draw {
  from {
    transform: scaleX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .l-nowline {
    animation: none;
  }
}

/* ---- Rows: a heading in the left column (like the TV's time column), content on the right ---- */

.l-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  padding: clamp(2.25rem, 5vw, 3.5rem) 0;
  border-top: 1px solid var(--l-rule);
}

.landing h2 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.l-facts {
  display: grid;
  gap: 1.25rem;
  max-width: var(--l-measure);
}

.l-facts dt {
  font-weight: 700;
}

.l-facts dd {
  color: var(--l-quiet);
}

.l-split {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.l-phone img {
  display: block;
  width: min(100%, 17.5rem);
  height: auto;
  border-radius: 1.75rem;
  border: 1px solid var(--l-rule);
}

.l-text {
  display: grid;
  gap: 1.25rem;
  max-width: var(--l-measure);
}

.landing .l-steps {
  display: grid;
  gap: 0.75rem;
  padding-left: 1.6rem;
}

.l-steps li::marker {
  font-weight: 700;
  color: var(--l-ink);
}

.l-steps li {
  padding-left: 0.3rem;
}

.l-note {
  color: var(--l-quiet);
}

.l-soon {
  color: var(--l-quiet);
}

/* ---- Footer ---- */

.l-foot {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--l-rule);
  font-size: 0.95rem;
  color: var(--l-quiet);
}

.l-foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  padding: 0;
  list-style: none;
}

.l-foot li a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.l-foot p {
  margin-top: 0.5rem;
}

/* ---- Wider screens ---- */

/* Headline left, words and buttons right, so the TV (and its now line) starts higher on a laptop screen. */
@media (min-width: 64rem) {
  .l-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: 4rem;
    align-items: end;
  }

  .landing .l-lead {
    margin-top: 0;
  }

  .l-actions {
    margin-top: 1.5rem;
  }
}

@media (min-width: 52rem) {
  .l-row {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 2.5rem;
  }

  .l-split {
    grid-template-columns: minmax(0, 1fr) 17.5rem; /* a fixed track: an auto one sizes to the 2× image's 780 px */
    gap: 3rem;
  }
}

/* Small screens: the TV shot goes edge to edge, so there is no margin for the line to cross. */
@media (max-width: 51.99rem) {
  .l-screen {
    margin-left: calc(-1 * clamp(1.25rem, 5vw, 4rem));
    margin-right: calc(-1 * clamp(1.25rem, 5vw, 4rem));
  }

  .l-frame img {
    border-radius: 0;
  }

  .l-nowline {
    display: none;
  }
}

/* Base for every site page, and the policy pages (main.l-doc): one text column, sections divided by rules. */

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

html,
body {
  margin: 0;
  background: var(--l-page, #fff);
}

.landing .l-doc {
  padding: clamp(1.5rem, 4.5vw, 3.5rem) 0 clamp(2.5rem, 5vw, 4rem);
}

.landing .l-doc > * {
  max-width: var(--l-measure);
}

.landing .l-doc h1 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  max-width: none;
}

.landing .l-doc section {
  display: grid;
  gap: 0.75rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--l-rule);
}

.landing .l-doc section:first-of-type {
  margin-top: 2rem;
}

.landing .l-doc h2 {
  font-size: 1.3rem;
}

.landing .l-doc ul,
.landing .l-doc ol {
  display: grid;
  gap: 0.6rem;
  padding-left: 1.4rem;
}

.landing .l-doc strong {
  font-weight: 700;
}
