/* Draftwell marketing site — Concord-derived system:
   greige paper, single cobalt accent, high-contrast editorial serif headings. */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/Newsreader-Italic-Variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Shared brand tokens — keep byte-identical to frontend/src/tokens.css
     (enforced by frontend/src/tokens.test.ts). */
  --desk: #e9e7e1;
  --panel: #f4f3ef;
  --sheet: #fdfdfb;
  --ink: #141410;
  --muted: #5f5d55;
  --line: rgba(20, 20, 16, 0.16);
  --accent: #b43a2b;
  --accent-deep: #8f2a20;
  --accent-tint: #f6e7e3;
  --error: #8a1c3d;
  --green: #2f6f4f;
  --amber: #9c621d;
  --serif: "Newsreader", "Noto Serif SC", "PingFang SC", "Microsoft YaHei", "SimSun", Georgia, serif;
  --sans: "Instrument Sans", "PingFang SC", "Microsoft YaHei", "SimSun", "Noto Sans SC", sans-serif;
  --mono: "IBM Plex Mono", "PingFang SC", "Microsoft YaHei", monospace;

  /* Marketing-only tokens. */
  /* Interactive controls get a 2px softened corner; surfaces stay square.
     Kept in sync with frontend/src/tokens.css (--radius-control). */
  --radius-control: 2px;
  --black: #0c0c0a;
  --doc-serif: "Times New Roman", Times, serif;
  --container: 1480px;
  --gutter: 40px;
}

/* Instrument Sans (variable, weights 400–600) — self-hosted, OFL 1.1 */
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-latinExt.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/InstrumentSans-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* IBM Plex Mono (400/500/600 statics) — self-hosted, OFL 1.1 */
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-400-latinExt.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-500-latinExt.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-600-latinExt.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-600-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--desk);
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; letter-spacing: -0.015em; }

a { color: inherit; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1;
  padding: 12px 22px;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-solid { background: var(--accent); color: #fff; }
.btn-solid:hover { background: var(--accent-deep); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--desk); }
.btn-paper { background: var(--desk); color: var(--ink); }
.btn-paper:hover { background: #fff; }
.btn-lg { padding: 16px 34px; font-size: 1.0625rem; }
.btn-block { display: block; text-align: center; margin-top: auto; }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--desk);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links > a:not(.btn) {
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--muted);
}
.nav-links > a:not(.btn):hover { color: var(--ink); }
.nav-links .btn + .btn { margin-left: -12px; }

