/* MEYA website. System fonts only and no third-party requests: a privacy
   app's website should not tell anyone else who visits it. */
:root {
  --navy: #044d8c;
  --sky: #49b1f2;
  --indigo: #424d8c;
  --mist: #ebf2f2;

  --bg: #f4f8f8;
  --surface: #ffffff;
  --surface-2: #e6eff1;
  --text: #0d0d0d;
  --muted: #3f4b63;
  --line: #c9d7de;
  --accent: var(--navy);
  --accent-text: #ffffff;
  --link: #035aa6;
  --ok: #1f7a4d;
  --ok-bg: #ddf1e6;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(4, 30, 60, 0.06), 0 8px 28px rgba(4, 30, 60, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1420;
    --surface: #111e2e;
    --surface-2: #17283c;
    --text: #eef4f7;
    --muted: #b3c2d3;
    --line: #26394f;
    --accent: #49b1f2;
    --accent-text: #04121f;
    --link: #8fd0ff;
    --ok: #7fd9a8;
    --ok-bg: #12301f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
}

a { color: var(--link); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--surface);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { left: 16px; }

.wrap {
  width: min(1080px, 100% - 32px);
  margin-inline: auto;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
}
.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
}
.top nav { display: flex; gap: 4px; flex-wrap: nowrap; white-space: nowrap; }
.top nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.95rem;
}
.top nav a:hover { background: var(--surface-2); color: var(--text); }

/* Hero */
.hero { padding: 72px 0 40px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
h1 {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin: 18px 0 18px;
  letter-spacing: -0.02em;
}
.lead { font-size: 1.2rem; color: var(--muted); max-width: 36ch; margin: 0 0 28px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--accent);
}
.button.primary { background: var(--accent); color: var(--accent-text); }
.button.secondary { color: var(--accent); }

/* App showcase: MEYA in use, two layered phones with real faces. */
.showcase {
  position: relative;
  justify-self: center;
  width: min(460px, 100%);
  aspect-ratio: 46 / 52;
}
.device {
  position: absolute;
  width: 58%;
  aspect-ratio: 9 / 18.5;
  background: #0c1622;
  border-radius: 34px;
  padding: 9px;
  box-shadow: 0 2px 4px rgba(4, 30, 60, 0.12), 0 24px 60px rgba(4, 30, 60, 0.28);
}
.device-back { left: 0; top: 2%; transform: rotate(-6deg); }
.device-front { right: 0; top: 8%; transform: rotate(4deg); }
.device > div {
  height: 100%;
  border-radius: 26px;
  overflow: hidden;
}

/* Chats list */
.app { background: #ebf2f2; color: #0d0d0d; display: flex; flex-direction: column; }
.app-bar {
  background: #044d8c;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 16px 14px 10px;
}
.stories {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
}
.story {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #49b1f2;
  flex: none;
}
.chats { list-style: none; margin: 0; padding: 6px 8px; display: grid; gap: 4px; }
.chats li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 6px;
  background: #fff;
  border-radius: 12px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-repeat: no-repeat;
  flex: none;
}
.who { display: grid; min-width: 0; flex: 1; font-size: 0.72rem; line-height: 1.25; }
.who b { font-size: 0.8rem; }
.who i { font-style: normal; color: #3f4b63; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-n {
  background: #044d8c;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 6px;
}

/* Family video call */
.call { background: #0d1b2a; color: #fff; display: flex; flex-direction: column; }
.call-top { padding: 14px 12px 8px; display: grid; gap: 2px; }
.call-top b { font-size: 0.95rem; }
.call-top span { font-size: 0.62rem; color: #b8cde0; }
.tiles {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 5px;
  padding: 0 6px;
}
.tiles img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
.controls {
  display: flex;
  justify-content: space-around;
  padding: 10px 8px 14px;
}
.controls span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}
.controls .end { background: #d32f2f; transform: rotate(135deg); }

/* Floating details */
.float {
  position: absolute;
  background: #fff;
  color: #0d0d0d;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(4, 30, 60, 0.22);
  font-size: 0.8rem;
  font-weight: 600;
}
.float-photo {
  left: -2%;
  bottom: 4%;
  width: 46%;
  padding: 6px;
  display: grid;
  gap: 4px;
  transform: rotate(-3deg);
}
.float-photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 11px; display: block; }
.float-photo span { padding: 0 4px 2px; }
.float-photo em { font-style: normal; color: #035aa6; float: right; }
.float-heart { right: 4%; bottom: 10%; padding: 6px 12px; }
.float-lock { right: 10%; top: 0; padding: 6px 12px; background: #ddf1e6; color: #1f7a4d; }

@media (max-width: 860px) {
  .showcase { margin-top: 12px; }
}

/* Sections */
section { padding: 56px 0; }
h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.section-lead { color: var(--muted); max-width: 60ch; margin: 0 0 32px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 10px 0 6px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); }
.icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
}
.icon svg { width: 24px; height: 24px; stroke: var(--accent); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps .card::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
}

.privacy {
  background: var(--surface);
  border-block: 1px solid var(--line);
}
.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ledger ul { margin: 0; padding-left: 1.2em; color: var(--muted); }
.ledger li { margin: 6px 0; }
.ledger .card h3 { margin-top: 0; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--ok-bg);
  color: var(--ok);
}

.languages { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; margin: 0; }
.languages li {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.95rem;
}

