/* Tersio site — the Night look of the app.
   Colours are the app's tokens (core/designsystem/.../theme/Colors.kt), dark by default, light under
   prefers-color-scheme: light. Lime is a fill only; in the light scheme it is never text or a line. */

@font-face {
  font-family: "Unbounded";
  src: url("/fonts/unbounded.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0B0C0F;
  --surface: #16181D;
  --surface-high: #262A31;
  --ink: #F2F3F5;
  --ink-2: #C9CDD5;
  --muted: #9BA1AD;
  --accent: #C8F04B;
  --on-accent: #0B0C0F;
  --accent-text: #C8F04B;
  --meter: #C8F04B;
  --track: #262A31;
  --line: #262A31;
  --line-strong: #6B717D;
  --seg-media: #C8F04B;
  --seg-apps: #6F7686;
  --seg-other: #3A3F49;
  --seg-free: #262A31;
  --focus: #C8F04B;

  --display: "Unbounded", "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-chip: 12px;
  --r-control: 14px;
  --r-card: 18px;
  --r-tile: 24px;
  --r-sheet: 28px;

  --s-xs: 4px;
  --s-s: 8px;
  --s-m: 12px;
  --s-l: 16px;
  --s-xl: 24px;
  --s-2xl: 40px;
  --s-3xl: 72px;

  --page: 1120px;
  --gutter: 16px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #F3F4F1;
    --surface: #FFFFFF;
    --surface-high: #E9EBE5;
    --ink: #121410;
    --ink-2: #3A3F35;
    --muted: #5F6559;
    --on-accent: #121410;
    --accent-text: #4F6B00;
    --meter: #4F6B00;
    --track: #E6E8E2;
    --line: #E2E4DE;
    --line-strong: #868C80;
    --seg-media: #4F6B00;
    --seg-apps: #8A9083;
    --seg-other: #C9CDC2;
    --seg-free: #E6E8E2;
    --focus: #121410;
  }
}

@media (min-width: 720px) {
  :root { --gutter: 32px; }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "calt", "kern";
  overflow-wrap: break-word;
}

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

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  background: var(--accent);
  color: var(--on-accent);
  padding: var(--s-s) var(--s-l);
  border-radius: var(--r-control);
  font-weight: 600;
  z-index: 10;
}
.skip:focus { top: var(--s-s); }

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

/* ---------- Header ---------- */

.site-header {
  padding: var(--s-l) 0;
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-m) var(--s-xl);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-m);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-xs) var(--s-l);
  font-size: 0.9375rem;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding: var(--s-s) 0;
}
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Hero ---------- */

.hero {
  padding: var(--s-2xl) 0 var(--s-3xl);
}
.hero-grid {
  display: grid;
  gap: var(--s-2xl);
  align-items: center;
}
@media (min-width: 880px) {
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); }
}
.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.875rem, 1rem + 5vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin: 0 0 var(--s-xl);
  max-width: 14ch;
  text-wrap: balance;
  hyphens: manual;
}
.hero .lede {
  font-size: 1.125rem;
  color: var(--ink-2);
  max-width: 46ch;
  margin: 0 0 var(--s-xl);
}
.soon {
  display: inline-flex;
  align-items: center;
  gap: var(--s-s);
  margin: 0;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--surface-high);
  color: var(--ink);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
}
.soon svg { flex: none; }
.hero-shot {
  justify-self: center;
  width: min(100%, 300px);
}
.shot {
  border-radius: var(--r-sheet);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  aspect-ratio: 9 / 20;
}
.shot img { width: 100%; height: 100%; object-fit: cover; }

/* The storage ruler, drawn large: the app's Clean tab, its segments and ticks. */
.ruler-block {
  margin-top: var(--s-3xl);
}
.ruler {
  position: relative;
  height: 28px;
  border-radius: 8px;
  background: var(--track);
  overflow: hidden;
}
@media (min-width: 720px) { .ruler { height: 44px; border-radius: 10px; } }
.ruler-fill {
  display: flex;
  height: 100%;
  animation: fill 1.4s cubic-bezier(.2, .7, .1, 1) .25s both;
}
.ruler-fill span { height: 100%; }
.ruler-fill .media { background: var(--seg-media); width: 34%; }
.ruler-fill .apps { background: var(--seg-apps); width: 21%; }
.ruler-fill .other { background: var(--seg-other); width: 17%; }
@keyframes fill {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
.ticks {
  display: flex;
  justify-content: space-between;
  height: 10px;
  margin-top: 6px;
}
.ticks i {
  width: 1px;
  background: var(--muted);
  opacity: .7;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-s) var(--s-xl);
  margin: var(--s-l) 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.9375rem;
}
.legend li { display: inline-flex; align-items: center; gap: var(--s-s); }
.legend li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.legend .media { --c: var(--seg-media); }
.legend .apps { --c: var(--seg-apps); }
.legend .other { --c: var(--seg-other); }
.legend .free { --c: var(--seg-free); }

