/*
  Latch website — shared styles.
  Plain CSS, no build step. Colours are the app's own tokens
  (Latch/Assets.xcassets): dark by default, the app's light palette when
  the visitor's system is light. The block-screen demo stays dark in both,
  because the real iOS block screen does.
*/

:root {
  color-scheme: dark light;

  --ink: #0D1417;
  --ink-2: #151F23;
  --ink-3: #1E2C31;
  --ink-4: #2A3B41;
  --bone: #F1EEE8;
  --bone-2: #A5B3B4;
  --ember: #E88C4D;
  --sage: #94B489;

  /* The block screen is always dark. */
  --shield-ink: #0D1417;
  --shield-bone: #F1EEE8;
  --shield-bone-2: #A5B3B4;

  --display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 48px);
}

@media (prefers-color-scheme: light) {
  :root {
    --ink: #F5F4F0;
    --ink-2: #FFFFFF;
    --ink-3: #E9E9E3;
    --ink-4: #D6D7D0;
    --bone: #0F191B;
    --bone-2: #5B6769;
    --ember: #A74E26;
    --sage: #497144;
  }
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font: 400 1.125rem/1.55 var(--text);
}

svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  color: var(--bone);
}

h1 {
  font-weight: 700;
  font-size: clamp(2.5rem, 6.2vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

h2 {
  font-weight: 700;
  font-size: clamp(1.75rem, 3.4vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h3 {
  font-weight: 600;
  font-size: 1.3125rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--bone);
  color: var(--ink);
}

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */

.site-header {
  padding-block: 22px;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 700 1.375rem/1 var(--display);
  letter-spacing: -0.02em;
}

.brand svg {
  width: 32px;
  height: 32px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 0.9375rem;
}

.nav a {
  color: var(--bone-2);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--bone);
}

/* The mark: the one piece of motion on the site */

.mark-bar,
.mark-pin {
  transform-box: fill-box;
}

.mark-bar {
  transform-origin: left center;
}

.hero-mark .mark-bar {
  animation: mark-bar 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both;
}

.hero-mark .mark-pin {
  animation: mark-pin 0.55s cubic-bezier(0.3, 1.45, 0.5, 1) 0.6s both;
}

@keyframes mark-bar {
  from { transform: scaleX(0.2); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes mark-pin {
  from { transform: translateY(-40%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mark .mark-bar,
  .hero-mark .mark-pin {
    animation: none;
  }
}

/* Hero */

.hero {
  padding-block: clamp(24px, 6vw, 80px) clamp(64px, 9vw, 112px);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(48px, 6vw, 88px);
  align-items: center;
}

.hero-mark {
  width: 84px;
  height: 84px;
  margin-bottom: 32px;
}

.hero h1 {
  max-width: 12ch;
}

.lead {
  margin-top: 24px;
  max-width: 34em;
  font-size: clamp(1.125rem, 1.8vw, 1.3125rem);
  color: var(--bone-2);
}

.hero-facts {
  margin-top: 20px;
  font-size: 0.9375rem;
  color: var(--bone-2);
}

.availability {
  display: inline-block;
  margin-top: 32px;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink-3);
  font-weight: 600;
  font-size: 1rem;
}

/* Block screen demo */

.demo {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.shield {
  width: 100%;
  max-width: 340px;
  min-height: 560px;
  padding: 40px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--shield-ink);
  color: var(--shield-bone);
  border: 1px solid var(--ink-4);
  border-radius: 40px;
}

.emblem {
  width: 104px;
  height: 104px;
  margin-top: 48px;
}

.is-hidden {
  display: none;
}

.shield-title {
  margin-top: 18px;
  font: 700 1.3125rem/1.25 var(--text);
  color: var(--shield-bone);
}

.shield-subtitle {
  margin-top: 10px;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--shield-bone-2);
}

.shield-actions {
  width: 100%;
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shield-primary {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  background: var(--shield-bone);
  color: var(--shield-ink);
  font-weight: 600;
  font-size: 1.0625rem;
}

.shield-secondary {
  min-height: 52px;
  display: flex;
  align-items: center;
  font-weight: 500;
  color: var(--shield-bone);
}

.shield-secondary[hidden] {
  display: flex;
  visibility: hidden;
}

.modes {
  width: 100%;
  max-width: 340px;
  margin: 0;
  padding: 0;
  border: 0;
}

.modes legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 0.9375rem;
  color: var(--bone-2);
}

.segmented {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--ink-3);
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  padding: 9px 6px;
  border-radius: 9px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--bone-2);
  cursor: pointer;
}

.segmented input:checked + label {
  background: var(--bone);
  color: var(--ink);
}

.segmented input:focus-visible + label {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.mode-note {
  width: 100%;
  max-width: 340px;
  min-height: 4.5em;
  font-size: 0.9375rem;
  color: var(--bone-2);
}

.no-js .modes,
.no-js .mode-note {
  display: none;
}

/* Sections */

.section {
  padding-block: clamp(64px, 9vw, 112px);
  border-top: 1px solid var(--ink-3);
}

.section-intro {
  max-width: 40rem;
}

.section-intro p {
  margin-top: 14px;
  color: var(--bone-2);
}

/* A window, start to finish: a real sequence, drawn as the app's timeline rail */

.rail {
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
}

.rail li {
  position: relative;
  padding-top: 36px;
}

.rail li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-4);
  background: var(--ink);
}

.rail li:first-child::before {
  border-color: var(--ember);
  background: var(--ember);
}

.rail li::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 24px;
  right: -20px;
  height: 1.5px;
  background: var(--ink-4);
}

