/* Same palette and typeface as the app (mobile/src/theme/theme.ts). The font
   is served from this site (OFL license in fonts/) so visitors' browsers never
   contact a third party. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
}

:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --surface-alt: #f0efe8;
  --border: #e5e1d8;
  --ink: #17190f;
  --muted: #6b6b63;
  --primary: #16643a;
  --primary-soft: #e3efe7;
  --font: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
}

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

a {
  color: var(--primary);
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

/* Header and footer */

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

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

/* The wordmark alone: its two O's already are the logo's brackets. */
.brand .wordmark {
  height: 25px;
  width: auto;
}

.site-header nav {
  display: flex;
  gap: 20px;
  font-size: 15px;
}

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

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

.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--border);
  padding-block: 32px 48px;
  color: var(--muted);
  font-size: 14px;
}

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

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

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

/* Landing page */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding-block: 48px 32px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  text-wrap: balance;
}

.hero .lead {
  font-size: 20px;
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 34ch;
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.store-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #ffffff;
  text-decoration: none;
  line-height: 1.25;
  min-width: 190px;
}

.store-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.store-button span {
  display: flex;
  flex-direction: column;
}

.store-button small {
  font-size: 12px;
  opacity: 0.75;
}

.store-button strong {
  font-size: 18px;
}

.store-button[aria-disabled="true"] {
  background: var(--surface-alt);
  color: var(--muted);
  pointer-events: none;
}

.soon {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Phone mockups: titanium frame, black bezel and notch drawn in CSS around
   real screenshots, tilted in 3D. Everything scales from --w (device width);
   --s is the screen width. The screen keeps an iPhone's 19.5:9 proportions:
   status bar strip + screenshot (cropped to fit). */
.phones {
  --w: 250px;
  --s: calc(var(--w) * 0.904);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  perspective: 1800px;
  padding-block: 12px 32px;
}

.float {
  animation: float 7s ease-in-out infinite alternate;
}

.float + .float {
  margin-left: calc(var(--w) * -0.18);
  margin-top: calc(var(--w) * 0.3);
  animation-delay: -3.5s;
}

@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}

.device {
  width: var(--w);
  padding: calc(var(--w) * 0.016);
  border-radius: calc(var(--w) * 0.165);
  background: linear-gradient(140deg, #f1f2ee 0%, #9fa39b 22%, #e4e6e1 46%, #8a8e86 70%, #d7d9d4 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 calc(var(--w) * 0.22) calc(var(--w) * 0.3) calc(var(--w) * -0.12) rgba(23, 25, 15, 0.45),
    0 calc(var(--w) * 0.06) calc(var(--w) * 0.1) calc(var(--w) * -0.05) rgba(23, 25, 15, 0.3);
  position: relative;
  transform-style: preserve-3d;
}

.tilt-left {
  transform: rotateY(22deg) rotateX(7deg) rotateZ(-6deg);
}

.tilt-right {
  transform: rotateY(-20deg) rotateX(5deg) rotateZ(5deg);
}

/* Side buttons, slim and tucked against the frame: mute switch, volume up
   and volume down on the left (one strip with gaps), power on the right. */
.device::before,
.device::after {
  content: "";
  position: absolute;
  width: calc(var(--w) * 0.009);
}

.device::before {
  left: calc(var(--w) * -0.007);
  top: 17%;
  height: 25%;
  border-radius: 2px 0 0 2px;
  background: linear-gradient(
    #8f938b 0 12%,
    transparent 12% 30%,
    #8f938b 30% 61%,
    transparent 61% 69%,
    #8f938b 69% 100%
  );
}

.device::after {
  right: calc(var(--w) * -0.007);
  top: 28%;
  height: 13%;
  border-radius: 0 2px 2px 0;
  background: #8f938b;
}

.bezel {
  padding: calc(var(--w) * 0.032);
  border-radius: calc(var(--w) * 0.15);
  background: #0c0d0b;
}

.screen {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--s) * 0.125);
  background: #faf9f5;
}

/* Home indicator. */
.screen::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: calc(var(--s) * 0.02);
  width: 36%;
  height: calc(var(--s) * 0.013);
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(12, 13, 11, 0.85);
}

/* A soft glass reflection across the screen. */
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 36%);
  pointer-events: none;
}

/* The captures carry the real iOS status bar; only the notch is drawn over it. */
.notch {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: 47%;
  height: calc(var(--s) * 0.085);
  transform: translateX(-50%);
  border-radius: 0 0 calc(var(--s) * 0.06) calc(var(--s) * 0.06);
  background: #0c0d0b;
}

/* Concave corners where the notch meets the top edge of the screen. */
.notch::before,
.notch::after {
  content: "";
  position: absolute;
  top: 0;
  width: calc(var(--s) * 0.026);
  height: calc(var(--s) * 0.026);
}

