/* ==========================================================================
   Unlockr - shared styles
   Palette inherited from the iOS app (UnlockrTheme.swift) so web and product
   read as one brand: near-black ink on paper, single indigo accent, deep
   indigo field for emphasis sections.
   ========================================================================== */

:root {
  --ink: #111111;
  --ink-soft: #4a4a4a;
  --muted: #777777;
  --paper: #ffffff;
  --surface: #fafafa;
  --surface-2: #f2f2f2;
  --line: #eaeaea;

  --accent: #5c22b5;
  --accent-soft: #f1ebfb;
  --accent-ink: #ffffff;

  --field: #0f0f26;
  --field-2: #1a0f38;

  /* One radius system, inherited from the app: cards 24, controls 18 */
  --r-card: 24px;
  --r-control: 18px;
  --r-chip: 999px;

  --shell: 1180px;
  --step: clamp(1rem, 0.6rem + 1.6vw, 1.5rem);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f4f4f5;
    --ink-soft: #c4c4c8;
    --muted: #8f8f98;
    --paper: #0c0c10;
    --surface: #131318;
    --surface-2: #1a1a21;
    --line: #26262e;

    --accent: #a983f0;
    --accent-soft: #1d1630;
    --accent-ink: #14091f;

    --field: #0a0a18;
    --field-2: #150c2c;
  }
}

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

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

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--step);
}

.narrow {
  max-width: 760px;
}

/* --------------------------------------------------------------- nav ---- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 68px;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

@media (prefers-reduced-transparency: reduce) {
  .nav {
    background: var(--paper);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark svg {
  width: 22px;
  height: 22px;
  flex: none;
}

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

.nav__links a {
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.nav__links a:hover {
  color: var(--ink);
}

@media (max-width: 720px) {
  .nav__links a.is-optional {
    display: none;
  }
  .nav__links {
    gap: 1.15rem;
  }
}

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 52px;
  padding-inline: 1.6rem;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.18s ease, border-color 0.18s ease;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  background: color-mix(in srgb, var(--ink) 86%, var(--accent));
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn--ghost:hover {
  border-color: var(--ink);
}

.btn--onfield {
  background: var(--paper);
  color: var(--ink);
}

/* -------------------------------------------------------------- type ---- */

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.032em;
  line-height: 1.08;
  font-weight: 600;
}

h1 {
  font-size: clamp(2.4rem, 1.6rem + 3.4vw, 4rem);
}

h2 {
  font-size: clamp(1.85rem, 1.35rem + 2.1vw, 2.85rem);
}

h3 {
  font-size: 1.1875rem;
  line-height: 1.3;
}

p {
  margin: 0;
}

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 56ch;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------------------------------------------------------- sections ---- */

section {
  padding-block: clamp(4rem, 2.5rem + 6vw, 7.5rem);
}

.section-head {
  max-width: 52ch;
  display: grid;
  gap: 1rem;
  margin-bottom: clamp(2.5rem, 1.8rem + 2.6vw, 4rem);
}

/* --------------------------------------------------------------- hero --- */

.hero {
  padding-top: clamp(3rem, 2rem + 3vw, 5.5rem);
  padding-bottom: clamp(3.5rem, 2.4rem + 4vw, 6rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2.5rem, 1.5rem + 4vw, 5rem);
  align-items: center;
}

.hero__copy {
  display: grid;
  gap: 1.6rem;
  justify-items: start;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero__stage {
  width: min(300px, 72vw);
  margin-inline: auto;
}

@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
  .hero__stage {
    width: min(280px, 62vw);
  }
}

/* ----------------------------------------------------------- slideshow -- */
/* Full, uncropped device screenshots. The frame's aspect-ratio matches the
   screenshots exactly (1206:2622), so cover and contain are equivalent and
   nothing is ever cut off. */

.slideshow {
  position: relative;
  aspect-ratio: 1206 / 2622;
  border-radius: 34px;
  overflow: hidden;
  background: linear-gradient(150deg, var(--field), var(--field-2));
  box-shadow: 0 40px 90px -32px rgb(0 0 0 / 0.5);
}

.slideshow__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.slideshow__img.is-active {
  opacity: 1;
}

.slideshow__dots {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.slideshow__dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.4);
  cursor: pointer;
  transition: background-color 0.25s ease, width 0.25s ease;
}

.slideshow__dots button.is-active {
  width: 18px;
  background: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  .slideshow__img {
    transition: none;
  }
}

/* ------------------------------------------------------------- stat ----- */

.statement {
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.statement__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: end;
}

