/* Mitmi website - plain CSS, no frameworks, no third-party fonts or requests (the app is
   privacy-first, so the site loads nothing from anywhere else). */

:root {
  --bg: #f4f8ff;
  --bg-soft: #eaf2ff;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #dbe5f3;
  --primary: #2563eb;
  --primary-ink: #ffffff;
  --sky: #60a5fa;
  --cyan: #7dd3fc;
  --indigo: #6366f1;
  --coral: #ff6f61;
  --ok: #10b981;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 12px 32px -12px rgba(37, 99, 235, .25);
  --radius: 20px;
  --maxw: 1120px;
  --header-h: 69px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1020;
    --bg-soft: #0f1830;
    --surface: #111a33;
    --ink: #e8eefc;
    --muted: #a3b1cc;
    --line: #1f2c4d;
    --primary: #4f8cff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--primary); color: var(--primary-ink); padding: 10px 16px; border-radius: 10px;
}
.skip:focus { left: 12px; }

.wrap { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; }
.brand svg { width: 38px; height: 38px; }
.brand span {
  background: linear-gradient(90deg, var(--sky), var(--cyan) 55%, var(--indigo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: .97rem; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--bg-soft); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; display: flex; align-items: center;
  min-height: min(calc(100svh - var(--header-h)), 820px);
  padding: clamp(14px, 4.2vh, 84px) 0;
  background:
    radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--sky) 30%, transparent), transparent 70%),
    radial-gradient(700px 380px at 0% 10%, color-mix(in srgb, var(--indigo) 18%, transparent), transparent 70%);
}
.hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
h1 {
  margin: clamp(10px, 2.2vh, 18px) 0 clamp(10px, 2vh, 16px);
  font-size: clamp(1.9rem, min(5.2vw, 6.9vh), 3.7rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 800;
}
h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--primary), var(--indigo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { font-size: clamp(1rem, min(2vw, 2.7vh), 1.28rem); line-height: 1.55; color: var(--muted); max-width: 34em; margin: 0 0 clamp(14px, 3vh, 28px); }
.hero h1 { margin-top: 0; }
.hero .lead { margin-bottom: 0; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Google's official Play badge, unmodified: the PNG carries its own clear space, so no extra padding.
   The negative margin lines its visible edge up with the text above it. */
.store-badge { display: inline-block; line-height: 0; margin-left: -2px; border-radius: 12px; }
.store-badge img { height: clamp(62px, 9vh, 80px); width: auto; }
.store-badge:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
/* Same visible height as the Play badge, whose PNG is about 23% clear space. */
.donate-link { display: inline-block; line-height: 0; border-radius: 6px; }
.donate-link img { height: clamp(48px, 6.9vh, 61px); width: auto; }
.donate-link:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }

/* decorative TV: loops between two real app screenshots (a 1:1 call, then a group call) in the page's
   language. The loop is disabled for reduced-motion users (group call only). */
.tv { position: relative; max-width: min(100%, calc((100svh - var(--header-h) - 96px) * 1.65)); margin-inline: auto; width: 100%; }
.tv-frame {
  background: linear-gradient(160deg, #1e293b, #0b1220); border-radius: 22px; padding: 14px;
  box-shadow: 0 30px 60px -20px rgba(37, 99, 235, .45), 0 0 0 1px #334155 inset;
}
.tv-screen { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #0b1220; }
.scene { position: absolute; inset: 0; opacity: 0; animation-duration: 14s; animation-iteration-count: infinite; animation-timing-function: ease-in-out; }
.scene img { display: block; width: 100%; height: 100%; object-fit: cover; }
.scene-one { animation-name: show-one; }
.scene-group { animation-name: show-group; }
.tv-stand { width: 34%; height: 12px; margin: 0 auto; background: linear-gradient(#334155, #1e293b); border-radius: 0 0 10px 10px; }
.tv-base { width: 52%; height: 8px; margin: 0 auto; background: #1e293b; border-radius: 999px; opacity: .8; }
.badge-float {
  position: absolute; left: 18px; top: -16px; z-index: 3; display: grid; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); border-radius: 14px; padding: 10px 14px; font-size: .88rem; font-weight: 700;
}
.badge-float span { grid-area: 1 / 1; display: flex; gap: 8px; align-items: center; opacity: 0; animation-duration: 14s; animation-iteration-count: infinite; animation-timing-function: ease-in-out; }
.badge-float .b-one { animation-name: show-one; }
.badge-float .b-group { animation-name: show-group; }
.badge-float b { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); display: inline-block; }

/* 0-40%: 1:1 call - 50-90%: group call - short cross-fades in between */
@keyframes show-one { 0%, 40% { opacity: 1; } 50%, 90% { opacity: 0; } 100% { opacity: 1; } }
@keyframes show-group { 0%, 40% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .scene, .badge-float span { animation: none; }
  .scene-group, .badge-float .b-group { opacity: 1; }
}

/* ---------- sections ---------- */
section { padding: clamp(48px, 7vw, 88px) 0; }
.alt { background: var(--bg-soft); }
.kicker { color: var(--primary); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .82rem; margin: 0 0 10px; }
h2 { margin: 0 0 14px; font-size: clamp(1.7rem, 3.6vw, 2.45rem); line-height: 1.15; letter-spacing: -.025em; }
.sub { color: var(--muted); max-width: 40em; margin: 0 0 40px; font-size: 1.1rem; }
.center { text-align: center; }
.center .sub { margin-inline: auto; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--sky); }
.card h3 { margin: 16px 0 8px; font-size: 1.2rem; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: 1rem; }
.ico {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--sky) 28%, var(--surface)), color-mix(in srgb, var(--indigo) 22%, var(--surface)));
  color: var(--primary);
}
.ico svg { width: 26px; height: 26px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps li { position: relative; padding: 26px 26px 26px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before {
  counter-increment: s; content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--indigo)); color: #fff; font-weight: 800; margin-bottom: 14px;
}
.steps h3 { margin: 0 0 6px; font-size: 1.15rem; }
.steps p { margin: 0; color: var(--muted); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 56px); align-items: start; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checks li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; }
.checks svg { width: 26px; height: 26px; color: var(--ok); margin-top: 2px; }
.checks strong { display: block; }
.checks span { color: var(--muted); }
.panel {
  background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 12%, var(--surface)), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 34px); box-shadow: var(--shadow);
}
.panel h3 { margin-top: 0; }

