/* Drift website styles */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --morning: #eef1f5;      /* page background: pre-dawn sky */
  --paper: #ffffff;        /* raised surfaces */
  --asphalt: #1b1f24;      /* text */
  --slate: #586271;        /* secondary text */
  --hairline: #d6dce4;     /* rules */
  --ultramarine: #2b3be0;  /* accent: actions and the plan */
  --ultramarine-dark: #1f2cb8;
  --ember: #e4572e;        /* heart rate, used only in the chart */

  --wide: 125%;
  --measure: 34rem;
  --page: 70rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

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

body {
  margin: 0;
  background: var(--morning);
  color: var(--asphalt);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-stretch: 100%;
}

a {
  color: var(--ultramarine);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ultramarine-dark);
}

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

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

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.wordmark {
  color: var(--asphalt);
  font-stretch: var(--wide);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark:hover {
  color: var(--asphalt);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 1.75rem);
  font-size: 0.95rem;
}

.site-nav a:not(.button) {
  color: var(--asphalt);
  text-decoration: none;
}

.site-nav a:not(.button):hover {
  color: var(--ultramarine);
}

/* Buttons */

.button {
  display: inline-block;
  padding: 0.8rem 1.35rem;
  border-radius: 999px;
  background: var(--ultramarine);
  color: #fff;
  font-weight: 650;
  font-stretch: 110%;
  text-decoration: none;
  line-height: 1.2;
}

.button:hover {
  background: var(--ultramarine-dark);
  color: #fff;
}

.button-small {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

/* Hero */

.hero {
  padding-top: clamp(2.5rem, 8vw, 6rem);
}

.hero h1 {
  margin: 0;
  max-width: 13ch;
  font-stretch: var(--wide);
  font-weight: 800;
  font-size: clamp(2.5rem, 7.2vw, 5.75rem);
  line-height: 0.97;
  letter-spacing: -0.035em;
}

.lede {
  max-width: var(--measure);
  margin: 1.75rem 0 2rem;
  color: var(--slate);
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  line-height: 1.5;
}

/* The drift chart: the one bold element on the page */

.drift-chart {
  margin: clamp(3rem, 7vw, 5rem) 0 0;
}

.drift-chart svg {
  display: block;
  width: 100%;
  height: clamp(170px, 26vw, 320px);
  overflow: visible;
}

.drift-chart .line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.drift-chart .line-pace {
  stroke: var(--asphalt);
  stroke-width: 2.5;
}

.drift-chart .line-hr {
  stroke: var(--ember);
  stroke-width: 4;
}

@media (prefers-reduced-motion: no-preference) {
  .drift-chart .reveal {
    animation: draw 2.6s cubic-bezier(0.25, 0.8, 0.3, 1) 0.4s both;
  }
}

@keyframes draw {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.drift-chart figcaption {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 0.75rem 2rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
}

.key {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 600;
}

.key::before {
  content: "";
  flex: none;
  width: 1.75rem;
  border-radius: 2px;
}

.key-pace::before {
  height: 2.5px;
  background: var(--asphalt);
}

.key-hr::before {
  height: 4px;
  background: var(--ember);
}

.chart-note {
  grid-column: 1 / -1;
  margin: 0.25rem 0 0;
  max-width: 40rem;
  color: var(--slate);
}

/* Sections */

.section {
  padding-top: clamp(4.5rem, 10vw, 8rem);
}

.section h2 {
  margin: 0 0 2rem;
  font-stretch: var(--wide);
  font-weight: 750;
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

/* What Drift adjusts for */

.factors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
  gap: 0 clamp(2rem, 5vw, 4.5rem);
  margin: 0;
}

.factor {
  padding: 1.5rem 0 1.75rem;
  border-top: 2px solid var(--asphalt);
}

.factor dt {
  margin-bottom: 0.5rem;
  font-stretch: var(--wide);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.factor dd {
  margin: 0;
  max-width: var(--measure);
  color: var(--slate);
}

/* How it works: a real sequence, so it is numbered */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 2.5rem clamp(2rem, 4vw, 3.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  max-width: 22rem;
}

.steps li::before {
  content: counter(step);
  display: block;
  margin-bottom: 0.75rem;
  color: var(--ultramarine);
  font-stretch: var(--wide);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
}

.steps strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1.15rem;
}

.steps span {
  color: var(--slate);
}

/* Beta */

.beta {
  padding-bottom: clamp(4.5rem, 10vw, 8rem);
}

.beta-panel {
  padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: 1.25rem;
  background: var(--paper);
}

.beta-panel h2 {
  margin-bottom: 1rem;
}

.beta-panel p {
  max-width: var(--measure);
  margin: 0 0 1.75rem;
  color: var(--slate);
}

/* Footer */

.site-footer {
  padding-bottom: 3rem;
  color: var(--slate);
  font-size: 0.92rem;
}

.footer-inner {
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
}

.site-footer p {
  margin: 0 0 0.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0 1.5rem;
}

.fineprint {
  font-size: 0.82rem;
}

/* Privacy policy */

.policy {
  max-width: 42rem;
  padding-top: clamp(2rem, 6vw, 4rem);
  padding-bottom: clamp(4rem, 8vw, 6rem);
}

.policy h1 {
  margin: 0 0 0.5rem;
  font-stretch: var(--wide);
  font-weight: 800;
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.policy .effective {
  margin: 0 0 2.5rem;
  color: var(--slate);
}

.policy h2 {
  margin: 2.75rem 0 0.75rem;
  font-stretch: 112%;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.policy p,
.policy li {
  max-width: 40rem;
}

.policy ul {
  padding-left: 1.25rem;
}

.policy li {
  margin-bottom: 0.5rem;
}

.policy li ul {
  margin-top: 0.5rem;
}

.table-scroll {
  overflow-x: auto;
  margin: 1.25rem 0;
  border-radius: 0.75rem;
  background: var(--paper);
}

.policy table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.93rem;
  line-height: 1.45;
}

.policy th,
.policy td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}

.policy th {
  font-weight: 650;
}

.policy tr:last-child td {
  border-bottom: 0;
}

/* Small screens */

@media (max-width: 34rem) {
  .site-nav a.nav-optional {
    display: none;
  }
}

@media (max-width: 40rem) {
  .policy table {
    min-width: 0;
  }

  .policy thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .policy tr {
    display: block;
    padding: 1rem;
    border-bottom: 1px solid var(--hairline);
  }

  .policy tr:last-child {
    border-bottom: 0;
  }

  .policy td {
    display: block;
    padding: 0 0 0.6rem;
    border: 0;
  }

  .policy td:last-child {
    padding-bottom: 0;
  }

  .policy td:first-child {
    font-weight: 650;
  }

  .policy td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    color: var(--slate);
    font-size: 0.8rem;
  }
}