.statement__figure {
  font-size: clamp(3.5rem, 2rem + 7vw, 6.5rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.92;
  color: var(--accent);
}

.statement__note {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 1rem;
  max-width: 44ch;
}

@media (max-width: 820px) {
  .statement__grid {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

/* --------------------------------------------------------------- flow --- */

.flow {
  display: grid;
  gap: 0;
  counter-reset: step;
}

.flow__item {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: clamp(1.25rem, 0.8rem + 1.6vw, 2.25rem);
  padding-block: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem);
  border-top: 1px solid var(--line);
}

.flow__item:last-child {
  border-bottom: 1px solid var(--line);
}

.flow__num {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--accent);
  padding-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.flow__body {
  display: grid;
  gap: 0.6rem;
  max-width: 62ch;
}

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

/* -------------------------------------------------------------- bento --- */

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

.tile {
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: clamp(1.4rem, 1rem + 1.2vw, 2rem);
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.tile p {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.tile--wide {
  grid-column: span 4;
}

.tile--half {
  grid-column: span 3;
}

.tile--third {
  grid-column: span 2;
}

.tile--field {
  background: linear-gradient(155deg, var(--field), var(--field-2));
  border-color: transparent;
  color: #fff;
}

.tile--field p {
  color: rgb(255 255 255 / 0.72);
}

.tile--accent {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

.tile__icon {
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.tile--field .tile__icon {
  color: #fff;
}

@media (max-width: 900px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }
  .tile--wide,
  .tile--half,
  .tile--third {
    grid-column: span 2;
  }
}

/* --------------------------------------------------------- challenges --- */

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.rail > * {
  scroll-snap-align: start;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 1.5rem;
  display: grid;
  gap: 0.55rem;
  align-content: start;
  background: var(--paper);
}

.card__kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.card p {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

/* -------------------------------------------------------------- field --- */

.field {
  background: linear-gradient(160deg, var(--field), var(--field-2));
  color: #fff;
  border-radius: var(--r-card);
  padding: clamp(2.25rem, 1.5rem + 3vw, 4rem);
}

.field h2 {
  color: #fff;
}

.field .lede {
  color: rgb(255 255 255 / 0.68);
}

.privacy-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.5rem 2rem;
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.14);
}

.privacy-points div {
  display: grid;
  gap: 0.45rem;
}

.privacy-points h3 {
  color: #fff;
  font-size: 1rem;
}

.privacy-points p {
  color: rgb(255 255 255 / 0.66);
  font-size: 0.9375rem;
}

/* ---------------------------------------------------------- closing ----- */

.closing {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 1.5rem;
}

.closing .lede {
  max-width: 46ch;
}

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

.footer {
  border-top: 1px solid var(--line);
  padding-block: 2.75rem 3.25rem;
  font-size: 0.9375rem;
}

.footer__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

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

.footer__note {
  color: var(--muted);
}

/* ----------------------------------------------------------- article --- */
/* Legal and support pages: quiet, readable, low variance. */

.doc {
  padding-block: clamp(3rem, 2rem + 3vw, 4.5rem) clamp(4rem, 3rem + 4vw, 6rem);
}

.doc__head {
  display: grid;
  gap: 0.9rem;
  padding-bottom: 2rem;
  margin-bottom: 2.75rem;
  border-bottom: 1px solid var(--line);
}

.doc__updated {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.doc__body {
  display: grid;
  gap: 2.25rem;
  max-width: 68ch;
}

.doc__body h2 {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
}

.doc__body h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.5rem;
}

.doc__body p,
.doc__body li {
  color: var(--ink-soft);
}

.doc__body p + p {
  margin-top: 0.9rem;
}

.doc__body ul {
  margin: 0.9rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.55rem;
}

.doc__body a {
  color: var(--accent);
  text-underline-offset: 3px;
}

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-control) var(--r-control) 0;
  background: var(--surface);
  padding: 1.25rem 1.5rem;
}

.callout p {
  color: var(--ink);
}

.datatable {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
}

.datatable__row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: 1rem 1.5rem;
  padding: 1.15rem 1.35rem;
}

.datatable__row + .datatable__row {
  border-top: 1px solid var(--line);
}

.datatable__row dt {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9375rem;
}

.datatable__row dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

@media (max-width: 640px) {
  .datatable__row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}

/* -------------------------------------------------------- motion ------- */
/* Entry reveals only. Motivated: establishes reading order on first paint,
   then gets out of the way. Nothing loops. */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.reveal[data-delay="1"] { animation-delay: 0.07s; }
.reveal[data-delay="2"] { animation-delay: 0.14s; }
.reveal[data-delay="3"] { animation-delay: 0.21s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* Scroll-driven reveal for below-the-fold sections, native CSS, no JS. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .on-scroll {
      opacity: 0;
      transform: translateY(22px);
      animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
      animation-timeline: view();
      animation-range: entry 8% cover 26%;
    }
  }
}

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