/* ===============================================================
   Glyph website styles
   Ink on warm paper. One editorial serif, one mono for machine text,
   one handwriting face used only inside the hero demo.
   =============================================================== */

:root {
  /* Brand palette */
  --paper: #F3EEE3;
  --surface: #FCFAF4;
  --ink: #2563EB;
  --ink-deep: #1B3A8A;
  --marigold: #D49A3F;
  --marigold-soft: #F0D9AE;
  --text: #2A2620;
  --text-secondary: #635C50;
  --hairline: #E2DACA;
  --hairline-strong: #D7CDBA;

  /* On the deep-blue hero */
  --on-ink: #F3EEE3;
  --on-ink-dim: #C2CEEC;

  /* Type families */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --hand: "Caveat", "Segoe Script", cursive;

  /* Spacing scale: 4 / 8 / 12 / 16 / 24 / 32 / 48 */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-6: 24px;
  --s-8: 32px;
  --s-12: 48px;
  --s-16: 64px;
  --s-24: 96px;

  /* Radii */
  --r-card: 20px;
  --r-btn: 16px;
  --r-input: 12px;
  --r-pill: 999px;

  --maxw: 1080px;
  --shadow-card: 0 1px 2px rgba(27, 58, 138, 0.05), 0 12px 32px rgba(27, 58, 138, 0.09);
  --shadow-float: 0 18px 50px rgba(27, 58, 138, 0.18);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.12; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; }

img, svg { display: block; max-width: 100%; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--s-6);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--marigold);
}

.section {
  padding-block: var(--s-24);
}

.section-head {
  max-width: 620px;
  margin-bottom: var(--s-12);
}

.section-head .eyebrow { color: var(--ink); }

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  margin-top: var(--s-3);
}

.section-sub {
  margin-top: var(--s-4);
  font-size: 19px;
  color: var(--text-secondary);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  padding: 15px 22px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
}
.btn-primary:hover { transform: translateY(-1px); background: var(--ink-deep); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline-strong);
}
.btn-ghost:hover { transform: translateY(-1px); border-color: var(--ink); }

/* The hero sits on the deep-blue field, so its ghost button needs light text
   and a light border to stay readable, with a soft fill on hover. */
.hero .btn-ghost {
  color: var(--on-ink);
  border-color: rgba(243, 238, 227, 0.4);
}
.hero .btn-ghost:hover {
  border-color: var(--on-ink);
  background: rgba(243, 238, 227, 0.1);
}

/* Coming soon: looks deliberate, reads as not-yet-tappable */
.btn-soon {
  background: var(--ink);
  color: var(--on-ink);
  cursor: default;
  position: relative;
}
.btn-soon[aria-disabled="true"] { opacity: 1; }
.btn-soon .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--marigold);
  box-shadow: 0 0 0 0 rgba(212, 154, 63, 0.6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(212, 154, 63, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(212, 154, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 154, 63, 0); }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 238, 227, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--s-6);
  height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand .mark {
  width: 30px; height: 30px; flex: none;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(27, 58, 138, 0.22);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-8);
  margin-left: auto;
  list-style: none;
  padding: 0; margin-block: 0;
}
.nav-links a {
  text-decoration: none;
  font-size: 16px;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  padding: 8px 14px;
  border-radius: var(--r-pill);
}
.nav-pill .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--marigold);
}
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  background: var(--ink-deep);
  color: var(--on-ink);
  padding-block: var(--s-24) var(--s-16);
  position: relative;
  overflow: hidden;
}
.hero::after {
  /* faint ruled-paper lines, very low contrast */
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 38px,
    rgba(243, 238, 227, 0.04) 38px 39px
  );
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--s-16);
  align-items: center;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin-top: var(--s-4);
  color: var(--on-ink);
}
.hero h1 .accent { color: var(--marigold); font-style: italic; }
.hero-sub {
  margin-top: var(--s-6);
  font-size: 20px;
  line-height: 1.55;
  color: var(--on-ink-dim);
  max-width: 30ch;
}
.hero-cta {
  margin-top: var(--s-8);
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
}
.hero-fine {
  margin-top: var(--s-4);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--on-ink-dim);
}

/* The signature demo: handwriting scanned into searchable text */
.demo {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
  padding: var(--s-6);
  color: var(--text);
}
.demo-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--s-3);
}
.demo-label .live {
  display: inline-flex; align-items: center; gap: 6px; color: var(--ink);
}
.demo-label .live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--marigold); }

