/* Signately — free client-side handwritten & cursive signature generator.
   Design language: fountain pen on fine stationery. Warm cream laid-paper with a
   faint horizontal rule, iron-gall ink blue-black, a single brass hairline for
   the "letterpress" detail. Cormorant Garamond (high-contrast display serif) for
   headings, Hanken Grotesk for body, and a wardrobe of cursive web-fonts for the
   signatures themselves. Deliberately unlike Barcodely (industrial mono/vermillion)
   and Invoicely (ledger green/Fraunces). */

:root {
  --ink: #191a24;            /* near-black writing ink */
  --ink-soft: #4a4c5c;
  --ink-faint: #8b8d9e;
  --paper: #f7f2e7;          /* warm cream stationery */
  --paper-2: #efe8d6;        /* deeper card cream */
  --card: #fbf8f0;
  --line: #e2dac6;
  --line-strong: #cfc6ad;
  --accent: #2c3a64;         /* iron-gall ink blue-black */
  --accent-ink: #1f2b4d;
  --accent-wash: #e7eaf3;
  --brass: #b08d57;          /* brass nib / letterpress hairline */
  --brass-soft: #d8c39a;
  --good: #3f7d57;           /* "signed" green */
  --shadow-sm: 0 1px 2px rgba(25, 26, 36, .06);
  --shadow-md: 0 18px 44px -20px rgba(25, 26, 36, .34), 0 3px 10px rgba(25,26,36,.05);
  --radius: 9px;
  --radius-sm: 5px;
  --max: 940px;
  --serif: "Cormorant Garamond", "Hoefler Text", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  /* faint ruled-paper lines + a soft ink wash up top */
  background-image:
    repeating-linear-gradient(transparent 0, transparent 31px, rgba(44,58,100,.045) 31px, rgba(44,58,100,.045) 32px),
    radial-gradient(900px 420px at 50% -220px, rgba(44,58,100,.08), transparent 70%);
  background-size: 100% 32px, 100% 100%;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

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

/* ---- Header --------------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--line-strong);
  background: rgba(247, 242, 231, .88);
  backdrop-filter: saturate(140%) blur(7px);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif);
  font-weight: 600; font-size: 23px; letter-spacing: -0.005em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
}
.brand .mark svg { width: 100%; height: 100%; }
.nav { display: flex; gap: 18px; font-size: 14px; font-weight: 500; }
.nav a { color: var(--ink-soft); }
.nav a:hover { color: var(--accent); text-decoration: none; }
.nav .nav-cta {
  color: #fff; background: var(--accent); padding: 7px 14px; border-radius: 999px;
  font-weight: 600; font-size: 13px;
}
.nav .nav-cta:hover { background: var(--accent-ink); }
@media (max-width: 680px) { .nav a:not(.nav-cta) { display: none; } }

/* ---- Hero ----------------------------------------------------------- */
.hero { padding: 52px 0 8px; }
.hero.center { text-align: center; }
.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--brass-soft);
  background: rgba(176,141,87,.07);
  padding: 5px 13px; border-radius: 999px;
  margin-bottom: 20px;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6.2vw, 3.9rem);
  line-height: 1.04; letter-spacing: -0.01em;
  margin: 0 0 16px; font-weight: 600;
}
h1 .pen { font-style: italic; color: var(--accent); }
.lede { max-width: 650px; font-size: 1.16rem; color: var(--ink-soft); margin: 0; }
.hero.center .lede { margin: 0 auto; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 7px 9px; margin-top: 22px; }
.hero.center .hero-meta { justify-content: center; }
.hero-meta span {
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px;
}

/* ---- Tool ----------------------------------------------------------- */
.tool {
  margin: 30px auto 8px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* mode tabs */
.modes { display: flex; gap: 0; border-bottom: 1px solid var(--line-strong); background: var(--paper-2); }
.mode-tab {
  flex: 1; font: inherit; font-weight: 600; font-size: 14.5px; color: var(--ink-soft);
  background: transparent; border: none; cursor: pointer; padding: 15px 14px;
  border-bottom: 2.5px solid transparent; transition: color .15s ease, border-color .15s ease, background .15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.mode-tab svg { width: 17px; height: 17px; }
.mode-tab:hover { color: var(--ink); background: rgba(176,141,87,.06); }
.mode-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); background: var(--card); }

/* the signing stage — a deckle card with a real signature line */
.stage {
  position: relative;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.5), transparent 60%),
    var(--paper-2);
  border-bottom: 1px solid var(--line-strong);
  padding: 30px 26px 26px;
  min-height: 240px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.stage::before {
  /* subtle paper grain */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}
.stage-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 560px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 14px 30px -16px rgba(25,26,36,.4), 0 2px 0 rgba(176,141,87,.18);
  padding: 30px 32px 18px;
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
}
/* the signature itself renders into this box */
.sig-render {
  min-height: 116px; display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.sig-render canvas { max-width: 100%; height: auto; display: block; }
.sig-render .placeholder { color: var(--ink-faint); font-style: italic; font-family: var(--serif); font-size: 1.3rem; padding-bottom: 14px; }
/* the contract signature line */
.sig-line { margin-top: 6px; border-top: 1.5px solid var(--ink); position: relative; padding-top: 7px; }
.sig-line::before {
  content: "×"; position: absolute; left: 0; top: -23px; font-size: 15px; color: var(--ink-soft); font-weight: 700;
}
.sig-line span { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }

/* draw pad fills the card */
.pad-wrap { position: relative; width: 100%; }
.pad-wrap canvas {
  width: 100%; height: 200px; display: block; border-radius: 3px;
  background: #fffdf8; touch-action: none; cursor: crosshair;
}
.pad-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none; color: var(--ink-faint); font-style: italic; font-family: var(--serif); font-size: 1.35rem;
  transition: opacity .2s ease;
}
.pad-wrap.has-ink .pad-hint { opacity: 0; }