.cta {
  text-align: center;
  background: var(--navy);
  color: #fff;
  border-radius: 28px;
  padding: 48px 24px;
}
.cta p { color: #d8e7f5; max-width: 52ch; margin: 0 auto 24px; }
.cta .button.primary { background: #fff; color: var(--navy); border-color: #fff; }

/* Legal pages */
.legal { padding: 48px 0 64px; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.legal h2 { font-size: 1.3rem; margin-top: 32px; }
.legal p { color: var(--muted); }

footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 0.92rem;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
footer nav { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero { padding-top: 40px; }
  .hero .wrap, .ledger { grid-template-columns: 1fr; }
  .grid, .steps { grid-template-columns: 1fr; }
  .top nav a.hide-small { display: none; }
}

@media (max-width: 520px) {
  .top nav a { padding: 8px 6px; font-size: 0.9rem; }
  .top nav a.hide-tiny { display: none; }
  .actions .button { flex: 1 1 100%; justify-content: center; }
}

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

/* Motion. Pure CSS (the site runs no scripts), and only for people who
   have not asked their device to reduce motion. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
  @keyframes drift-in { from { opacity: 0; translate: 0 40px; } to { opacity: 1; translate: 0 0; } }
  @keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
  @keyframes pop { 0% { opacity: 0; scale: 0.6; } 70% { scale: 1.08; } 100% { opacity: 1; scale: 1; } }
  @keyframes beat { 0%, 100% { scale: 1; } 12% { scale: 1.18; } 24% { scale: 1; } 36% { scale: 1.12; } 48% { scale: 1; } }
  @keyframes ring { 0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #49b1f2; } 50% { box-shadow: 0 0 0 2px #fff, 0 0 0 5px #044d8c; } }
  @keyframes speaking {
    0%, 22% { box-shadow: 0 0 0 3px #49b1f2, 0 0 18px rgba(73, 177, 242, 0.7); }
    28%, 100% { box-shadow: 0 0 0 0 transparent; }
  }

  .hero .eyebrow, .hero h1, .hero .lead, .hero .actions { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero h1 { animation-delay: 0.08s; }
  .hero .lead { animation-delay: 0.16s; }
  .hero .actions { animation-delay: 0.24s; }

  .device-back { animation: drift-in 0.9s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both, bob 7s 1.1s ease-in-out infinite; }
  .device-front { animation: drift-in 0.9s 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both, bob 6s 1.25s ease-in-out infinite; }
  .float-photo { animation: pop 0.6s 0.9s both, bob 5s 1.5s ease-in-out infinite; }
  .float-lock { animation: pop 0.6s 1.1s both, bob 5.5s 1.7s ease-in-out infinite; }
  .float-heart { animation: pop 0.6s 1.3s both, beat 2.4s 2s ease-in-out infinite; }

  .story { animation: ring 2.6s ease-in-out infinite; }
  .story:nth-child(2) { animation-delay: 0.65s; }
  .story:nth-child(3) { animation-delay: 1.3s; }
  .story:nth-child(4) { animation-delay: 1.95s; }

  /* The person speaking in the call lights up, one after another. */
  .tiles img { animation: speaking 8s infinite; }
  .tiles img:nth-child(2) { animation-delay: 2s; }
  .tiles img:nth-child(3) { animation-delay: 4s; }
  .tiles img:nth-child(4) { animation-delay: 6s; }

  .button { transition: translate 0.2s, box-shadow 0.2s; }
  .button:hover { translate: 0 -2px; box-shadow: 0 8px 20px rgba(4, 77, 140, 0.25); }
  .card { transition: scale 0.25s, box-shadow 0.25s; }
  .card:hover { scale: 1.02; box-shadow: 0 2px 4px rgba(4, 30, 60, 0.08), 0 16px 36px rgba(4, 30, 60, 0.14); }

  /* Cards and headings slide in as they scroll into view. Browsers that
     cannot tie animation to scrolling simply show them straight away. */
  @supports (animation-timeline: view()) {
    section:not(.hero) h2, section:not(.hero) .section-lead, .card, .languages li {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
}

/* Encryption band: three strands braided together. */
.ratchet {
  background: var(--navy);
  color: #eaf4fb;
  border-radius: 28px;
  padding: clamp(24px, 5vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 40px;
  align-items: center;
}
.ratchet .eyebrow { background: rgba(255, 255, 255, 0.12); color: #9fd6f8; }
.ratchet h2 { color: #fff; margin-top: 14px; }
.ratchet p { color: #c9ddec; margin: 12px 0 0; }
.strands { width: 100%; height: auto; display: block; overflow: hidden; }
.strands use { fill: none; stroke-width: 9; stroke-linecap: round; opacity: 0.92; }
.strands .ticks rect { fill: rgba(234, 244, 251, 0.35); }
.strand-legend { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; color: #eaf4fb; }
.strand-legend li { display: flex; align-items: center; gap: 10px; }
.strand-legend i { width: 14px; height: 14px; border-radius: 4px; flex: none; }
@media (max-width: 860px) {
  .ratchet { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes braid { to { translate: -280px 0; } }
  .strand-move { animation: braid 14s linear infinite; }
}

.cta-actions { justify-content: center; margin-bottom: 16px; }
.cta .button.secondary { color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.cta .cta-note { font-size: 0.9rem; margin: 0 auto; }
