/* ============================================================
   KemDoc — its own design system.
   Deliberately NOT the dark, orb-and-card look used by Kemnir,
   KemitPass and KemitSecurity. The product is documents, so the
   surface is paper: light ground, ruled sections, editorial serif
   headlines, and a signed-document motif instead of glow cards.
   ============================================================ */

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

:root {
  --paper:     #faf8f3;
  --paper-2:   #ffffff;
  --paper-3:   #f2efe7;
  --ink:       #16211c;
  --ink-2:     #4d5c54;
  /* --ink-3 is the lightest text on paper. It was #8a968f, which measured
     2.89:1 against --paper — below the 4.5:1 AA floor for the signup note,
     footer note and captions that use it. #626f69 measures 4.97:1. Don't
     lighten it again without re-measuring. */
  --ink-3:     #626f69;
  --rule:      #e2ddd1;
  --rule-2:    #cfc8b8;

  --seal:      #0f7f5a;   /* primary — deep signing green */
  --seal-dim:  #0b5f43;
  --seal-tint: #e6f4ee;
  --teal:      #0d7d78;
  --ink-stamp: #1f3a2f;

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1080px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Faint ruled-paper ground, the way a legal pad reads from a distance. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 47px,
    rgba(22,33,28,0.028) 47px 48px
  );
}

body > * { position: relative; z-index: 1; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

a { color: inherit; }

/* ── Type ───────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seal);
}

.display {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.display em {
  font-style: italic;
  color: var(--seal);
}

.sec-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.14;
  letter-spacing: -0.015em;
}

.lede {
  font-size: 1.08rem;
  color: var(--ink-2);
  max-width: 54ch;
}

/* ── Top bar ────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250,248,243,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  margin-right: auto;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.navlinks { display: flex; gap: 26px; }

.navlinks a {
  font-size: 0.9rem;
  color: var(--ink-2);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.navlinks a:hover { color: var(--ink); border-bottom-color: var(--rule-2); }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.burger span {
  width: 20px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.22s ease, opacity 0.18s ease;
}

.topbar.open .burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.topbar.open .burger span:nth-child(2) { opacity: 0; }
.topbar.open .burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.btn-solid { background: var(--seal); color: #fff; }
.btn-solid:hover:not(:disabled) { background: var(--seal-dim); }
.btn-solid:disabled { opacity: 0.85; cursor: default; }

.btn-line {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-2);
}
.btn-line:hover { border-color: var(--ink); }

.btn-sm { padding: 9px 16px; font-size: 0.86rem; }

/* ── Hero ───────────────────────────────────────────────── */
.hero { padding: 84px 0 72px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 64px;
  align-items: center;
}

.hero .eyebrow { display: block; margin-bottom: 20px; }
.hero .display { margin-bottom: 22px; }
.hero .lede { margin-bottom: 30px; }

/* ── Signup ─────────────────────────────────────────────── */
.signup { display: flex; gap: 8px; max-width: 460px; }

.field {
  flex: 1;
  padding: 12px 15px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field::placeholder { color: var(--ink-3); }

.field:focus {
  outline: none;
  border-color: var(--seal);
  box-shadow: 0 0 0 3px rgba(15,127,90,0.12);
}

.signup-note {
  margin-top: 12px;
  font-size: 0.84rem;
  color: var(--ink-3);
}

/* ── The document mock ──────────────────────────────────── */
.paper-stack { position: relative; }

.paper-stack::before,
.paper-stack::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.paper-stack::before { transform: rotate(-2.2deg) translate(-6px, 5px); }
.paper-stack::after  { transform: rotate(1.4deg) translate(5px, 2px); }

.sheet {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 34px 32px 28px;
  box-shadow: 0 18px 40px -24px rgba(22,33,28,0.35);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 20px;
}

.sheet-file {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
}

.lock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--seal-tint);
  color: var(--seal-dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Redacted text lines — the point being that we can't read them. */
.lines { display: flex; flex-direction: column; gap: 11px; margin-bottom: 26px; }

.line {
  height: 9px;
  border-radius: 2px;
  background: var(--paper-3);
}
.line.redact { background: var(--ink); opacity: 0.82; }
.line.w90 { width: 90%; }
.line.w70 { width: 70%; }
.line.w80 { width: 80%; }
.line.w55 { width: 55%; }

.sign-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--rule-2);
}

