/* Bergrum — the app's own palette, lifted from ui/Theme.kt.
   Slate for dark, Bright for light, following the visitor's system. Nothing external is
   loaded: the privacy policy promises that, and the CSP tag in each page enforces it. */

:root {
  color-scheme: light dark;
  --bg: #e5e4ec;
  --plane: #f1f0f6;
  --block: #f6f5fa;
  --ink: #1b1b21;
  --ink-dim: #44454e;
  --line: #d4d3de;
  --accent: #4a5b96;
  --accent-ink: #ffffff;
  --glow: rgba(74, 91, 150, .2);
  --dim: .72;
  --radius: 16px;
  --maxw: 70rem;
  --slide: clamp(13rem, 62vw, 16.5rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1c2a;
    --plane: #1e2130;
    --block: #131521;
    --ink: #e4e1e9;
    --ink-dim: #c5c6d0;
    --line: #2d3043;
    --accent: #b4c3ff;
    --accent-ink: #12275c;
    --glow: rgba(180, 195, 255, .14);
    --dim: .45;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: .18em; }

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

/* Sideways only. A shorthand here would zero the vertical padding of every section. */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 1.5rem; }

section { padding-block: 4rem; }

h1, h2, h3 { letter-spacing: -.022em; line-height: 1.12; }

h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; margin: 0 0 1.2rem; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 700; margin: 0 0 .7rem; }
h3 { font-size: 1.1rem; letter-spacing: -.01em; line-height: 1.3; margin: 0 0 .45rem; }

.sub { color: var(--ink-dim); font-size: 1.08rem; margin: 0 0 2.5rem; max-width: 56ch; }

.eyebrow {
  color: var(--accent);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  margin: 0 0 1rem;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- top bar */

header.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.bar .wrap { display: flex; align-items: center; gap: 1rem; min-height: 62px; }

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-right: auto;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -.01em;
  text-decoration: none;
}
.brand img { display: block; width: 30px; height: 30px; }

nav { display: flex; gap: 1.2rem; white-space: nowrap; }

nav a {
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
  color: var(--ink-dim);
  font-size: .95rem;
  text-decoration: none;
}
nav a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------------- lead */

.lead {
  overflow: hidden;
  background: radial-gradient(60rem 34rem at 78% 10%, var(--glow), transparent 70%);
}

.lead .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 3rem;
  align-items: center;
  padding-block: 4.5rem;
}

.lede { color: var(--ink-dim); font-size: clamp(1.1rem, 2vw, 1.28rem); margin: 0 0 2rem; max-width: 34rem; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.2rem; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.fine { color: var(--ink-dim); font-size: .9rem; margin: 0; }

/* The screenshots have no status bar, so the frame stands in for what was cropped. */
.phone {
  padding: .5rem;
  border: 1px solid #34374a;
  border-radius: 2.1rem;
  background: #0b0c13;
  box-shadow: 0 1.5rem 3.5rem rgba(8, 10, 22, .38);
}
.phone img { display: block; width: 100%; height: auto; border-radius: 1.65rem; }

.lead .phone { width: min(19rem, 100%); margin-inline: auto; transform: rotate(1.5deg); }

/* ------------------------------------------------------------------ cards */

.three { display: grid; gap: 1.1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }

.card {
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--block);
}
.card p { color: var(--ink-dim); font-size: 1rem; margin: 0; }
.card p + p { margin-top: .7rem; }
.card.wide { grid-column: 1 / -1; }

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

.flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin: 0 0 1.2rem;
  padding: 0;
  list-style: none;
}

.flow li {
  position: relative;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--block);
}

.flow li + li::before {
  content: "\2192";
  position: absolute;
  left: -1.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1.15rem;
}

.flow b { display: block; margin-bottom: .2rem; }
.flow span { display: block; color: var(--ink-dim); font-size: .92rem; line-height: 1.45; }