.faq { max-width: 820px; margin-inline: auto; display: grid; gap: 12px; }
.faq details { scroll-margin-top: 92px; } /* keeps a linked entry (#delete-data) clear of the sticky header */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0 22px; }
details[open] { border-color: var(--sky); }
summary { cursor: pointer; padding: 18px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); }
details[open] summary::after { content: "\2212"; }
details p { margin: 0 0 18px; color: var(--muted); }

.final { text-align: center; }
.final .cta { justify-content: center; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 44px; color: var(--muted); font-size: .95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 32px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: 6px 22px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--primary); }

/* language menu: bottom-right of the footer on desktop, centred at the bottom on phones (see the
   responsive block). Resets the FAQ's <details> styling. */
.lang-menu { position: relative; margin-left: auto; background: none; border: 0; border-radius: 0; padding: 0; }
.lang-menu[open] { border-color: transparent; }
.lang-menu summary {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: .95rem; white-space: nowrap;
}
.lang-menu summary:hover, .lang-menu[open] summary { border-color: var(--sky); }
.lang-menu summary svg { width: 18px; height: 18px; color: var(--primary); }
.lang-menu summary::after { content: "\25BE"; font-size: .85rem; color: var(--muted); }
.lang-menu[open] summary::after { content: "\25B4"; }
.lang-menu ul {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 60; min-width: 190px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.lang-menu li a { display: block; padding: 8px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; }
.lang-menu li a:hover { background: var(--bg-soft); color: var(--primary); }
.lang-menu li a[aria-current="true"] { font-weight: 700; color: var(--primary); }

/* ---------- legal pages ---------- */
.doc { padding: clamp(36px, 6vw, 72px) 0 clamp(48px, 7vw, 96px); }
.doc .wrap { max-width: 800px; }
.doc h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); margin-top: 8px; }
.doc .meta { color: var(--muted); font-size: .95rem; margin: 0 0 32px; }
.doc h2 { font-size: 1.32rem; letter-spacing: -.01em; margin: 40px 0 10px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 24px; }
.doc p, .doc li { color: color-mix(in srgb, var(--ink) 88%, var(--muted)); }
.doc ul { padding-left: 1.3em; display: grid; gap: 8px; }
.doc .back { display: inline-block; margin-bottom: 8px; font-weight: 600; text-decoration: none; }

/* Japanese has no spaces: break headings between phrases, not in the middle of a word (Chromium;
   other browsers keep their usual line breaking). */
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { word-break: auto-phrase; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap, .split { grid-template-columns: 1fr; }
  /* one column: start at the top instead of centring in a full-screen-tall hero */
  .hero { min-height: 0; padding: 32px 0 48px; }
  .grid, .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .grid, .steps { grid-template-columns: 1fr; }
  /* logo on top, the four section links centred on one line below it */
  .site-header .wrap { height: auto; padding: 10px 0 6px; flex-direction: column; gap: 4px; }
  .nav { width: 100%; justify-content: center; gap: 2px; }
  .nav a { padding: 6px 5px; font-size: min(.875rem, 3.6vw); white-space: nowrap; }
  .site-footer .wrap { flex-direction: column; text-align: center; }
  .site-footer nav { justify-content: center; }
  .lang-menu { margin: 4px auto 0; }
  .lang-menu ul { right: auto; left: 50%; transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { transition: none; }
}

/* ---------- classes that replace former inline styles (the CSP forbids inline styles) ---------- */
.panel-list { padding-left: 1.2em; display: grid; gap: 8px; margin: 0 0 18px; }
.final .sub { margin-inline: auto; }
.err { text-align: center; }
.err-logo { margin: 0 auto 16px; }
body.redirect { font-family: var(--font); text-align: center; padding: 4rem 1rem; }
