/* ============================================================================
   KeyVault — site styles
   One small stylesheet, served from same origin (lets the CSP stay strict:
   no inline styles, no external resources). Tokens mirror the app's
   constants.js so the site and product read as one brand.
   ========================================================================== */

:root {
  /* Antique brass on warm vault-dark — from KeyVaultApp53/src/constants.js */
  --bg:        #1a1410;
  --bg-deep:   #120d0a;
  --card:      #2a1f17;
  --card-elev: #352819;
  --ink:       #f4e9d8;
  --ink-dim:   #9c8b73;
  --gold:      #d2a24c;
  --gold-deep: #a87b30;
  --gold-bright:#e8c97e;
  --rule:      #3d2e22;
  --rule-light:#4d3b2c;

  /* Type scale (~1.25 minor third), rem-based on a 16px root */
  --t-sm:   0.875rem;   /* 14px  fine print */
  --t-base: 1.0625rem;  /* 17px  body */
  --t-md:   1.25rem;    /* 20px  lead / h3 */
  --t-lg:   1.5rem;     /* 24px  h2 */
  --t-xl:   1.875rem;   /* 30px  page h1 */
  --t-2xl:  clamp(2.25rem, 5vw + 1rem, 3.25rem); /* hero wordmark */

  /* Spacing scale (8px base) */
  --s-1: 0.25rem; --s-2: 0.5rem;  --s-3: 0.75rem; --s-4: 1rem;
  --s-6: 1.5rem;  --s-8: 2rem;    --s-12: 3rem;   --s-16: 4rem;  --s-24: 6rem;

  --radius:    12px;
  --radius-lg: 20px;
  --radius-sm: 8px;
  --maxw: 1080px;
  --measure: 720px; /* comfortable reading width */

  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ---- Reset / base ---------------------------------------------------------*/
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", sans-serif;
  font-size: var(--t-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Visible focus for keyboard users on every interactive element */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--bg-deep);
  padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 700; z-index: 100;
}
.skip:focus { left: 0; }

/* ---- Layout ---------------------------------------------------------------*/
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--s-6); }
main { flex: 1 0 auto; }
.section { padding-block: var(--s-16); }
.section--tight { padding-block: var(--s-12); }

/* ---- Site header / nav ----------------------------------------------------*/
.site-header { border-bottom: 1px solid var(--rule); background: rgba(18,13,10,0.6); }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); padding-block: var(--s-4); }
.nav__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; }
.nav__brand svg { width: 28px; height: 28px; }
.nav__brand .mark { color: var(--gold); }
.nav__links { display: flex; gap: var(--s-6); align-items: center; }
.nav__links a { color: var(--ink-dim); font-weight: 600; font-size: 0.95rem; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.nav__links a.nav-beta { color: var(--bg-deep); background: var(--gold); padding: 7px 14px; border-radius: 8px; font-weight: 700; }
.nav__links a.nav-beta:hover { background: var(--gold-bright); color: var(--bg-deep); }

.wordmark .k { color: var(--ink); }
.wordmark .v { color: var(--gold); }

/* ---- Hero -----------------------------------------------------------------*/
.hero { text-align: center; padding-block: clamp(3rem, 8vw, 6rem) var(--s-12); position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(1100px 520px at 50% -8%, rgba(210,162,76,0.12), transparent 62%);
}
.hero__mark { width: 96px; height: 96px; margin: 0 auto var(--s-6); }
.hero__title { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -0.02em; margin: 0; line-height: 1.05; }
.hero__tagline { color: var(--gold); font-weight: 600; font-size: var(--t-md); margin: var(--s-3) 0 0; letter-spacing: 0.01em; }
.hero__pitch { max-width: 38ch; margin: var(--s-6) auto 0; color: var(--ink-dim); font-size: var(--t-md); }

/* ---- Store badges (honest coming-soon state) ------------------------------*/
.badges { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: center; margin-top: var(--s-8); }
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--rule-light); border-radius: var(--radius);
  padding: 10px 18px; background: var(--card); color: var(--ink);
  cursor: default;
}
.badge svg { width: 22px; height: 22px; flex: none; }
.badge__txt { text-align: left; line-height: 1.2; }
.badge__small { display: block; font-size: 0.72rem; color: var(--ink-dim); letter-spacing: 0.02em; }
.badge__big { display: block; font-size: 0.98rem; font-weight: 700; }
.badge__note { margin-top: var(--s-4); font-size: var(--t-sm); color: var(--ink-dim); }
.badge__note strong { color: var(--gold); font-weight: 700; }
.beta-invite { margin-top: var(--s-4); }
.beta-cta { display: inline-block; color: var(--gold); font-weight: 700; border: 1px solid var(--rule-light); border-radius: var(--radius); padding: 10px 20px; }
.beta-cta:hover { border-color: var(--gold); background: var(--card); text-decoration: none; }