/* The "photo" of handwriting */
.scan {
  position: relative;
  border-radius: var(--r-input);
  background:
    linear-gradient(0deg, rgba(37,99,235,0.02), rgba(37,99,235,0.02)),
    var(--paper);
  border: 1px solid var(--hairline);
  padding: var(--s-6) var(--s-6) calc(var(--s-6) + 4px);
  overflow: hidden;
  background-image: repeating-linear-gradient(
    to bottom, transparent 0 30px, var(--hairline) 30px 31px
  );
}
.scan-hand {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 32px;
  line-height: 31px;
  color: #2A4DB0;
  position: relative;
  z-index: 1;
}
.scan-line {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 30px;
  background: linear-gradient(
    to bottom,
    rgba(212,154,63,0) 0%,
    rgba(212,154,63,0.22) 60%,
    rgba(212,154,63,0.9) 100%
  );
  border-bottom: 2px solid var(--marigold);
  box-shadow: 0 0 18px 2px rgba(212,154,63,0.45);
  z-index: 2;
  opacity: 0;
}
.demo.is-playing .scan-line { animation: sweep 1.7s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes sweep {
  0% { top: -30px; opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.demo-flow {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: var(--s-4) 2px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.demo-flow .rule { height: 1px; background: var(--hairline-strong); flex: 1; }

/* The search bar with recognized text */
.search {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--paper);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-input);
  padding: 14px var(--s-4);
}
.search svg { width: 18px; height: 18px; flex: none; color: var(--ink); }
.search-text {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.01em;
  color: var(--text);
  min-height: 1.2em;
}
.search-text .hit {
  background: var(--marigold-soft);
  color: #7a5414;
  border-radius: 4px;
  padding: 1px 5px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  vertical-align: -0.18em;
  background: var(--ink);
  margin-left: 1px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Trust strip ---------- */
.strip {
  border-block: 1px solid var(--hairline);
  background: var(--surface);
}
.strip-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6) var(--s-12);
  padding-block: var(--s-6);
  align-items: center;
  justify-content: center;
}
.strip-item {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.strip-item .tick { color: var(--marigold); font-weight: 700; }

/* ---------- Outcome line ---------- */
.outcome { text-align: center; }
.outcome-line {
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.28;
  max-width: 18ch;
  margin-inline: auto;
}
.outcome-line .q { color: var(--marigold); font-style: italic; }

/* ---------- Features ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: var(--s-8);
  box-shadow: var(--shadow-card);
}
.card-ico {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--hairline-strong);
  color: var(--ink);
  margin-bottom: var(--s-4);
}
.card-ico svg { width: 22px; height: 22px; }
.card h3 { font-size: 22px; margin-bottom: var(--s-2); }
.card p { color: var(--text-secondary); font-size: 16.5px; }

/* ---------- How it works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-8);
  counter-reset: step;
}
.step { position: relative; }
.step-n {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--marigold);
  margin-bottom: var(--s-3);
}
.step h3 { font-size: 23px; margin-bottom: var(--s-2); }
.step p { color: var(--text-secondary); font-size: 16.5px; }

/* ---------- Privacy panel ---------- */
.privacy {
  background: var(--ink-deep);
  color: var(--on-ink);
  border-radius: var(--r-card);
  padding: clamp(32px, 5vw, 64px);
  position: relative;
  overflow: hidden;
}
.privacy::after {
  content: "";
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    to bottom, transparent 0 38px, rgba(243,238,227,0.045) 38px 39px
  );
  pointer-events: none;
}
.privacy-inner { position: relative; z-index: 1; max-width: 720px; }
.privacy .eyebrow { color: var(--marigold); }
.privacy h2 {
  font-size: clamp(28px, 4vw, 42px);
  margin-top: var(--s-3);
  color: var(--on-ink);
}
.privacy p {
  margin-top: var(--s-4);
  font-size: 19px;
  line-height: 1.6;
  color: var(--on-ink-dim);
}
.privacy-points {
  margin-top: var(--s-8);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}
.ppoint {
  border-top: 1px solid rgba(243,238,227,0.18);
  padding-top: var(--s-4);
}
.ppoint .k {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--marigold);
  margin-bottom: var(--s-2);
}
.ppoint .v { color: var(--on-ink); font-size: 17px; }