.rail li:last-child::after {
  display: none;
}

.rail h3 {
  font-size: 1.1875rem;
}

.rail p {
  margin-top: 8px;
  font-size: 1rem;
  color: var(--bone-2);
}

/* Ways out */

.pairs {
  margin: 44px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.pairs dt {
  font: 600 1.3125rem/1.25 var(--display);
}

.pairs dd {
  margin: 10px 0 0;
  font-size: 1rem;
  color: var(--bone-2);
}

/* Privacy summary */

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.checks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 18px;
}

.checks li {
  position: relative;
  padding-left: 34px;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.38em;
  width: 16px;
  height: 9px;
  border-left: 2px solid var(--sage);
  border-bottom: 2px solid var(--sage);
  transform: rotate(-45deg);
}

.text-link {
  display: inline-block;
  margin-top: 24px;
  font-weight: 600;
}

/* Pricing */

.table-scroll {
  margin-top: 40px;
  overflow-x: auto;
}

.plans {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.plans th,
.plans td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--ink-3);
  text-align: left;
  vertical-align: top;
}

.plans thead th {
  border-bottom-color: var(--ink-4);
  font: 700 1.3125rem/1.2 var(--display);
}

.plans tbody th {
  width: 40%;
  font-weight: 500;
  color: var(--bone-2);
}

.price-note {
  margin-top: 24px;
  max-width: 46rem;
  font-size: 1rem;
  color: var(--bone-2);
}

.price-note strong {
  font-weight: 600;
  color: var(--bone);
}

/* Legal pages */

.legal {
  padding-block: clamp(24px, 6vw, 72px) clamp(64px, 9vw, 112px);
}

.legal .wrap {
  max-width: calc(44rem + 2 * var(--gutter));
}

.legal h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
}

.updated {
  margin-top: 12px;
  font-size: 0.9375rem;
  color: var(--bone-2);
}

.legal-intro {
  margin-top: 28px;
  font-size: 1.1875rem;
}

.toc {
  margin-top: 36px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--ink-2);
}

.toc h2 {
  font: 600 1rem/1.4 var(--text);
  color: var(--bone-2);
}

.toc ol {
  margin: 10px 0 0;
  padding-left: 1.4em;
  columns: 2;
  column-gap: 32px;
  font-size: 0.9375rem;
}

.toc a {
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

.legal-section {
  margin-top: 48px;
}

.legal-section h2 {
  font-size: 1.5rem;
  scroll-margin-top: 24px;
}

.legal-section p,
.legal-section ul {
  margin-top: 12px;
  color: var(--bone-2);
}

.legal-section ul {
  padding-left: 1.25em;
  display: grid;
  gap: 8px;
}

.legal-section strong {
  font-weight: 600;
  color: var(--bone);
}

/* Footer */

.site-footer {
  padding-block: 36px 48px;
  border-top: 1px solid var(--ink-3);
  font-size: 0.9375rem;
  color: var(--bone-2);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer a {
  color: var(--bone-2);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--bone);
}

/* Narrow screens */

@media (max-width: 860px) {
  .hero .wrap,
  .split {
    grid-template-columns: 1fr;
  }

  .rail {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .rail li {
    padding: 0 0 32px 36px;
  }

  .rail li::before {
    top: 4px;
  }

  .rail li::after {
    top: 26px;
    left: 7px;
    right: auto;
    bottom: 2px;
    width: 1.5px;
    height: auto;
  }

  .pairs {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 600px) {
  .toc ol {
    columns: 1;
  }

  /* Three columns fit a phone once the cells tighten up; a sideways
     scroll inside the page hid the whole Pro column. */
  .plans {
    font-size: 0.9375rem;
  }

  .plans th,
  .plans td {
    padding: 14px 8px;
  }

  .plans th:first-child,
  .plans td:first-child {
    padding-left: 0;
  }

  .plans thead th {
    font-size: 1.125rem;
  }

  .shield {
    min-height: 520px;
  }
}