.flow .tag {
  margin-top: .65rem;
  color: var(--ink-dim);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.flow .sealed { border-color: var(--accent); }
.flow .sealed .tag { color: var(--accent); }

/* --------------------------------------------------------------- carousel */

.shots { overflow: hidden; }

.carousel { position: relative; }

/* The side padding is what lets the first and last slide reach the centre. The vertical
   padding gives the phone shadows room, since overflow clips them at the track's edge. */
.track {
  position: relative;
  display: flex;
  gap: 1.75rem;
  margin-top: -1.5rem;
  padding: 2.5rem calc(50% - var(--slide) / 2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }

.slide { flex: 0 0 var(--slide); margin: 0; scroll-snap-align: center; }

.slide figcaption {
  padding-top: 1rem;
  color: var(--ink-dim);
  font-size: .92rem;
  line-height: 1.4;
  text-align: center;
  text-wrap: balance;
}

.track.live .slide { transition: opacity .25s ease, transform .25s ease; }
.track.live .slide:not(.is-active) { opacity: var(--dim); transform: scale(.92); }

/* z-index: the track is positioned too, and it would otherwise cover the button before it. */
.cbtn {
  position: absolute;
  top: 42%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--block);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}
.cbtn[hidden] { display: none; }
.cbtn.prev { left: max(1.5rem, calc(50% - var(--maxw) / 2 + 1.5rem)); }
.cbtn.next { right: max(1.5rem, calc(50% - var(--maxw) / 2 + 1.5rem)); }
.cbtn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.cbtn:disabled { opacity: .3; cursor: default; }

.dots { display: flex; justify-content: center; gap: .15rem; }
.dots:empty { display: none; }

/* A small dot with a finger-sized target. */
.dot { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; padding: 0; border: 0; background: none; cursor: pointer; }
.dot::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ink-dim); opacity: .45; }
.dot[aria-current="true"]::before { background: var(--accent); opacity: 1; }

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

.narrow { max-width: 44rem; }
.narrow p { color: var(--ink-dim); }

.closing { text-align: center; }
.closing .sub { margin-inline: auto; }
.closing .actions { justify-content: center; margin: 0; }

/* --------------------------------------------------------------- sub-pages */

.hero { padding-block: 4.5rem 1rem; }
.hero .lede { max-width: 42rem; }

.docs { display: grid; gap: .6rem; }

.doc {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--block);
  color: inherit;
  text-decoration: none;
}
.doc:hover { border-color: var(--accent); }
.doc b { flex: 0 0 11rem; font-size: .98rem; }
.doc span { color: var(--ink-dim); font-size: .95rem; }

/* The container keeps the page's left edge; only its children are held to reading width. */
.prose { padding-block: 1rem 3rem; }
.prose > * { max-width: 41rem; }
.prose h2 { font-size: 1.45rem; margin-top: 2.8rem; }
.prose h3 { margin-top: 1.8rem; }
.prose p, .prose li { color: var(--ink-dim); }
.prose strong { color: var(--ink); }

code {
  padding: .08em .38em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--plane);
  font-size: .86em;
  overflow-wrap: anywhere;
}

/* A wide table scrolls in its own box, never the page. */
.table { overflow-x: auto; }
.prose table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { color: var(--ink); }

.note {
  margin: 1.5rem 0;
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--plane);
}
.note p { margin: 0; }

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

footer {
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: .92rem;
}
footer .cols { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
footer b { display: block; margin-bottom: .4rem; color: var(--ink); }
footer a { color: var(--ink-dim); }
footer a:hover { color: var(--ink); }
footer .legal { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .85rem; }

/* ---------------------------------------------------------------- screens */

@media (max-width: 56rem) {
  .lead .wrap { grid-template-columns: 1fr; gap: 2.5rem; padding-block: 3rem; }
  .lead .phone { width: min(16rem, 74%); transform: none; }
  .three { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; gap: 1.7rem; }
  .flow li + li::before { content: "\2193"; left: 50%; top: -1.4rem; transform: translateX(-50%); }
}

@media (max-width: 40rem) {
  body { font-size: 16px; }
  section { padding-block: 3rem; }
  nav { gap: .9rem; }
  .cbtn { display: none; }
  .btn { flex: 1 1 100%; justify-content: center; }
  .doc { flex-direction: column; gap: .3rem; }
  .doc b { flex: none; }
}

/* The logo links home too, so that is the entry to give up when the bar runs out of room. */
@media (max-width: 23rem) {
  nav a:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .track.live .slide { transition: none; }
}