/* ---------- FAQ ---------- */
.faq-wrap { max-width: 760px; }
.faq {
  border-top: 1px solid var(--hairline-strong);
}
.faq:last-child { border-bottom: 1px solid var(--hairline-strong); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: var(--s-6) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  font-size: 20px;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .plus {
  flex: none;
  width: 26px; height: 26px;
  position: relative;
  color: var(--ink);
}
.faq summary .plus::before,
.faq summary .plus::after {
  content: "";
  position: absolute;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.faq summary .plus::before { top: 12px; left: 4px; right: 4px; height: 2px; }
.faq summary .plus::after { left: 12px; top: 4px; bottom: 4px; width: 2px; }
.faq[open] summary .plus::after { opacity: 0; transform: rotate(90deg); }
.faq-body {
  padding-bottom: var(--s-6);
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.6;
  max-width: 64ch;
}

/* ---------- Final CTA ---------- */
.final {
  text-align: center;
}
.final-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: clamp(40px, 6vw, 72px) var(--s-6);
  box-shadow: var(--shadow-card);
}
.final h2 {
  font-size: clamp(30px, 4.4vw, 46px);
  max-width: 16ch;
  margin-inline: auto;
}
.final p {
  margin-top: var(--s-4);
  color: var(--text-secondary);
  font-size: 19px;
}
.final .hero-cta { justify-content: center; margin-top: var(--s-8); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  padding-block: var(--s-12);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-8);
  justify-content: space-between;
  align-items: flex-start;
}
.footer .brand { font-size: 19px; }
.footer-blurb {
  margin-top: var(--s-4);
  color: var(--text-secondary);
  font-size: 15.5px;
  max-width: 34ch;
}
.footer-links {
  display: flex;
  gap: var(--s-12);
}
.footer-col h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 var(--s-4);
  font-weight: 500;
}
.footer-col a {
  display: block;
  text-decoration: none;
  color: var(--text);
  font-size: 16px;
  margin-bottom: var(--s-3);
  transition: color 0.15s ease;
}
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  margin-top: var(--s-12);
  padding-top: var(--s-6);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

/* ---------- Legal pages ---------- */
.legal {
  padding-block: var(--s-16) var(--s-24);
}
.legal-inner { max-width: 760px; }
.legal .eyebrow { color: var(--ink); }
.legal h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin-top: var(--s-3);
}
.legal .updated {
  margin-top: var(--s-4);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.legal h2 {
  font-size: 24px;
  margin-top: var(--s-12);
  margin-bottom: var(--s-3);
}
.legal h2:first-of-type { margin-top: var(--s-8); }
.legal p, .legal li {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.68;
}
.legal p { margin-top: var(--s-4); }
.legal ul { margin: var(--s-4) 0 0; padding-left: var(--s-6); }
.legal li { margin-bottom: var(--s-2); }
.legal a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.legal .lead {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--text);
  line-height: 1.6;
}
.callout {
  margin-top: var(--s-6);
  background: var(--marigold-soft);
  border: 1px solid #E6C988;
  border-radius: var(--r-input);
  padding: var(--s-4) var(--s-6);
}
.callout p { color: #6f4f17; margin-top: 0; font-size: 15.5px; }

/* ---------- Focus + motion ---------- */
:focus-visible {
  outline: 3px solid var(--marigold);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn-soon:focus-visible { outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  body { font-size: 17px; }
  .hero-grid { grid-template-columns: 1fr; gap: var(--s-12); }
  .hero-sub { max-width: none; }
  .features-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: var(--s-8); }
  .privacy-points { grid-template-columns: 1fr; gap: var(--s-4); }
  .nav-links {
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-2);
    background: var(--paper);
    border-bottom: 1px solid var(--hairline);
    padding: var(--s-4) var(--s-6) var(--s-6);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links .nav-pill { margin-top: var(--s-2); }
  .nav-toggle {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
    width: 42px; height: 42px;
    background: var(--surface);
    border: 1px solid var(--hairline-strong);
    border-radius: 12px;
    cursor: pointer;
    color: var(--ink);
  }
  .nav-toggle svg { width: 20px; height: 20px; }
  .footer-grid { flex-direction: column; gap: var(--s-12); }
  .footer-links { gap: var(--s-12); }
}

@media (max-width: 520px) {
  .container { padding-inline: var(--s-4); }
  .section { padding-block: var(--s-16); }
  .scan-hand { font-size: 27px; }
  .hero-cta .btn, .final .btn { width: 100%; justify-content: center; }
  .strip-inner { gap: var(--s-3) var(--s-6); }
}
