/* ===================================================================
   WriteandBill — marketing site
   Identity: "old-fashioned notes, cutting-edge engine"
   Paper white + deep ink + brand palette (logo red/green/blue),
   blue primary accent, green confirmations, navy dark sections
   =================================================================== */

:root {
  --paper: #fbfaf7;
  --paper-soft: #f4f2ec;
  --ink: #17141f;
  --ink-soft: #4c4756;
  --line: #e5e1d8;
  --brand-red: #E01E26;
  --brand-green: #21A44E;
  --brand-blue: #1D4FD7;
  --violet: #1D4FD7;
  --violet-bright: #2E63E8;
  --violet-soft: #E3EBFC;
  --teal: #1B9445;
  --teal-soft: #D9F2E2;
  --dark: #0E1B33;
  --dark-2: #16264A;
  --on-dark: #E7EDF8;
  --on-dark-dim: #9FAECB;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", -apple-system, sans-serif;
  --hand: "Caveat", cursive;
  --radius: 14px;
  --shadow: 0 10px 40px rgba(23, 20, 31, 0.08);
  --shadow-lg: 0 24px 70px rgba(23, 20, 31, 0.14);
}

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

html { scroll-behavior: smooth; }

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

/* True Tone: ambient warm tint over the whole page, strength set by script.js
   from the time of day (neutral midday → warm evening/night) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  background: #FFB45E;
  mix-blend-mode: multiply;
  opacity: var(--truetone, 0.04);
  transition: opacity 3s ease;
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 820px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.6rem, 5.4vw, 4.2rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h1 em, h2 em { font-style: italic; color: var(--violet); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--violet);
  margin-bottom: 18px;
}
.eyebrow.light { color: #A9C7F7; }

.handwritten { font-family: var(--hand); font-size: 1.45rem; line-height: 1.4; color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 999px; white-space: nowrap;
  font-weight: 600; font-size: 0.95rem; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  font-family: var(--sans);
}
.btn-lg { padding: 15px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; text-align: center; }
.btn-primary { background: var(--violet); color: #fff; box-shadow: 0 6px 20px rgba(29, 79, 215, 0.28); }
.btn-primary:hover { background: var(--violet-bright); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(46, 99, 232, 0.35); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { color: var(--violet); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251, 250, 247, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo { height: 44px; width: auto; display: block; }
.brand-name { font-family: var(--sans); font-weight: 700; font-size: 1.18rem; letter-spacing: -0.01em; }
.brand-name .c-green { font-weight: 500; }
.c-red { color: var(--brand-red); }
.c-green { color: var(--brand-green); }
.c-blue { color: var(--brand-blue); }
.footer-logo-card { display: inline-block; background: #fff; border-radius: 12px; padding: 8px 10px; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--ink-soft); font-weight: 500; font-size: 0.94rem; transition: color 0.15s; }
.nav-links a:hover { color: var(--violet); }
.nav-cta { display: flex; gap: 10px; align-items: center; }
.nav-burger { display: none; background: none; border: none; flex-direction: column; gap: 5px; padding: 6px; cursor: pointer; }
.nav-burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 90px 0 110px; }
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 80% at 60% 20%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 60% 20%, black 0%, transparent 70%);
  opacity: 0.55;
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 60px; align-items: center;
}
.hero-copy .lede { margin: 24px 0 34px; font-size: 1.16rem; color: var(--ink-soft); max-width: 54ch; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-props { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 34px; padding: 0; }
.hero-props li { font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; gap: 7px; }
.hero-props li::before { content: "✓"; color: var(--teal); font-weight: 700; }

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--violet-bright);
  display: inline-block; animation: pulse 2s infinite;
}
.pulse-dot.green { background: var(--teal); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 99, 232, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(46, 99, 232, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 99, 232, 0); }
}

/* hero visual: the note card */
.hero-visual { position: relative; }
.note-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 26px 28px;
  transform: rotate(-1deg);
}
.note-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.note-title { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.note-date { font-size: 0.8rem; color: var(--ink-soft); }
.note-line { padding-bottom: 16px; }
.note-divider {
  display: flex; align-items: center; gap: 12px; margin: 6px 0 16px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--violet);
}
.note-divider::before, .note-divider::after { content: ""; flex: 1; height: 1px; background: var(--violet-soft); }
.note-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 0.82rem; font-weight: 600; padding: 6px 12px; border-radius: 8px;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.chip small { font-weight: 500; opacity: 0.75; font-size: 0.72rem; }
.chip-code { background: var(--violet-soft); color: var(--violet); }
.chip-dx { background: var(--paper-soft); color: var(--ink-soft); border: 1px solid var(--line); }
.chip-ok { background: var(--teal-soft); color: var(--teal); }
.note-footer { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.note-status { font-size: 0.88rem; font-weight: 600; color: var(--teal); display: flex; align-items: center; gap: 8px; }

.float-card {
  position: absolute; background: var(--dark); color: #fff;
  border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; line-height: 1.25;
  animation: floaty 5s ease-in-out infinite;
}
.float-card strong { font-family: var(--serif); font-size: 1.4rem; color: #A9C7F7; }
.float-card span { font-size: 0.75rem; color: var(--on-dark-dim); }
.float-1 { top: -26px; right: -10px; }
.float-2 { bottom: -24px; left: -14px; animation-delay: 2.5s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- stats ---------- */
.stats { background: var(--dark); color: var(--on-dark); padding: 54px 0 30px; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.stat { text-align: center; }
.stat strong { display: block; font-family: var(--serif); font-size: clamp(2rem, 3.6vw, 2.9rem); color: #A9C7F7; }
.stat span { font-size: 0.86rem; color: var(--on-dark-dim); }
.stats-note { text-align: center; font-size: 0.72rem; color: var(--on-dark-dim); opacity: 0.7; margin-top: 26px; }
.stats-note.center { color: var(--ink-soft); opacity: 0.8; margin-top: 30px; }

/* ---------- sections ---------- */
.section { padding: 100px 0; }
.section-head { max-width: 760px; margin-bottom: 56px; }
.section-sub { margin-top: 18px; color: var(--ink-soft); font-size: 1.08rem; }

/* why */
.why { background: var(--paper); }
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.why-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.why-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.why-icon { font-size: 1.7rem; margin-bottom: 14px; }
.why-card h3 { font-size: 1.18rem; margin-bottom: 10px; }
.why-card p { font-size: 0.93rem; color: var(--ink-soft); }

.founder-note {
  margin-top: 64px; text-align: center; max-width: 720px; margin-left: auto; margin-right: auto;
  padding: 40px 36px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); position: relative; transform: rotate(-0.4deg);
}
.founder-note .handwritten { font-size: 1.7rem; }
.founder-note cite { display: block; margin-top: 16px; font-style: normal; font-size: 0.86rem; font-weight: 600; color: var(--violet); }

.cred-strip {
  margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  max-width: 980px; margin-left: auto; margin-right: auto;
}
.cred {
  border-top: 3px solid var(--violet); background: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 22px 24px; display: flex; flex-direction: column; gap: 6px;
}
.cred strong { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); }
.cred span { font-size: 0.88rem; color: var(--ink-soft); }
.cred-red { border-top-color: var(--brand-red); }
.cred-blue { border-top-color: var(--brand-blue); }
.cred-green { border-top-color: var(--brand-green); }
.cred strong.c-red { color: var(--brand-red); }
.cred strong.c-blue { color: var(--brand-blue); }
.cred strong.c-green { color: var(--brand-green); }

/* platform */
.platform { background: var(--paper-soft); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.pillar {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px 30px; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pillar:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.pillar-featured { background: var(--dark); border-color: var(--dark); color: var(--on-dark); }
.pillar-num { font-family: var(--serif); font-size: 0.9rem; color: var(--violet-bright); font-weight: 700; letter-spacing: 0.1em; }
.pillar-num.c-red { color: var(--brand-red); }
.pillar-num.c-green { color: var(--brand-green); }
.pillar-featured .pillar-num { color: #A9C7F7; }
.pillar h3 { font-size: 1.45rem; margin: 8px 0 6px; }
.pillar-tag { font-family: var(--hand); font-size: 1.25rem; color: var(--violet); margin-bottom: 18px; }
.pillar-featured .pillar-tag { color: #A9C7F7; }
.pillar ul { list-style: none; margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.pillar li { font-size: 0.93rem; color: var(--ink-soft); padding-left: 24px; position: relative; }
.pillar-featured li { color: var(--on-dark-dim); }
.pillar li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }

/* ai */
.ai { background: var(--dark); color: var(--on-dark); }
.ai-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center; }
.ai h2 { color: #fff; }
.ai-copy > p { margin: 20px 0 34px; color: var(--on-dark-dim); font-size: 1.06rem; }
.ai-features { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 30px; }
.ai-feature h4 { font-size: 1rem; margin-bottom: 6px; color: #C6DAFA; }
.ai-feature p { font-size: 0.88rem; color: var(--on-dark-dim); }

.terminal {
  background: #0A1426; border: 1px solid #23375C; border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px;
  background: #101F3D; border-bottom: 1px solid #23375C;
}
.terminal-bar span { width: 11px; height: 11px; border-radius: 50%; background: #31497A; }
.terminal-bar em { margin-left: auto; font-style: normal; font-size: 0.72rem; color: #6F84AD; }
.terminal-body { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 11px; }
.terminal-body p { font-size: 0.82rem; color: #ABBEDF; }
.terminal-body strong { color: #fff; }
.t-prompt { color: #3B76F0; margin-right: 6px; }
.t-ok { color: #35C56F; margin-right: 6px; }
.t-dim { color: #5D7398; font-size: 0.74rem; }
.cursor-block {
  display: inline-block; width: 8px; height: 14px; background: #3B76F0;
  margin-left: 8px; vertical-align: middle; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* customize */
.customize-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.custom-card {
  border-left: 3px solid var(--violet); background: #fff;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 26px 24px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.custom-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.custom-card h4 { font-family: var(--serif); font-size: 1.12rem; margin-bottom: 8px; }
.custom-card p { font-size: 0.9rem; color: var(--ink-soft); }

/* stakeholders */
.stakeholders { background: var(--paper-soft); }
.stake-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.stake { text-align: center; padding: 30px 20px; }
.stake-icon { font-size: 2rem; display: block; margin-bottom: 14px; }
.stake h4 { font-family: var(--serif); font-size: 1.15rem; margin-bottom: 8px; }
.stake p { font-size: 0.9rem; color: var(--ink-soft); }

/* compare */
.compare-table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.compare-table { width: 100%; border-collapse: collapse; background: #fff; min-width: 640px; }
.compare-table th, .compare-table td { padding: 18px 22px; text-align: left; font-size: 0.94rem; border-bottom: 1px solid var(--line); }
.compare-table thead th { font-family: var(--serif); font-size: 1.05rem; background: var(--paper-soft); }
.compare-table td:first-child { font-weight: 600; width: 20%; color: var(--ink-soft); }
.compare-table .col-wb { background: var(--violet-soft); color: var(--ink); font-weight: 500; }
.compare-table thead .col-wb { color: var(--violet); font-weight: 700; }
.compare-table td:last-child { color: var(--ink-soft); }
.compare-table tbody tr:last-child td { border-bottom: none; }

/* voices */
.voices { background: var(--paper); }
.voice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.voice {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px; box-shadow: var(--shadow);
}
.voice blockquote { font-family: var(--hand); font-size: 1.45rem; line-height: 1.35; }
.voice figcaption { margin-top: 18px; display: flex; flex-direction: column; }
.voice figcaption strong { font-size: 0.92rem; }
.voice figcaption span { font-size: 0.8rem; color: var(--ink-soft); }

/* faq */
.faq { background: var(--paper-soft); }
.faq-list { display: flex; flex-direction: column; gap: 14px; }
.faq-item {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 24px;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: 20px 0;
  font-family: var(--serif); font-weight: 600; font-size: 1.08rem;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-item summary::after { content: "+"; font-size: 1.5rem; color: var(--violet); transition: transform 0.2s ease; flex-shrink: 0; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { padding: 0 0 22px; color: var(--ink-soft); font-size: 0.96rem; }

/* contact */
.contact { background: var(--dark); color: var(--on-dark); }
.contact-inner { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 64px; align-items: start; }
.contact h2 { color: #fff; font-size: clamp(2.2rem, 4vw, 3.2rem); }
.contact-copy p { margin: 20px 0 28px; color: var(--on-dark-dim); font-size: 1.08rem; }
.contact-points { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.contact-points li { padding-left: 26px; position: relative; color: var(--on-dark); font-size: 0.98rem; }
.contact-points li::before { content: "✓"; position: absolute; left: 0; color: #35C56F; font-weight: 700; }

.contact-form {
  background: #fff; color: var(--ink); border-radius: var(--radius);
  padding: 34px 32px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  display: flex; flex-direction: column; gap: 18px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label { display: flex; flex-direction: column; gap: 7px; font-size: 0.85rem; font-weight: 600; }
.contact-form input, .contact-form select, .contact-form textarea {
  font-family: var(--sans); font-size: 0.95rem; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper);
  color: var(--ink); transition: border-color 0.15s;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--violet-bright);
}
.form-note { font-size: 0.8rem; color: var(--ink-soft); text-align: center; }

/* footer */
.footer { background: #0A1426; color: var(--on-dark-dim); padding: 64px 0 0; }
.footer-inner { display: grid; grid-template-columns: 1.2fr 2fr; gap: 60px; padding-bottom: 48px; }
.footer-brand p { margin-top: 16px; font-size: 0.88rem; line-height: 1.6; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols h5 { color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.footer-cols a { display: block; color: var(--on-dark-dim); text-decoration: none; font-size: 0.9rem; margin-bottom: 10px; transition: color 0.15s; }
.footer-cols a:hover { color: #A9C7F7; }
.footer-base {
  display: flex; justify-content: space-between; padding-top: 22px; padding-bottom: 26px;
  border-top: 1px solid #1B2B4D; font-size: 0.8rem;
}

/* ---------- reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.no-anim { transition: none; }
.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }
.delay-3 { transition-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .float-card, .pulse-dot, .cursor-block { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .hero-inner, .ai-inner, .contact-inner { grid-template-columns: 1fr; gap: 48px; }
  .why-grid, .customize-grid, .stake-grid { grid-template-columns: repeat(2, 1fr); }
  .pillars, .voice-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 560px; }
}

@media (max-width: 720px) {
  .section { padding: 68px 0; }
  .hero { padding: 56px 0 80px; }
  .nav-links, .nav-cta .btn-ghost { display: none; }
  .nav-inner { gap: 10px; padding: 12px 16px; }
  .brand-name { font-size: 1rem; }
  .brand-logo { height: 36px; }
  .brand { gap: 8px; }
  .nav-cta { margin-left: auto; }
  .nav-cta .btn { padding: 9px 16px; font-size: 0.88rem; }
  .nav-burger { display: flex; }
  .nav-links.open {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 18px 24px; gap: 16px;
  }
  .why-grid, .customize-grid, .stake-grid, .form-row, .cred-strip { grid-template-columns: 1fr; }
  .float-1 { top: -18px; right: 4px; }
  .float-2 { bottom: -16px; left: 4px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .footer-base { flex-direction: column; gap: 6px; }
}
