/* Okite website. Plain CSS, no build step. Colours and type follow the app (Core/Theme/Theme.swift). */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c0c0e;
  --raised: #171718;
  --text: #f5f5f5;
  --dim: #a6a6a8;
  --faint: #6c6c6f;
  --line: rgba(255, 255, 255, 0.09);
  --blue: #2b6cf0;
  --coral: #f0562e;
  /* New York on Apple devices (same face as the app), Newsreader everywhere else. */
  --serif: ui-serif, "New York", "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 5vw, 56px);
  --wide: 1120px;
}

* { box-sizing: border-box; }

html {
  scroll-padding-top: 24px;
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

.serif {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.012em;
}

.wrap {
  width: 100%;
  max-width: calc(var(--wide) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  padding-top: clamp(18px, 3vw, 30px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.links { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 34px); }

.links a:not(.pill) {
  padding: 8px 0;
  color: var(--dim);
  font-size: 17px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.links a:not(.pill):hover { color: var(--text); }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  background: #f2f2f2;
  color: #0d0d0e;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.25s ease;
}

.pill:hover { background: #fff; transform: translateY(-1px); }

@media (max-width: 820px) {
  .links .pill, .links .wide-only { display: none; }
}

/* ---------- Hero: words and the App Store button on one side, three phones in front of the sun on the other ---------- */

.hero {
  position: relative;
  min-height: max(100svh, 680px);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 96px 0 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
}

.hero-copy { position: relative; z-index: 2; max-width: 520px; }

.hero h1 {
  font-size: clamp(44px, 5.2vw, 76px);
  line-height: 1.03;
  text-wrap: balance;
}

.lede {
  margin-top: 22px;
  max-width: 370px;
  font-size: clamp(18px, 1.5vw, 21px);
  color: var(--dim);
  text-wrap: pretty;
}

.badge {
  display: inline-block;
  margin-top: 34px;
  border-radius: 11px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.badge img { height: 58px; width: auto; }
.badge:hover { transform: translateY(-2px); }
.badge:active { transform: scale(0.98); }

.hero-copy > * { animation: rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-copy > :nth-child(2) { animation-delay: 0.12s; }
.hero-copy > :nth-child(3) { animation-delay: 0.24s; }

.hero-stage {
  position: relative;
  display: flex;
  justify-content: center;
  translate: 7% 0;
}

.fan {
  --w: min(290px, 30svh, 21vw);
  position: relative;
  width: calc(var(--w) * 2.1);
  height: calc(var(--w) * 2.2);
}

.fan .phone {
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: calc(var(--w) * -0.5);
  animation: rise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both;
}

.fan .side {
  z-index: 0;
  filter: brightness(0.78);
  animation-name: fan-left;
  animation-delay: 0.3s;
}

.fan .side.r { animation-name: fan-right; }
.fan .mid { z-index: 1; }

/* The sun sits behind the phones with its horizon near their feet. */
.sun {
  position: absolute;
  left: 50%;
  top: calc(var(--fan-h, 620px) * 0.62);
  width: calc(var(--fan-w, 600px) * 2.7);
  max-width: none;
  translate: -50% -72%;
  z-index: -1;
  animation: dawn 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent);
  mask-image: radial-gradient(closest-side, #000 72%, transparent);
}

.hero-stage { --fan-w: calc(min(290px, 30svh, 21vw) * 2.1); --fan-h: calc(min(290px, 30svh, 21vw) * 2.2); isolation: isolate; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes dawn {
  from { opacity: 0; transform: translateY(6%); }
  to { opacity: 1; transform: none; }
}

@keyframes fan-left {
  from { opacity: 0; transform: translateY(8%) scale(0.86); }
  to { opacity: 1; transform: translate(-58%, 5%) rotate(-8deg) scale(0.86); }
}

@keyframes fan-right {
  from { opacity: 0; transform: translateY(8%) scale(0.86); }
  to { opacity: 1; transform: translate(58%, 5%) rotate(8deg) scale(0.86); }
}

@media (max-width: 820px), (max-aspect-ratio: 1/1) {
  .hero { padding: 104px 0 0; align-items: flex-start; min-height: 0; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }

  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: none;
    text-align: center;
  }

  .hero h1 { font-size: clamp(38px, 10.4vw, 60px); max-width: 12em; }
  .lede { margin-top: 16px; max-width: 19em; }
  .badge { margin-top: 26px; }
  .badge img { height: 54px; }

  .fan { --w: min(250px, 56vw); }
  .hero-stage { --fan-w: calc(min(250px, 56vw) * 2.1); --fan-h: calc(min(250px, 56vw) * 2.2); margin: 0 calc(var(--gutter) * -1); }

  /* Only the top of the phones shows; the rest sinks below the fold of the section. */
  .hero-stage { height: calc(var(--fan-h) * 0.8); translate: none; }

  /* The cut-off phones sink into the dark instead of ending on a hard line. */
  .hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 130px;
    background: linear-gradient(to bottom, rgba(12, 12, 14, 0), var(--bg) 88%);
    z-index: 3;
    pointer-events: none;
  }

}

/* ---------- Tour: one phone that stays put while the words scroll past ---------- */

.tour { position: relative; padding: clamp(40px, 8vw, 96px) 0 0; }

.tour-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
}

.step {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0;
}

.step h2 {
  font-size: clamp(32px, 3.5vw, 50px);
  line-height: 1.08;
  max-width: 11em;
  text-wrap: balance;
}

.step p {
  margin-top: 18px;
  max-width: 25em;
  font-size: clamp(18px, 1.45vw, 20px);
  color: var(--dim);
  text-wrap: pretty;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.missions {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 16px);
  width: 100%;
  max-width: 500px;
  align-items: center;
}

.missions img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.flock { gap: calc(22px * var(--k, 1)); flex-wrap: nowrap; }
.flock img { width: auto; height: calc(var(--h) * var(--k, 1)); }

.tour-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Soft light behind the phone, tinted by the screen that is showing. */
.glow {
  position: absolute;
  width: min(120%, 720px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--tint, rgba(240, 86, 46, 0.34)), transparent);
  transition: background 0.9s ease;
  pointer-events: none;
}

.phone {
  --w: min(330px, 34vh);
  position: relative;
  width: var(--w);
  padding: calc(var(--w) * 0.03);
  border-radius: calc(var(--w) * 0.178);
  background: #050506;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 40px 90px -30px rgba(0, 0, 0, 0.9);
}

.screen {
  position: relative;
  aspect-ratio: 1206 / 2622;
  border-radius: calc(var(--w) * 0.15);
  overflow: hidden;
  background: #0e0e0f;
}

.screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tour-stage .screen img { opacity: 0; transition: opacity 0.6s ease; }
.tour-stage .screen img.on { opacity: 1; }

/* The camera cut-out. */
.screen::after {
  content: "";
  position: absolute;
  top: 1.75%;
  left: 50%;
  width: 31%;
  height: 4.3%;
  border-radius: 999px;
  background: #000;
  transform: translateX(-50%);
}

.step .phone { display: none; }

@media (max-width: 820px) {
  .tour-grid { display: block; }
  .tour-stage { display: none; }

  .step {
    min-height: 0;
    align-items: center;
    padding: 64px 0;
    text-align: center;
  }

  .step p { margin-left: auto; margin-right: auto; }
  .row { justify-content: center; }

  .step .phone {
    --w: min(300px, 76vw);
    display: block;
    margin-top: 44px;
  }

  .flock { --k: 0.84; }
}

/* ---------- Finale: the painted scene, words on the dark side of it ---------- */

.finale {
  position: relative;
  min-height: max(92svh, 600px);
  display: flex;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
}

.finale-art {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.finale-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 100% 50%;
}

/* The art melts into the page at the bottom. */
.finale::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 22%;
  background: linear-gradient(to bottom, rgba(12, 12, 14, 0), var(--bg));
  z-index: -1;
  pointer-events: none;
}

.finale-copy {
  max-width: 540px;
  padding-bottom: 4vh;
}

.finale h2 {
  font-size: clamp(44px, 5.6vw, 78px);
  line-height: 1.03;
  text-wrap: balance;
}

.finale .lede {
  margin-top: 22px;
  max-width: 370px;
  font-size: clamp(18px, 1.5vw, 21px);
  color: var(--dim);
  text-wrap: pretty;
}

.finale .badge { margin-top: 36px; }

/* Phones and upright tablets: the tall painting, words on top, button at the bottom. */
@media (max-width: 820px), (max-aspect-ratio: 1/1) {
  .finale {
    align-items: stretch;
    min-height: max(92svh, 620px);
  }

  .finale-art img {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: auto;
    max-width: none;
    height: 100%;
    object-fit: contain;
    transform-origin: 50% 100%;
    translate: -50% 0;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  }

  .finale::after { height: 12%; }

  .finale .wrap { display: flex; }

  .finale-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: none;
    padding: clamp(64px, 10svh, 110px) 0 clamp(28px, 5svh, 48px);
    text-align: center;
  }

  .finale h2 { font-size: clamp(38px, 10.4vw, 60px); max-width: 12em; }
  .finale .lede { margin-top: 16px; max-width: 19em; }
  .finale-copy > span { margin-top: auto; }
  .finale .badge { margin-top: 0; }
}

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

.foot {
  border-top: 1px solid var(--line);
  padding: 40px 0 44px;
  color: var(--dim);
  font-size: 17px;
  scroll-margin-top: 40vh;
}

.foot .wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 22px 32px;
}

