/*
  Sale Switch — marketing site.

  Organising idea: midnight and teal mean "the sale is on", paper means normal
  trading. The page runs dark while it is showing you a live sale, then turns
  to paper for everything that happens once the sale is over. Colour carries
  state; it is never decoration.

  Layout: every section spans the viewport and owns its background; the .wrap
  inside holds content to a readable width.
*/

:root {
  --midnight: #0e1b2a;
  --midnight-lift: #16273a;
  --teal: #00c2b8;
  --deep-teal: #0a8a83;
  --paper: #eef0f4;
  --amber: #f5b000;
  --white: #f7f8fa;

  --ink: var(--midnight);
  --ink-soft: #4a5867;
  --ink-dim: #9fb0c2;
  --rule: #d5dae1;
  --rule-dark: #27384c;

  --content: 78rem;
  --measure: 36rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: Antonio, "Arial Narrow", system-ui, sans-serif;
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--deep-teal);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--midnight);
}

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

/* A real timestamp is data, so it is the one thing set in mono. */
time,
.clock {
  font-family: "Space Mono", ui-monospace, "SFMono-Regular", monospace;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

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

/* ------------------------------------------------------------------ header */

.site-header {
  background: var(--midnight);
  border-bottom: 1px solid var(--rule-dark);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 1.1rem;
}

.brand {
  font-family: Antonio, "Arial Narrow", sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.9375rem;
}

.site-nav a {
  color: var(--ink-dim);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--teal);
}

.site-nav .button {
  color: var(--midnight);
}

/* ---------------------------------------------------------------- 1. hero */

.hero {
  background: var(--midnight);
  color: var(--white);
}

.hero .wrap {
  padding-block: clamp(3.5rem, 8vw, 7rem) clamp(2.5rem, 5vw, 4rem);
}

.badge {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--teal);
  border: 1px solid var(--rule-dark);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: clamp(3rem, 8.5vw, 7.5rem);
  max-width: 16ch;
  margin-bottom: 1.75rem;
}

.hero__lede {
  color: #c5cfda;
  max-width: 48ch;
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.375rem);
  margin-bottom: 2.25rem;
}

.actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

/* The sale window, drawn as a time axis across the foot of the hero. */
.axis {
  border-top: 1px solid var(--rule-dark);
  background: var(--midnight);
}

.axis .wrap {
  display: grid;
  gap: 0;
  padding-block: 0;
}

@media (min-width: 48rem) {
  .axis .wrap {
    grid-template-columns: repeat(3, 1fr);
  }
}

.axis__step {
  padding-block: 1.5rem;
  padding-right: 1.5rem;
  border-top: 1px solid var(--rule-dark);
}

@media (min-width: 48rem) {
  .axis__step {
    border-top: 0;
    border-left: 1px solid var(--rule-dark);
    padding-left: 1.5rem;
  }

  .axis__step:first-child {
    border-left: 0;
    padding-left: 0;
  }
}

.axis__step time {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-dim);
  margin-bottom: 0.4rem;
}

.axis__step p {
  font-size: 0.9375rem;
  color: #c5cfda;
}

.axis__step--on {
  color: var(--teal);
}

.axis__step--on time,
.axis__step--on p {
  color: var(--teal);
}

/* ------------------------------------------------------------- 2. the app */

.app {
  background: var(--midnight);
  border-top: 1px solid var(--rule-dark);
}

.app .wrap {
  padding-block: clamp(3rem, 6vw, 5rem) clamp(3.5rem, 8vw, 6rem);
  display: grid;
  gap: 2.5rem clamp(2rem, 5vw, 4rem);
}

@media (min-width: 58rem) {
  .app .wrap {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: center;
  }
}

.app h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--white);
  margin-bottom: 1rem;
}

.app p {
  color: #c5cfda;
  max-width: 38ch;
}

/* A depiction of the app's own sale page, built in markup. */
.panel {
  background: var(--midnight-lift);
  border: 1px solid var(--rule-dark);
  border-radius: 8px;
  overflow: hidden;
}

.panel__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid var(--rule-dark);
}

.panel__title {
  font-weight: 600;
  color: var(--white);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--midnight);
  background: var(--teal);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-weight: 600;
}

.panel__countdown {
  padding: 1.35rem;
  border-bottom: 1px solid var(--rule-dark);
}

