/* KeyStore — showcase site
   Palette lifted straight from the app's Compose theme:
   brand #E23744, bg #0F1115, surface #161922, variant #232633, text #E6E8EE. */

:root {
  --red: #E23744;
  --red-dark: #C62F3B;
  --red-soft: rgba(226, 55, 68, 0.14);
  --bg: #0F1115;
  --bg-2: #12141A;
  --surface: #161922;
  --surface-2: #1B1F2A;
  --variant: #232633;
  --line: #2A2E3B;
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: #E6E8EE;
  --muted: #B4B8C5;
  --dim: #868C9C;

  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 1080px;
  --r: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(620px 380px at 78% -8%, rgba(226, 55, 68, 0.15), transparent 70%),
    linear-gradient(180deg, #12141A 0%, var(--bg) 38%);
}

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.mono { font-family: var(--mono); }

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

/* ───────── HEADER / NAV ───────── */
.site {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(15, 17, 21, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site.is-stuck { border-bottom-color: var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--red); }
.brand__mark { width: 30px; height: 30px; display: block; }
.brand__word { color: var(--text); font-weight: 600; letter-spacing: -0.02em; font-size: 19px; }

.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a { color: var(--muted); font-size: 15px; transition: color .2s; }
.nav__links a:hover { color: var(--text); }
.nav__cta { color: var(--text) !important; border: 1px solid var(--line); padding: 8px 16px; border-radius: 999px; font-size: 14px; transition: border-color .2s, background .2s; }
.nav__cta:hover { border-color: var(--red); background: var(--red-soft); }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; transition: transform .25s, opacity .25s; }

/* ───────── HERO ───────── */
.hero { text-align: center; padding: clamp(56px, 10vw, 108px) 0 clamp(40px, 6vw, 64px); }
.eyebrow {
  display: inline-block; font-family: var(--mono); font-size: 13px;
  color: var(--red); margin: 0 0 24px; padding: 6px 14px;
  border: 1px solid rgba(226, 55, 68, 0.35); border-radius: 999px; background: var(--red-soft);
}
h1 { font-size: clamp(2.5rem, 7vw, 4rem); letter-spacing: -0.035em; }
h1 .hl { color: var(--red); }
.lede { color: var(--muted); font-size: clamp(1.05rem, 2.2vw, 1.2rem); max-width: 44ch; margin: 24px auto 34px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.cta-row--center, .hero .cta-row { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 26px; border-radius: 12px; font-weight: 500; font-size: 16px;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s, background .2s, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 8px 24px -10px rgba(226, 55, 68, 0.7); }
.btn--primary:hover { background: var(--red-dark); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--dim); background: var(--surface); }

/* ───────── SECTIONS ───────── */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.015)); border-block: 1px solid var(--line-soft); }
.section__head { margin-bottom: 40px; }
.section__head--center { text-align: center; }
.section h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
.section__head .sub { color: var(--muted); margin: 12px 0 0; }