.sign-slot { flex: 1; }

.sign-slot svg { display: block; margin-bottom: 4px; }

.sign-caption {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-top: 6px;
  border-top: 1px solid var(--ink);
}

.seal-stamp {
  flex-shrink: 0;
  width: 92px; height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 2px solid var(--seal);
  border-radius: 50%;
  color: var(--seal);
  transform: rotate(-11deg);
  opacity: 0.9;
}

.seal-stamp .st-1 {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.seal-stamp .st-2 {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ── Sections ───────────────────────────────────────────── */
.sec { padding: 76px 0; border-top: 1px solid var(--rule); }

.sec-head { margin-bottom: 44px; max-width: 62ch; }
.sec-head .eyebrow { display: block; margin-bottom: 14px; }
.sec-head .sec-title { margin-bottom: 14px; }
.sec-head p { color: var(--ink-2); }

/* Ruled rows — the recurring content unit, in place of card grids. */
.rows { border-top: 1px solid var(--rule); }

.row {
  display: grid;
  grid-template-columns: 2.2rem 1fr 1.5fr;
  gap: 24px;
  align-items: baseline;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
}

.row-num {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--seal);
  padding-top: 3px;
}

.row-title {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.row-body { color: var(--ink-2); font-size: 0.96rem; }

.row-body code {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--seal-dim);
  background: var(--seal-tint);
  border-radius: 3px;
}

.tagline {
  display: inline-block;
  margin-top: 12px;
  padding: 2px 9px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.tagline.free { background: var(--seal-tint); color: var(--seal-dim); }
.tagline.paid { background: var(--paper-3); color: var(--ink-2); }

/* ── Callout (the honest-limits block) ──────────────────── */
.callout {
  padding: 38px 40px;
  background: var(--ink-stamp);
  color: #e8efea;
  border-radius: 4px;
}

.callout h3 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 14px;
  color: #fff;
}

.callout p { color: #b9c7c0; max-width: 68ch; }
.callout p + p { margin-top: 12px; }
.callout strong { color: #fff; font-weight: 600; }

/* ── Chips ──────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }

.chip {
  padding: 8px 15px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--ink-2);
}

/* ── Two-up split ───────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.panel {
  padding: 30px 28px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.panel h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.panel p { color: var(--ink-2); font-size: 0.96rem; }

/* ── Pricing ────────────────────────────────────────────── */
.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin-bottom: 40px;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.billing-toggle button {
  padding: 8px 18px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.billing-toggle button.on {
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(22,33,28,0.09);
}

.save-flag {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--seal);
}

.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

.tier {
  display: flex;
  flex-direction: column;
  padding: 30px 26px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.tier.pick {
  border-color: var(--seal);
  box-shadow: 0 0 0 1px var(--seal);
}

.tier-flag {
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--seal-tint);
  color: var(--seal-dim);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tier-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.tier-price {
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tier-per { font-size: 0.9rem; color: var(--ink-3); margin-bottom: 6px; }

.tier-sub {
  font-size: 0.88rem;
  color: var(--ink-2);
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  min-height: 3.6em;
}

.tier ul { list-style: none; flex: 1; margin-bottom: 24px; }

.tier li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.tier li::before {
  content: '';
  position: absolute;
  left: 1px; top: 8px;
  width: 11px; height: 6px;
  border-left: 1.8px solid var(--seal);
  border-bottom: 1.8px solid var(--seal);
  transform: rotate(-45deg);
}

.tier li strong { color: var(--ink); font-weight: 600; }
.tier .btn { width: 100%; }

/* Comparison table */
.compare-wrap { overflow-x: auto; }

table.compare {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.compare th,
table.compare td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}

table.compare thead th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule-2);
}

table.compare td:not(:first-child),
table.compare th:not(:first-child) { text-align: center; width: 17%; }

table.compare tbody th {
  font-weight: 500;
  color: var(--ink-2);
}

table.compare .yes { color: var(--seal); font-weight: 700; }
table.compare .no { color: var(--ink-3); }

/* The row that reframes the table: nobody loses vault access. */
table.compare tr.keeper th,
table.compare tr.keeper td {
  background: var(--seal-tint);
  border-bottom-color: rgba(15,127,90,0.2);
}
table.compare tr.keeper th { color: var(--ink); font-weight: 700; }

.note-line {
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--ink-3);
}

/* ── FAQ ────────────────────────────────────────────────── */
.qa { max-width: 760px; }

.qa-item { padding: 26px 0; border-bottom: 1px solid var(--rule); }

.qa-item h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.qa-item p { color: var(--ink-2); font-size: 0.97rem; }
.qa-item p + p { margin-top: 10px; }
.qa-item strong { color: var(--ink); font-weight: 600; }

/* ── Closing block ──────────────────────────────────────── */
.closing {
  padding: 60px 44px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-align: center;
}

.closing .sec-title { margin-bottom: 12px; }
.closing p { color: var(--ink-2); max-width: 48ch; margin: 0 auto 26px; }
.closing .signup { margin: 0 auto; }

/* ── Legal pages ────────────────────────────────────────── */
.legal { max-width: 720px; }

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding-bottom: 20px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-3);
}