/* ---- Section heading ------------------------------------------------------*/
.section-label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); margin: 0 0 var(--s-3); }
.section-label::before { content: ""; width: 16px; height: 2.5px; border-radius: 2px; background: var(--gold); }
.section-title { font-size: var(--t-lg); font-weight: 700; margin: 0 0 var(--s-2); letter-spacing: -0.01em; }
.section-intro { color: var(--ink-dim); max-width: 56ch; margin: 0 0 var(--s-8); }

/* ---- Feature cards --------------------------------------------------------*/
.grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius-lg);
  padding: var(--s-6); transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.card:hover { border-color: var(--rule-light); transform: translateY(-2px); }
.card__icon { width: 40px; height: 40px; margin-bottom: var(--s-4); color: var(--gold); }
.card__icon svg { width: 100%; height: 100%; }
.card h3 { font-size: var(--t-md); margin: 0 0 var(--s-2); font-weight: 700; }
.card p { margin: 0; color: var(--ink-dim); font-size: 1rem; }

/* ---- How it works strip ---------------------------------------------------*/
.steps { display: grid; gap: var(--s-6); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.step { position: relative; padding-left: 52px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid var(--gold); color: var(--gold);
  font-weight: 800; font-size: 1rem;
}
.step h3 { font-size: 1.05rem; margin: 0 0 var(--s-1); }
.step p { margin: 0; color: var(--ink-dim); font-size: 0.95rem; }

/* ---- Privacy promise band -------------------------------------------------*/
.band { background: var(--bg-deep); border-block: 1px solid var(--rule); }
.band__inner { text-align: center; padding-block: var(--s-12); }
.band__lock { width: 44px; height: 44px; color: var(--gold); margin: 0 auto var(--s-4); }
.band h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 800; margin: 0; letter-spacing: -0.01em; }
.band h2 .accent { color: var(--gold); }
.band p { color: var(--ink-dim); max-width: 52ch; margin: var(--s-4) auto 0; }

/* ---- Footer ---------------------------------------------------------------*/
.site-footer { border-top: 1px solid var(--rule); color: var(--ink-dim); font-size: var(--t-sm); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-8); align-items: center; justify-content: space-between; padding-block: var(--s-8); }
.site-footer .brandline { font-weight: 700; color: var(--ink); }
.site-footer .brandline .v { color: var(--gold); }
.site-footer nav { display: flex; gap: var(--s-6); flex-wrap: wrap; }
.site-footer nav a { color: var(--ink-dim); font-weight: 600; }
.site-footer nav a:hover { color: var(--ink); text-decoration: none; }
.site-footer .copy { width: 100%; color: var(--ink-dim); padding-bottom: var(--s-6); margin-top: calc(-1 * var(--s-2)); }

/* ============================================================================
   Document pages (privacy / support / 404)
   ========================================================================== */