.panel__countdown span {
  display: block;
  font-size: 0.8125rem;
  color: var(--ink-dim);
  margin-bottom: 0.3rem;
}

.panel__countdown strong {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--teal);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rows li {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.85rem;
  align-items: baseline;
  padding: 0.9rem 1.35rem;
  border-bottom: 1px solid var(--rule-dark);
  font-size: 0.9375rem;
  color: #c5cfda;
}

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

.rows .tick {
  color: var(--teal);
}

.rows b {
  color: var(--white);
  font-weight: 600;
}

.panel__foot {
  padding: 0.9rem 1.35rem;
  border-top: 1px solid var(--rule-dark);
  font-size: 0.8125rem;
  color: var(--ink-dim);
}

/* ------------------------------------------------------------- 3. switches */

.section {
  border-top: 1px solid var(--rule);
}

.section .wrap {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.section h2 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  max-width: 20ch;
  margin-bottom: 2.5rem;
}

.switches {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 56rem) {
  .switches {
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
  }

  .switch {
    padding-inline: 2.5rem;
    border-left: 1px solid var(--rule);
  }

  .switch:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .switch:last-child {
    padding-right: 0;
  }
}

.switch__state {
  display: block;
  font-size: 0.8125rem;
  color: var(--deep-teal);
  margin-bottom: 0.9rem;
}

.switch__state--optional {
  color: var(--ink-soft);
}

.switch h3 {
  font-size: 1.5rem;
  margin-bottom: 0.65rem;
}

.switch p {
  color: var(--ink-soft);
  max-width: 34ch;
}

/* ------------------------------------------------------------- 4. restore */

.split .wrap {
  display: grid;
  gap: 2rem clamp(2rem, 6vw, 5rem);
}

@media (min-width: 56rem) {
  .split .wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: start;
  }

  .split h2 {
    margin-bottom: 0;
  }
}

.restore {
  display: grid;
  gap: 1.5rem;
}

.restore p {
  max-width: 52ch;
}

.flag {
  border-left: 3px solid var(--amber);
  padding-left: 1.25rem;
}

/* ------------------------------------------------------------- 5. pricing */

.pricing {
  background: var(--white);
}

.price {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.price__figure {
  font-family: Antonio, "Arial Narrow", sans-serif;
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  font-weight: 600;
  line-height: 1;
}

.price__terms {
  color: var(--ink-soft);
}

.includes {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.7rem;
  max-width: 44ch;
}

.includes li {
  padding-left: 1.6rem;
  position: relative;
}

.includes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.65rem;
  height: 2px;
  background: var(--teal);
}

.note {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  max-width: 48ch;
}

.hero .note,
.app .note {
  color: var(--ink-dim);
}

/* ------------------------------------------------------------------ button */

.button {
  display: inline-block;
  background: var(--teal);
  color: var(--midnight);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
  padding: 0.9rem 1.75rem;
  border-radius: 4px;
}

.button:hover {
  background: var(--white);
  color: var(--midnight);
}

.button--ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--rule-dark);
}

.button--ghost:hover {
  background: var(--midnight-lift);
  color: var(--white);
  border-color: var(--teal);
}

.button--onpaper {
  background: var(--midnight);
  color: var(--white);
}

.button--onpaper:hover {
  background: var(--deep-teal);
  color: var(--white);
}

.site-nav .button {
  padding: 0.55rem 1.1rem;
  font-size: 0.9375rem;
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 2rem 3rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.site-footer nav {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------- prose page */

.prose .wrap {
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3.5rem, 7vw, 6rem);
}

.prose h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 0.75rem;
}

.prose h2 {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 0.85rem;
}

.prose p,
.prose li,
.prose dd {
  max-width: var(--measure);
}

.prose p + p {
  margin-top: 1rem;
}

.prose ul {
  padding-left: 1.1rem;
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0 0;
}

.prose dl {
  margin: 1.25rem 0 0;
  display: grid;
  gap: 1.5rem;
  max-width: var(--measure);
}

.prose dt {
  font-weight: 600;
}

.prose dd {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
}

.updated {
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ narrow */

@media (max-width: 40rem) {
  .site-nav {
    gap: 1.1rem;
  }

  .hero h1 {
    max-width: none;
  }

  .actions .button {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
