/*
 * uselife.app – the same colours and type as the app, on one quiet surface. Sections are parted by
 * hairlines, not by colour. One thing stands out: the phone with the real app in it.
 */

:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #2b2a27;
  --muted: #6b6860;
  --faint: #908d84;
  --line: #e6e3dc;
  --accent: #3f6b5b;
  --bezel: #121212;
  --bezel-edge: rgba(0, 0, 0, 0.22);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --space: clamp(72px, 11vw, 128px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151514;
    --surface: #1c1c1a;
    --text: #ecebe6;
    --muted: #8f8c84;
    --faint: #6b6962;
    --line: #2a2926;
    --accent: #8dbaa6;
    --bezel: #0b0b0b;
    --bezel-edge: rgba(255, 255, 255, 0.14);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

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

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

a {
  color: inherit;
}

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

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

/* ── Top ─────────────────────────────────────────────── */

.top {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.quiet-link {
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}

.quiet-link:hover {
  color: var(--text);
}

/* ── Hero: the promise on the left, the app itself on the right ─────── */

.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 40px) var(--gutter) var(--space);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

/* Small, exact labels – what something is, before what it says. */
.eyebrow,
.num {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--faint);
}

.eyebrow {
  margin: 0 0 20px;
}

h1 {
  font-family: var(--display);
  font-size: clamp(40px, 5.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0;
}

.lead {
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.55;
  color: var(--muted);
  max-width: 28em;
  margin: 24px 0 36px;
  text-wrap: pretty;
}

.get {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.store {
  display: inline-block;
  line-height: 0;
  border-radius: 9px;
}

.store img {
  height: 46px;
  width: auto;
}

/* Until the app is in the store: the browser is the way in. */
.open {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}

.open:hover {
  opacity: 0.88;
}

.get-note {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.get-note a {
  color: var(--text);
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
}

.open,
.soon-note,
[data-store="soon"] .store,
[data-store="soon"] .store-note {
  display: none;
}

[data-store="soon"] .open {
  display: inline-flex;
}

[data-store="soon"] .soon-note {
  display: block;
}

/* ── The phone ───────────────────────────────────────── */

.demo {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 16px;
}

/* An iPhone as it is: black, a thin bezel, a fine edge – the size of a real one, whatever the window. */
.phone {
  --w: clamp(296px, 26vw, 340px);
  width: var(--w);
  padding: 9px;
  border-radius: 54px;
  background: var(--bezel);
  box-shadow:
    0 0 0 1px var(--bezel-edge),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 40px 80px -40px rgba(0, 0, 0, 0.45),
    0 16px 32px -20px rgba(0, 0, 0, 0.3);
}

.screen {
  position: relative;
  aspect-ratio: 390 / 844;
  border-radius: 45px;
  overflow: hidden;
  background: var(--bg);
}

/* The iPhone's own line at the top: time, island, signal – the app starts below it. */
.status {
  position: absolute;
  inset: 0 0 auto;
  height: calc(54px * var(--scale, 0.85));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(30px * var(--scale, 0.85)) 0 calc(36px * var(--scale, 0.85));
  font-size: calc(16px * var(--scale, 0.85));
  font-weight: 600;
  color: var(--text);
  z-index: 1;
  background: var(--bg);
}

.island {
  position: absolute;
  left: 50%;
  top: calc(11px * var(--scale, 0.85));
  width: calc(122px * var(--scale, 0.85));
  height: calc(35px * var(--scale, 0.85));
  transform: translateX(-50%);
  border-radius: 999px;
  background: #000;
}

.signal {
  display: inline-flex;
  gap: calc(6px * var(--scale, 0.85));
  align-items: center;
}

.signal svg {
  fill: currentColor;
  height: calc(11px * var(--scale, 0.85));
  width: auto;
}

.signal svg + svg {
  height: calc(12px * var(--scale, 0.85));
}

/* The app at the size of an iPhone, scaled to the screen it sits in (landing.ts sets --scale). */
.screen iframe {
  position: absolute;
  top: calc(54px * var(--scale, 0.85));
  left: 0;
  width: 390px;
  height: 790px;
  border: 0;
  transform: scale(var(--scale, 0.85));
  transform-origin: top left;
  background: var(--bg);
}

figcaption {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  max-width: 24em;
  text-wrap: balance;
}

/* ── Sections: parted by a hairline, the same space everywhere ────────── */

.section {
  width: min(100% - 2 * var(--gutter), var(--wrap) - 2 * var(--gutter));
  margin: 0 auto;
  padding-block: var(--space);
  border-top: 1px solid var(--line);
}

.section .wrap {
  padding: 0;
}

h2 {
  font-family: var(--display);
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 clamp(32px, 4vw, 48px);
}

/* A grid of cells with hairlines between them – the lines are the gaps. */
.grid {
  display: grid;
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.cell {
  background: var(--bg);
  padding: clamp(24px, 2.6vw, 32px);
}

h3 {
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0;
}

/* The steps: number, title, words, sample – each on one line across the three. */
.steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto auto 1fr;
}

.step {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  row-gap: 0;
}

.step .num {
  margin-bottom: 16px;
}

.step > p {
  margin: 8px 0 28px;
  color: var(--muted);
  font-size: 16px;
  text-wrap: pretty;
}

/* Small pieces of the app as it looks – not screenshots, its own colours and type. */
.sample {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.45;
}

.sample p {
  margin: 0;
}

.s-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}

.s-mic {
  display: inline-flex;
  color: var(--muted);
}

.s-btn {
  background: var(--text);
  color: var(--surface);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 500;
}

.s-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin-bottom: 6px !important;
}

.s-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  position: relative;
  flex: none;
}