.foot .reach { color: var(--dim); }
.foot .reach a { color: var(--text); text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.3); padding-bottom: 1px; }
.foot .reach a:hover { border-bottom-color: #fff; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.foot nav a { text-decoration: none; padding: 6px 0; }
.foot nav a:hover { color: var(--text); }
.foot .copy { grid-column: 1 / -1; color: var(--faint); font-size: 16px; }

@media (max-width: 640px) {
  .foot .wrap { grid-template-columns: 1fr; }
}

/* ---------- Reveal on scroll (only when the script is running) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Plain pages: privacy, terms, support ---------- */

.doc-top { position: static; padding-bottom: 8px; }

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 84px) var(--gutter) 96px;
}

.doc h1 {
  font-size: clamp(38px, 6vw, 56px);
  line-height: 1.06;
}

.doc .updated { margin-top: 14px; color: var(--dim); }

.doc h2 {
  margin-top: 52px;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.doc p, .doc li { color: #c9c9cc; }
.doc p { margin-top: 14px; }
.doc ul { margin: 14px 0 0; padding-left: 1.2em; }
.doc li { margin-top: 8px; }
.doc li::marker { color: var(--faint); }
.doc a { color: var(--text); text-decoration-color: rgba(255, 255, 255, 0.35); text-underline-offset: 3px; }
.doc a:hover { text-decoration-color: #fff; }
.doc strong { color: var(--text); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy > *, .fan .phone, .sun { animation: none; }
  .fan .side { transform: translate(-58%, 5%) rotate(-8deg) scale(0.86); }
  .fan .side.r { transform: translate(58%, 5%) rotate(8deg) scale(0.86); }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .screen img, .glow { transition: none; }
}