.doc { max-width: var(--measure); }
.doc-head { border-bottom: 1px solid var(--rule); padding-bottom: var(--s-6); margin-bottom: var(--s-8); }
.eyebrow { font-size: var(--t-sm); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.eyebrow a { color: inherit; }
.doc h1 { font-size: var(--t-xl); line-height: 1.15; margin: var(--s-3) 0 var(--s-2); font-weight: 800; letter-spacing: -0.01em; }
.doc .meta { color: var(--ink-dim); font-size: var(--t-sm); margin: 0; }
.doc h2 { font-size: var(--t-md); color: var(--gold); margin: var(--s-12) 0 var(--s-3); font-weight: 700; }
.doc h3 { font-size: var(--t-base); margin: var(--s-6) 0 var(--s-2); font-weight: 700; }
.doc p { margin: 0 0 var(--s-4); }
.doc ul { margin: 0 0 var(--s-4); padding-left: 1.4rem; }
.doc li { margin: 0 0 var(--s-2); }
.doc strong { color: var(--ink); }
.doc a { color: var(--gold); }
.doc hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-8) 0; }
.doc code {
  background: var(--bg-deep); border: 1px solid var(--rule); border-radius: 4px;
  padding: 1px 6px; font-size: 0.88em; color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.lede {
  background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm); padding: var(--s-4) var(--s-6); margin: 0 0 var(--s-8); color: var(--ink);
}
.lede p:last-child { margin-bottom: 0; }

.doc table { width: 100%; border-collapse: collapse; margin: 0 0 var(--s-6); font-size: 0.95rem; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.doc th { color: var(--gold); font-weight: 700; }
.doc td:first-child { white-space: nowrap; color: var(--ink); font-weight: 600; }

/* Contact card + mail button (support) */
.contact-card { background: var(--card); border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-radius: var(--radius-sm); padding: var(--s-6); margin: 0 0 var(--s-6); }
.contact-card p { margin: 0 0 var(--s-2); }
.mail-btn { display: inline-block; margin-top: var(--s-3); background: var(--gold); color: var(--bg-deep); font-weight: 700; padding: 11px 22px; border-radius: var(--radius-sm); }
.mail-btn:hover { background: var(--gold-bright); text-decoration: none; }
.fineprint { color: var(--ink-dim); font-size: var(--t-sm); }

/* FAQ accordion (native <details>, works with no JS) */
.faq { border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 2px var(--s-6); margin: 0 0 var(--s-3); background: var(--card); }
.faq summary { cursor: pointer; padding: var(--s-4) 0; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-weight: 400; font-size: 1.5rem; line-height: 1; transition: transform 0.2s var(--ease); }
.faq[open] summary { color: var(--gold); }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 var(--s-4); color: var(--ink-dim); }

/* 404 */
.notfound { text-align: center; padding-block: var(--s-24); }
.notfound .mark { width: 80px; height: 80px; margin: 0 auto var(--s-6); }
.notfound .code { font-size: 3rem; font-weight: 800; color: var(--gold); margin: 0; letter-spacing: -0.02em; }
.notfound h1 { font-size: var(--t-lg); margin: var(--s-2) 0 var(--s-4); }
.notfound p { color: var(--ink-dim); max-width: 40ch; margin: 0 auto var(--s-8); }
.btn { display: inline-block; background: var(--gold); color: var(--bg-deep); font-weight: 700; padding: 12px 26px; border-radius: var(--radius); }
.btn:hover { background: var(--gold-bright); text-decoration: none; }

/* ---- Responsive -----------------------------------------------------------*/
@media (max-width: 560px) {
  :root { --t-base: 1rem; }
  .container { padding-inline: var(--s-4); }
  .nav__links { gap: var(--s-4); }
  .section { padding-block: var(--s-12); }
  .site-footer__inner { flex-direction: column; align-items: flex-start; }
  /* Let table cells wrap so the permissions table never forces a sideways scroll */
  .doc td:first-child { white-space: normal; }
  .doc table { font-size: 0.9rem; }
  .doc th, .doc td { padding: 8px 8px; }
}