/* controls */
.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 20px; padding: 20px 26px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
.field.grow { flex: 1 1 220px; }
.sig-input {
  font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 12px 15px; width: 100%;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.sig-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44,58,100,.14); }
.field select, .field input[type="range"] { font: inherit; }
.field select {
  appearance: none; font-size: 14px; font-weight: 600; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 9px 32px 9px 12px; min-width: 120px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234a4c5c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(44,58,100,.14); }
input[type="range"] { width: 140px; accent-color: var(--accent); cursor: pointer; }
.range-field .val { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

/* ink swatches */
.swatches { display: flex; gap: 8px; align-items: center; }
.swatch {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--line-strong); transition: transform .1s ease, box-shadow .12s ease;
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); transform: scale(1.08); }
.swatch.custom { position: relative; overflow: hidden; background: conic-gradient(from 0deg, #e8431f, #b08d57, #3f7d57, #2c3a64, #e8431f); }
.swatch.custom input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; }

/* font gallery (type mode) */
.fontgrid { display: grid; gap: 9px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 4px 26px 22px; }
.fontswatch {
  border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius-sm);
  padding: 10px 12px 8px; cursor: pointer; text-align: center; overflow: hidden;
  transition: border-color .12s ease, box-shadow .12s ease, transform .1s ease;
}
.fontswatch:hover { border-color: var(--brass); transform: translateY(-1px); }
.fontswatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(44,58,100,.13); }
.fontswatch .fs-name { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); margin-top: 4px; }
.fontswatch .fs-prev { font-size: 1.5rem; line-height: 1.5; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* actions */
.actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 26px 24px; }
.actions .spacer { flex: 1; }
.btn {
  font: inherit; font-weight: 600; font-size: 14px; letter-spacing: .01em;
  border: none; cursor: pointer; border-radius: var(--radius-sm);
  padding: 11px 18px; display: inline-flex; align-items: center; gap: 8px;
  transition: transform .07s ease, background .15s ease, box-shadow .15s ease, opacity .15s ease, color .15s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn-primary { color: #fff; background: var(--accent); box-shadow: 0 6px 18px -6px rgba(44,58,100,.6); }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ghost { color: var(--ink); background: var(--paper-2); border: 1.5px solid var(--line-strong); }
.btn-ghost:hover { background: #e6dec9; }
.btn-quiet { color: var(--ink-soft); background: transparent; border: 1.5px solid transparent; padding: 11px 12px; }
.btn-quiet:hover { color: var(--accent); background: rgba(44,58,100,.05); }

.noscript {
  margin: 18px 26px 24px; padding: 13px 16px; border-radius: var(--radius-sm);
  background: #fff7ec; border: 1px solid #f0d6a8; color: #7a5418; font-size: 14px;
}

/* ---- Steps ---------------------------------------------------------- */
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 22px 0 8px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.step .n {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: #fff; background: var(--accent); margin-bottom: 12px;
}
.step h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }

/* ---- Prose --------------------------------------------------------- */
.prose { margin: 46px auto; max-width: 740px; }
.prose h2 { font-family: var(--serif); font-weight: 600; font-size: 1.95rem; letter-spacing: -0.01em; margin: 40px 0 12px; }
.prose p { color: var(--ink-soft); }
.faq dt { font-weight: 700; margin-top: 22px; font-size: 1.04rem; }
.faq dd { margin: 6px 0 0; color: var(--ink-soft); }

/* ---- Hub grid ------------------------------------------------------ */
.section-title { font-family: var(--serif); font-weight: 600; font-size: 1.9rem; letter-spacing: -0.01em; margin: 46px 0 4px; }
.section-sub { max-width: 660px; color: var(--ink-soft); font-size: 1rem; margin: 4px 0 0; }
.grid { display: grid; gap: 15px; grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); margin: 20px 0 30px; }
.card {
  display: block; background: var(--card); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .16s ease, border-color .16s ease; color: inherit;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brass); text-decoration: none; }
.card .tag { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.card.is-live .tag { color: var(--good); }
.card h3 { font-family: var(--serif); margin: 8px 0 6px; font-size: 1.4rem; letter-spacing: -0.01em; font-weight: 600; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }
.card .go { display: inline-block; margin-top: 13px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.card.soon { opacity: .72; }
.card.soon .go { color: var(--ink-faint); }
/* a cursive flourish on each card */
.card .flourish { font-family: "Great Vibes", var(--serif); font-size: 2rem; color: var(--brass); line-height: 1; margin-top: 12px; opacity: .85; }

/* ---- Footer -------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line-strong); margin-top: 56px; padding: 30px 0 46px; font-size: 13.5px; color: var(--ink-faint); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 26px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.site-footer a { color: var(--ink-soft); font-weight: 500; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 500;
  padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .card:hover, .btn:active, .fontswatch:hover { transform: none; }
}