/* ---------- Hero (left-aligned, asymmetric) ---------- */
.hero { position: relative; padding: 84px 0 80px; overflow: hidden; }
.hero-inner { position: relative; }
.eyebrow {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero h1 { font-size: clamp(3rem, 6.2vw, 4.25rem); letter-spacing: -0.02em; }
.hero-sub {
  max-width: 660px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 1.1875rem;
}
.hero-cta {
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}
.cta-note { font-size: 0.9375rem; color: var(--muted); }

/* ---------- Demo panel ---------- */
.demo {
  position: relative;
  margin-top: 60px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.demo-bar {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.demo-panes {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.3fr;
}
.pane {
  padding: 26px 24px 30px;
  border-right: 1px solid var(--line);
  opacity: 0.38;
  transition: opacity 0.5s ease;
}
.pane:last-child { border-right: 0; }
.pane.active { opacity: 1; }
.pane.done { opacity: 0.72; }
.pane-label {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pane-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.75rem;
}
.pane.active .pane-label { color: var(--accent); }
.pane-hint { font-size: 0.8125rem; color: var(--muted); margin-top: 16px; }

.fake-input {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 13px 14px;
  font-size: 1rem;
  min-height: 48px;
}
.caret {
  display: inline-block;
  width: 1px;
  height: 1.05em;
  background: var(--ink);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.comp-list { list-style: none; }
.comp-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.comp-list li.shown { opacity: 1; transform: none; }
.comp-list li em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}
.tick {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  position: relative;
  top: 2px;
}
li.ticked .tick { background: var(--accent); border-color: var(--accent); }
li.ticked .tick::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.doc-page {
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 22px 24px 26px;
  min-height: 240px;
  font-family: var(--doc-serif);
}
.doc-h {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.doc-h2 { margin-top: 18px; opacity: 0; transition: opacity 0.5s ease; }
.doc-h2.shown { opacity: 1; }
.doc-text { font-size: 0.875rem; line-height: 1.65; min-height: 92px; }
.cite {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--accent);
  border: 1px solid rgba(180, 58, 43, 0.45);
  border-radius: 8px;
  padding: 0 4px;
  margin: 0 0 0 3px;
  vertical-align: 2px;
  animation: pop 0.3s ease;
}
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
.doc-skeleton { display: none; }
.doc-skeleton.shown { display: block; }
.doc-skeleton span {
  display: block;
  height: 8px;
  background: rgba(20, 20, 16, 0.1);
  margin-bottom: 8px;
}
.doc-skeleton span:last-child { width: 62%; }

/* ---------- Section headings (Concord accent-bar) ---------- */
.rule-h {
  font-size: clamp(2.1rem, 4vw, 3rem);
  padding-left: 22px;
  border-left: 3px solid var(--accent);
  margin-bottom: 56px;
}
.rule-h-dark { color: var(--desk); }

/* ---------- How it works ---------- */
.how { padding: 110px 0; }
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.step {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 30px 28px 34px;
}
.step .step-num {
  font-family: var(--serif);
  font-size: 2.1rem;
  color: var(--accent);
  margin-bottom: 14px;
}
.step h3 { font-size: 1.6rem; margin-bottom: 12px; }
.step p:not(.step-num) { color: var(--muted); font-size: 0.9688rem; }

/* ---------- Trust ---------- */
.trust { background: var(--black); color: var(--desk); padding: 110px 0; }
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid rgba(233, 231, 225, 0.2);
}
.trust-grid article {
  padding: 34px 30px 10px 0;
  border-right: 1px solid rgba(233, 231, 225, 0.2);
}
.trust-grid article:last-child { border-right: 0; padding-right: 0; }
.trust-grid article + article { padding-left: 30px; }
.trust-grid h3 { font-size: 1.75rem; margin-bottom: 14px; }
.trust-grid p { color: rgba(233, 231, 225, 0.72); font-size: 0.9688rem; }

/* ---------- Pricing ---------- */
.pricing { padding: 110px 0; }
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  align-items: stretch;
}
.price-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 32px 30px 34px;
}
.price-card-pro { border: 2px solid var(--accent); background: #fff; }
.price-card h3 { font-size: 1.9rem; }
.price-for { font-size: 0.875rem; color: var(--muted); margin: 4px 0 22px; }
.price { margin-bottom: 24px; }
.price-big { font-family: var(--serif); font-size: 2.2rem; }
.price-term { font-size: 0.875rem; color: var(--muted); }
.price-card ul { list-style: none; margin-bottom: 30px; }
.price-card li {
  font-size: 0.9063rem;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.price-card li:last-child { border-bottom: 0; }

/* ---------- Closing CTA ---------- */
.closing { background: var(--accent); color: #fff; padding: 92px 0; }
.closing-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.closing h2 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }

/* ---------- Footer ---------- */
.footer { padding: 44px 0 52px; border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--muted);
}
.footer a { color: var(--muted); }
.footer-note { max-width: 460px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .demo-panes { grid-template-columns: 1fr; }
  .pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .pane:last-child { border-bottom: 0; }
  .steps, .price-grid, .trust-grid { grid-template-columns: 1fr; }
  .trust-grid article {
    border-right: 0;
    border-bottom: 1px solid rgba(233, 231, 225, 0.2);
    padding: 30px 0;
  }
  .trust-grid article + article { padding-left: 0; }
  .trust-grid article:last-child { border-bottom: 0; }
  .hero { padding-top: 60px; }
  .hero h1 { font-size: clamp(2.6rem, 10vw, 3.4rem); }
  .nav-links { gap: 16px; }
  .nav-links > a:not(.btn) { display: none; }
  .closing-inner { justify-content: center; text-align: center; }
}

/* ---------- Entrance motion (approved: hero rise+fade on load, one-time
   section reveal on first scroll; nothing looping, nothing decorative) ---------- */
@keyframes hero-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hero-inner { animation: hero-rise 0.5s ease-out both; }
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.45s ease-out, transform 0.45s ease-out; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caret { animation: none; }
  .comp-list li, .pane, .doc-h2 { transition: none; }
  .cite { animation: none; }
  .hero-inner { animation: none; }
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
}