.legal-notice {
  padding: 20px 24px;
  margin-bottom: 38px;
  background: var(--seal-tint);
  border-left: 3px solid var(--seal);
  border-radius: 0 4px 4px 0;
  font-size: 0.94rem;
  color: var(--ink-2);
}

.legal-notice strong { color: var(--ink); }

.legal h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  margin: 42px 0 14px;
}
.legal h2:first-of-type { margin-top: 0; }

.legal h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 26px 0 8px;
}

.legal p { color: var(--ink-2); margin-bottom: 14px; font-size: 0.97rem; }

.legal ul { list-style: none; margin-bottom: 16px; }

.legal li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 9px;
  color: var(--ink-2);
  font-size: 0.97rem;
}

.legal li::before {
  content: '';
  position: absolute;
  left: 2px; top: 11px;
  width: 6px; height: 1.5px;
  background: var(--seal);
}

.legal strong { color: var(--ink); font-weight: 600; }
.legal a { color: var(--seal-dim); text-decoration: underline; text-underline-offset: 2px; }
.legal code { font-family: var(--mono); font-size: 0.87rem; color: var(--seal-dim); }

/* ── Footer ─────────────────────────────────────────────── */
.foot { padding: 46px 0 38px; border-top: 1px solid var(--rule); }

.foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
}

.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }

.foot-links a {
  font-size: 0.87rem;
  color: var(--ink-2);
  text-decoration: none;
}
.foot-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.foot-note {
  margin-top: 26px;
  font-size: 0.8rem;
  color: var(--ink-3);
  max-width: 70ch;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero { padding: 56px 0 60px; }
  .split { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1.8rem 1fr; }
  .row-body { grid-column: 2; }

  .navlinks {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 6px 28px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
  }
  .topbar.open .navlinks { display: flex; }
  .navlinks a { padding: 11px 0; border-bottom: 1px solid var(--rule); }
  .burger { display: flex; }
}

@media (max-width: 560px) {
  .signup { flex-direction: column; }
  .sec { padding: 56px 0; }
  .callout, .closing { padding: 30px 24px; }
  .sheet { padding: 26px 22px 22px; }
  .sign-row { flex-direction: column; align-items: flex-start; gap: 24px; }
  .seal-stamp { align-self: flex-end; }
}