/* ───────── SCREENSHOT GALLERY ───────── */
.gallery {
  display: flex; gap: 26px; justify-content: center; align-items: flex-start;
  overflow-x: auto; padding: 6px 4px 20px; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.shot { margin: 0; scroll-snap-align: center; flex: 0 0 auto; text-align: center; }
.shot figcaption { margin-top: 18px; color: var(--muted); font-size: 14px; }
.shots-note { text-align: center; color: var(--dim); font-family: var(--mono); font-size: 12px; margin: 8px 0 0; }

/* Phone frame */
.phone {
  position: relative; width: 236px;
  aspect-ratio: 236 / 500;
  background: #0B0D11; border: 1px solid #2b2f3c; border-radius: 34px; padding: 10px;
  box-shadow: 0 34px 66px -30px rgba(0, 0, 0, 0.85), inset 0 0 0 2px #05060a;
}
.phone__notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 92px; height: 18px; background: #05060a; border-radius: 0 0 12px 12px; z-index: 3; }
.phone__screen { height: 100%; background: linear-gradient(180deg, #14171F, #0F1115); border-radius: 26px; padding: 28px 13px 13px; overflow: hidden; position: relative; }

/* App bar */
.m-appbar { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 2px 2px 12px; }

/* Search field */
.m-search { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px; color: var(--dim); font-size: 12.5px; margin-bottom: 11px; }
.m-search .i { width: 16px; height: 16px; flex: none; }

/* Filter chips */
.m-chips { display: flex; gap: 6px; margin-bottom: 12px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); }
.m-chip { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 10.5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); flex: none; }
.m-chip--on { background: var(--red-soft); border-color: rgba(226,55,68,.5); color: #FF9AA2; }
.m-chip .i--check { width: 11px; height: 11px; }

/* Entry cards */
.m-list { display: grid; gap: 7px; }
.m-card { display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 10px 6px 10px 11px; }
.m-ava { width: 38px; height: 38px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 16px; }
.m-ava--sm { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
.m-card__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m-title-row { display: flex; align-items: center; gap: 5px; min-width: 0; }
.m-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-title-row .i { width: 12px; height: 12px; flex: none; }
.i--accent { color: var(--red); }
.m-account { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-meta { font-size: 10px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-more { flex: none; width: 30px; display: grid; gap: 3px; justify-items: center; color: var(--dim); }
.m-more i { width: 3.4px; height: 3.4px; border-radius: 50%; background: currentColor; }

/* FAB */
.fab { position: absolute; right: 15px; bottom: 15px; width: 44px; height: 44px; background: var(--red); color: #fff; border-radius: 14px; display: grid; place-items: center; font-size: 25px; box-shadow: 0 10px 22px -8px rgba(226,55,68,.8); }

/* TOTP popup */
.code { font-family: var(--mono); font-weight: 700; font-size: 22px; letter-spacing: 1.5px; color: var(--text); white-space: nowrap; }
.ring { width: 34px; height: 34px; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: var(--variant); stroke-width: 3; }
.ring__prog { fill: none; stroke: var(--red); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 97.39; stroke-dashoffset: 0; transition: stroke-dashoffset .95s linear, stroke .3s; }
.m-scrim { position: absolute; inset: 0; z-index: 4; border-radius: 26px; background: rgba(6, 8, 12, 0.64); display: flex; align-items: center; justify-content: center; padding: 16px; }
.m-dialog { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 18px 18px 10px; box-shadow: 0 24px 50px -20px rgba(0,0,0,.7); }
.m-dialog__title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.m-dialog__label { font-size: 11px; color: var(--muted); margin: 0 0 6px; }
.m-dialog__code { display: flex; align-items: center; gap: 9px; }
.m-dialog__code .code { flex: 1; }
.m-ringwrap { position: relative; width: 34px; height: 34px; display: grid; place-items: center; flex: none; }
.m-ringnum { position: absolute; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.m-copy { width: 19px; height: 19px; color: var(--dim); flex: none; }
.m-dialog__actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 16px; }
.m-dialog__actions span { color: var(--red); font-size: 12.5px; font-weight: 500; padding: 8px 9px; }

/* Lock screen */
.s-lock { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 18px; }
.s-lock__shield { width: 48px; height: 48px; color: var(--red); margin-bottom: 12px; }
.s-lock__title { font-size: 17px; font-weight: 600; margin: 0; }
.s-lock__sub { font-size: 12.5px; color: var(--muted); margin: 5px 0 0; }
.s-dots { display: flex; gap: 13px; margin: 22px 0 26px; }
.s-dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.6px solid var(--dim); box-sizing: border-box; }
.s-dots i.on { background: var(--red); border-color: var(--red); }
.s-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 18px; width: 100%; max-width: 200px; }
.key { aspect-ratio: 1; max-width: 46px; margin: 0 auto; width: 100%; display: grid; place-items: center; border-radius: 50%; font-size: 20px; font-weight: 500; color: var(--text); background: rgba(255,255,255,0.03); }
.key--icon svg { width: 22px; height: 22px; color: var(--muted); }
.key--accent svg { color: var(--red); }
.key--icon { background: none; }

/* ───────── ABOUT ───────── */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about__lead p { color: var(--muted); margin: 18px 0 0; }
.about__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.about__list li { background: var(--bg); padding: 18px 22px; display: flex; flex-direction: column; gap: 3px; }
.about__list strong { font-weight: 600; position: relative; padding-left: 18px; }
.about__list strong::before { content: ""; position: absolute; left: 0; top: .45em; width: 8px; height: 8px; border-radius: 2px; background: var(--red); }
.about__list span { color: var(--muted); font-size: 14.5px; padding-left: 18px; }

/* ───────── SUBPAGES (about / privacy / terms) ───────── */
body { display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1 0 auto; }
.pagehead { padding: clamp(38px, 7vw, 72px) 0 20px; }
.pagehead__crumb { margin: 0 0 22px; }
.pagehead__crumb a { color: var(--muted); font-family: var(--mono); font-size: 13.5px; transition: color .2s; }
.pagehead__crumb a:hover { color: var(--red); }
.pagehead h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; }
.pagehead__date { font-family: var(--mono); font-size: 12.5px; color: var(--dim); margin: 14px 0 0; }
.legal--page, .about--page { padding-bottom: clamp(48px, 8vw, 88px); }
.about--page__lead { color: var(--muted); font-size: clamp(1.05rem, 2.2vw, 1.2rem); max-width: 60ch; margin: 0 0 32px; }

/* ───────── LEGAL ───────── */
.legal .section__head { margin-bottom: 26px; }
.legal__date { font-family: var(--mono); font-size: 12.5px; color: var(--dim); margin: 12px 0 0; }
.legal__body { max-width: 68ch; }
.legal__body > p { color: var(--muted); margin: 0 0 22px; }
.legal__body dl { margin: 0; display: grid; gap: 0; }
.legal__body dt { font-weight: 600; font-size: 15px; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--line-soft); }
.legal__body dt:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.legal__body dd { margin: 7px 0 0; color: var(--muted); font-size: 15.5px; }
.legal__body a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }

/* ───────── DOWNLOAD ───────── */
.download { text-align: center; }
.download__in { max-width: 620px; }
.download p { color: var(--muted); margin: 14px auto 30px; }
.download__note { font-size: 13px; color: var(--dim); margin: 20px auto 0; }

/* ───────── FOOTER ───────── */
.footer { border-top: 1px solid var(--line); padding: 40px 0 40px; margin-top: 10px; }
.footer__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer__links a { color: var(--muted); font-size: 14px; transition: color .2s; }
.footer__links a:hover { color: var(--red); }
.footer__fine { margin: 26px auto 0; padding-top: 20px; border-top: 1px solid var(--line-soft); font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* ───────── SCROLL REVEAL ───────── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ───────── RESPONSIVE ───────── */
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(15,17,21,.98); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav__links.open { max-height: 360px; }
  .nav__links a { padding: 15px 20px; border-top: 1px solid var(--line-soft); }
  .nav__cta { margin: 14px 20px; text-align: center; }
  .nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .gallery { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .cta-row .btn { flex: 1; }
}