.s-check::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 3.5px;
  height: 7px;
  border: solid var(--accent);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.s-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0 0 24px;
  color: var(--muted);
}

.s-line span:last-child {
  color: var(--text);
}

.s-q {
  align-self: flex-end;
  background: var(--bg);
  border-radius: 14px;
  padding: 7px 12px;
  margin-bottom: 12px !important;
}

.s-src {
  margin-top: 8px !important;
  color: var(--faint);
  font-size: 13px;
}

/* What happens to the data: four plain facts, each with its label. */
.facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.facts dt {
  display: grid;
  gap: 14px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.facts dd {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  text-wrap: pretty;
}

/* ── End ─────────────────────────────────────────────── */

.end {
  text-align: center;
}

.end h2 {
  margin-bottom: 28px;
}

.end .get {
  justify-content: center;
}

/* Inside the margins of the page, like the hairlines above it. */
.foot {
  width: min(100% - 2 * var(--gutter), var(--wrap) - 2 * var(--gutter));
  margin: 0 auto;
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.foot nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.foot a {
  text-decoration: none;
}

.foot a:hover {
  color: var(--text);
}

/* ── Pages of text (Impressum, Datenschutz) ──────────── */

.doc {
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(24px, 6vh, 64px) var(--gutter) 80px;
}

.doc h1 {
  font-size: clamp(34px, 5vw, 48px);
  margin-bottom: 12px;
}

.doc .stand {
  color: var(--muted);
  margin: 0 0 40px;
}

.doc h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
}

.doc h3 {
  font-size: 17px;
  margin: 24px 0 6px;
}

.doc p,
.doc li {
  color: var(--text);
  max-width: 40em;
}

.doc ul {
  padding-left: 1.2em;
}

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

.doc address {
  font-style: normal;
}

/* ── Narrower ────────────────────────────────────────── */

@media (max-width: 1000px) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .steps,
  .facts {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .step {
    display: flex;
    flex-direction: column;
    grid-row: auto;
  }

  /* Smaller than the screen it is shown on, with room beside it to scroll the page. */
  .phone {
    --w: min(290px, 78vw);
    padding: 8px;
    border-radius: 46px;
  }

  .screen {
    border-radius: 38px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .quiet-link,
  .foot a,
  .open {
    transition:
      color 0.15s,
      opacity 0.15s;
  }
}