/* ---------- Sections ---------- */

.section { padding: 0 0 var(--s-3xl); }
.section-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-xl);
}

/* Screens: a strip that scrolls sideways, each shot with what it shows. */
.screens {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 220px;
  gap: var(--s-l);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 var(--gutter) var(--s-l);
  margin: 0 calc(-1 * var(--gutter));
  scrollbar-width: thin;
  scrollbar-color: var(--surface-high) transparent;
}
@media (min-width: 1200px) {
  .screens { grid-auto-columns: minmax(0, 1fr); overflow-x: visible; }
}
.screens figure { margin: 0; scroll-snap-align: start; }
.screens figcaption {
  margin-top: var(--s-m);
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--ink-2);
}

/* Feature tiles: plain flat tiles, two columns on wide screens; the first one is the lime fill. */
.tiles {
  display: grid;
  gap: var(--s-s);
}
@media (min-width: 760px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile.wide { grid-column: 1 / -1; }
}
.tile {
  background: var(--surface);
  border-radius: var(--r-tile);
  padding: var(--s-xl);
}
@media (min-width: 720px) { .tile { padding: 32px; } }
.tile h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.25;
  margin: 0 0 var(--s-l);
}
.tile p { margin: 0 0 var(--s-m); color: var(--ink-2); max-width: 68ch; }
.tile p:last-child { margin-bottom: 0; }
.tile ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tile li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-2);
}
.tile li + li { margin-top: var(--s-s); }
.tile li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--meter);
}
.tile.lime { background: var(--accent); color: var(--on-accent); }
.tile.lime li, .tile.lime p { color: var(--on-accent); }
.tile.lime li::before { background: var(--on-accent); }
.tile.lime a { color: var(--on-accent); }
.tile.quiet { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.tile .more { margin-top: var(--s-l); font-weight: 600; }

/* ---------- Legal and support pages ---------- */

.doc {
  padding: var(--s-xl) 0 var(--s-3xl);
}
.doc .wrap { max-width: calc(760px + 2 * var(--gutter)); }
.doc h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: var(--s-xl) 0 var(--s-l);
}
.doc .meta { color: var(--muted); margin: 0 0 var(--s-2xl); }
.doc h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: var(--s-2xl) 0 var(--s-m);
}
.doc h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: var(--s-xl) 0 var(--s-s);
}
.doc p, .doc li { color: var(--ink-2); }
.doc p { margin: 0 0 var(--s-m); }
.doc ul { margin: 0 0 var(--s-m); padding-left: 1.25em; }
.doc li + li { margin-top: var(--s-xs); }
.doc li::marker { color: var(--meter); }
.doc strong { color: var(--ink); font-weight: 600; }
.summary {
  background: var(--surface);
  border-radius: var(--r-tile);
  padding: var(--s-xl);
  margin: 0 0 var(--s-xl);
}
.summary p:last-child, .summary ul:last-child { margin-bottom: 0; }
.service {
  border-top: 1px solid var(--line);
  padding-top: var(--s-m);
}
.service h3 { margin-top: var(--s-m); }
.service dl { margin: 0 0 var(--s-l); }
.service dt { color: var(--muted); font-size: 0.875rem; margin-top: var(--s-s); }
.service dd { margin: 0; color: var(--ink-2); }
.mail {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.125rem, 0.9rem + 1.2vw, 1.5rem);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

/* ---------- 404 ---------- */

.lost { padding: var(--s-3xl) 0; }
.lost .code {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(4rem, 2rem + 10vw, 9rem);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0;
}
.lost .ruler { max-width: 520px; margin: var(--s-xl) 0; }
.lost .ruler-fill .media { width: 100%; }

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: var(--s-2xl) 0;
  color: var(--muted);
  font-size: 0.9375rem;
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-l) var(--s-2xl);
  justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s-xs) var(--s-l); }
.site-footer a { color: var(--ink-2); }
.site-footer p { margin: 0; }

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