.notch::before {
  right: 100%;
  background: radial-gradient(circle at 0 100%, transparent calc(var(--s) * 0.026), #0c0d0b calc(var(--s) * 0.026 + 0.5px));
}

.notch::after {
  left: 100%;
  background: radial-gradient(circle at 100% 100%, transparent calc(var(--s) * 0.026), #0c0d0b calc(var(--s) * 0.026 + 0.5px));
}

/* Speaker grille and front camera. */
.speaker {
  position: absolute;
  top: calc(var(--s) * 0.024);
  left: 50%;
  width: 26%;
  height: calc(var(--s) * 0.012);
  transform: translateX(-50%);
  border-radius: 999px;
  background: #232521;
}

.camera {
  position: absolute;
  top: calc(var(--s) * 0.019);
  left: 68%;
  width: calc(var(--s) * 0.022);
  height: calc(var(--s) * 0.022);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #4a5a78 0%, #1a1f2b 55%, #0c0d0b 100%);
}

.screen img {
  display: block;
  width: 100%;
  height: auto;
}

@media (prefers-reduced-motion: reduce) {
  .float {
    animation: none;
  }
}

section {
  padding-block: 56px;
}

.section-title {
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.2;
  margin: 0 0 12px;
  text-wrap: balance;
}

.section-lead {
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 60ch;
}

.examples {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.examples li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  display: grid;
  gap: 2px;
}

.examples strong {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.examples span {
  font-size: 18px;
  font-weight: 600;
}

.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.mode {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.mode h3 {
  margin: 12px 0 6px;
  font-size: 20px;
}

.mode p {
  margin: 0;
  color: var(--muted);
}

.mode .example {
  margin-top: 16px;
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
}

.mode-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: grid;
  place-items: center;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 12px;
}

.steps h3 {
  margin: 0 0 6px;
  font-size: 19px;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

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

.feature-list strong {
  display: block;
  font-size: 18px;
}

.feature-list span {
  color: var(--muted);
}

.cta {
  background: var(--primary);
  color: #ffffff;
  border-radius: 24px;
  padding: 48px;
  text-align: center;
}

.cta h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4vw, 34px);
}

.cta p {
  margin: 0;
  opacity: 0.85;
}

/* Text pages (privacy, terms, legal, support) */

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding-block: 32px 0;
}

.doc h1 {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.15;
  margin: 0 0 8px;
  text-wrap: balance;
}

.doc .updated {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 40px;
}

.doc h2 {
  font-size: 22px;
  margin: 40px 0 12px;
}

.doc h3 {
  font-size: 18px;
  margin: 24px 0 8px;
}

.doc p,
.doc li {
  max-width: 65ch;
}

.doc ul {
  padding-left: 22px;
}

.doc li + li {
  margin-top: 6px;
}

.callout {
  background: var(--primary-soft);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 24px 0;
}

.callout p {
  margin: 0;
}

/* Password forms */

.form-page form {
  display: flex;
  flex-direction: column;
  max-width: 420px;
  margin-top: 24px;
}

.form-page label {
  font-weight: 600;
  margin: 16px 0 6px;
}

.form-page input {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 17px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}

.form-page input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.field-hint {
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0 0;
}

.form-error {
  color: #b42318;
  margin: 12px 0 0;
}

.primary-button {
  font: inherit;
  font-weight: 600;
  margin-top: 24px;
  padding: 14px 20px;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
}

.primary-button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Invite page (/d/<code>) */

.invite-from {
  color: var(--primary);
  font-weight: 600;
  margin: 0 0 8px;
}

.invite-page .callout ul {
  margin: 8px 0 0;
}

.invite-open {
  display: inline-block;
  margin-top: 0;
  text-decoration: none;
}

.table-scroll {
  overflow-x: auto;
  margin: 16px 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
  background: var(--surface);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border: 1px solid var(--border);
}

th {
  background: var(--surface-alt);
}

.steps-inline {
  padding-left: 22px;
}

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

summary {
  font-weight: 600;
  cursor: pointer;
}

details p {
  margin: 10px 0 0;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 16px;
  padding: 24px;
  margin: 24px 0;
}

.contact-card p {
  margin: 0;
}

.contact-card .email {
  font-size: 22px;
  font-weight: 700;
  margin-top: 6px;
  word-break: break-all;
}

/* Small screens */

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

  .hero {
    padding-top: 24px;
  }

  .modes,
  .steps {
    grid-template-columns: 1fr;
  }

  .examples {
    grid-template-columns: 1fr 1fr;
  }

  .phones {
    --w: min(40vw, 200px);
  }

  .cta {
    padding: 32px 24px;
  }

  .site-header nav {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
