/* ClearInvoice — the calm ledger */
:root {
  --paper: #FAF7F0;
  --paper-deep: #F3EEE3;
  --ink: #0C333B;
  --ink-deep: #05404A;
  --teal: #145761;
  --mint: #7DC7AB;
  --mint-wash: #E4F1E9;
  --rule: #DDD5C5;
  --rule-soft: #E9E3D6;
  --red: #B3543F;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Instrument Sans", -apple-system, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

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

::selection { background: var(--mint); color: var(--ink-deep); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule-soft);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; max-width: 1080px; margin: 0 auto;
}
.logo {
  font-family: var(--serif); font-weight: 600; font-size: 22px;
  color: var(--ink-deep); text-decoration: none; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 10px;
}
.logo-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--teal); position: relative; flex-shrink: 0;
}
.logo-mark::after {
  content: ""; position: absolute; left: 6px; right: 6px; top: 8px;
  height: 2px; background: var(--mint);
  box-shadow: 0 5px 0 var(--mint), 0 10px 0 rgba(125,199,171,.45);
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500;
  border-bottom: 2px solid transparent; padding-bottom: 2px;
  transition: border-color .2s;
}
.nav-links a:hover { border-color: var(--mint); }
.nav-cta {
  background: var(--teal); color: var(--paper) !important;
  padding: 9px 18px; border-radius: 100px; border: none !important;
  transition: background .2s;
}
.nav-cta:hover { background: var(--ink-deep); }
@media (max-width: 720px) { .nav-links a:not(.nav-cta) { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(to bottom, transparent 0 35px, var(--rule-soft) 35px 36px),
    var(--paper);
  border-bottom: 1px solid var(--rule);
}
.hero-inner {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px;
  align-items: center; padding: 88px 24px 96px;
  max-width: 1080px; margin: 0 auto;
}
.kicker {
  font-family: var(--mono); font-size: 13px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--teal);
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.kicker::before { content: ""; width: 34px; height: 1px; background: var(--teal); }
h1 {
  font-family: var(--serif); font-weight: 560;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.04; letter-spacing: -0.025em; color: var(--ink-deep);
  margin-bottom: 26px;
}
h1 em {
  font-style: italic; font-weight: 400; color: var(--teal);
  position: relative; white-space: nowrap;
}
h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px;
  height: 10px; background: var(--mint); opacity: .35; z-index: -1;
}
.hero-sub { font-size: 19px; max-width: 46ch; color: #3D5A5E; margin-bottom: 36px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink-deep); color: var(--paper); text-decoration: none;
  font-weight: 600; font-size: 16px; padding: 15px 26px; border-radius: 100px;
  transition: transform .15s, background .2s;
}
.btn-primary:hover { background: var(--teal); transform: translateY(-1px); }
.btn-primary .apple { font-size: 20px; line-height: 1; }
.btn-note { font-family: var(--mono); font-size: 13px; color: #6B7F80; }
.hero-vow {
  margin-top: 40px; display: flex; gap: 22px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 13px; color: var(--teal);
}
.hero-vow span { display: flex; gap: 7px; align-items: baseline; }
.hero-vow b { color: var(--mint); font-weight: 700; }

/* invoice mock */
.doc-stage { position: relative; perspective: 1200px; }
.doc {
  background: #fff; border: 1px solid var(--rule);
  border-radius: 6px; padding: 30px 30px 26px;
  box-shadow: 24px 32px 60px rgba(5,64,74,.14), 2px 4px 12px rgba(5,64,74,.08);
  transform: rotate(1.6deg);
  font-size: 13px; max-width: 400px; margin-left: auto;
  animation: settle 1s cubic-bezier(.2,.8,.25,1) both .15s;
}
@keyframes settle {
  from { opacity: 0; transform: rotate(4deg) translateY(26px); }
  to   { opacity: 1; transform: rotate(1.6deg) translateY(0); }
}
.doc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.doc-title { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink-deep); }
.doc-no { font-family: var(--mono); font-size: 12px; color: var(--teal); }
.doc-row {
  display: flex; justify-content: space-between; padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft); color: #40585B;
}
.doc-row b { color: var(--ink-deep); font-weight: 600; }
.doc-total {
  display: flex; justify-content: space-between; padding-top: 14px;
  font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink-deep);
}
.doc-pay {
  margin-top: 18px; background: var(--mint-wash); border-radius: 5px;
  padding: 12px 14px; font-size: 12px; line-height: 1.5; color: #2A5A50;
}
.doc-pay b { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; display: block; margin-bottom: 3px; }
.stamp {
  position: absolute; top: -18px; right: -14px;
  font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: .12em;
  color: var(--teal); border: 2.5px solid var(--teal); border-radius: 6px;
  padding: 7px 13px; transform: rotate(-8deg); background: rgba(250,247,240,.9);
  animation: stamp .5s cubic-bezier(.3,1.6,.5,1) both .9s;
}
@keyframes stamp {
  from { opacity: 0; transform: rotate(-8deg) scale(2); }
  to   { opacity: 1; transform: rotate(-8deg) scale(1); }
}
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; padding: 64px 24px 72px; }
  .doc { margin: 0 auto; }
  .stamp { right: 6px; }
}

/* ---------- sections ---------- */
section { padding: 96px 0; }
.sec-label {
  font-family: var(--mono); font-size: 13px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 16px;
}
h2 {
  font-family: var(--serif); font-weight: 560;
  font-size: clamp(30px, 4vw, 44px); line-height: 1.12;
  letter-spacing: -0.02em; color: var(--ink-deep);
  max-width: 22ch; margin-bottom: 20px;
}
.lede { font-size: 18px; color: #3D5A5E; max-width: 58ch; }

/* ledger: never / always */
.ledger {
  margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--rule); border-radius: 10px; overflow: hidden;
  background: #fff;
}
.ledger-col { padding: 36px 38px; }
.ledger-col + .ledger-col { border-left: 1px solid var(--rule); }
.ledger-col h3 {
  font-family: var(--mono); font-size: 13px; letter-spacing: .16em;
  text-transform: uppercase; margin-bottom: 22px;
}
.ledger-col.never h3 { color: var(--red); }
.ledger-col.always h3 { color: var(--teal); }
.ledger-col ul { list-style: none; }
.ledger-col li {
  padding: 13px 0 13px 30px; border-bottom: 1px solid var(--rule-soft);
  position: relative; font-size: 16px; line-height: 1.5;
}
.ledger-col li:last-child { border-bottom: none; }
.ledger-col li::before {
  position: absolute; left: 0; top: 13px; font-family: var(--mono); font-weight: 700;
}
.never li { color: #5A5148; }
.never li::before { content: "×"; color: var(--red); font-size: 18px; top: 10px; }
.never li s { text-decoration-color: rgba(179,84,63,.5); text-decoration-thickness: 1.5px; }
.always li::before { content: "✓"; color: var(--teal); }
@media (max-width: 760px) {
  .ledger { grid-template-columns: 1fr; }
  .ledger-col + .ledger-col { border-left: none; border-top: 1px solid var(--rule); }
}

.why-note {
  margin-top: 30px; font-size: 16px; color: #52696C; max-width: 62ch;
}
.why-note strong { color: var(--ink-deep); }

/* features */
.alt { background: var(--paper-deep); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.feat-grid {
  margin-top: 52px; display: grid;
  grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--rule); border: 1px solid var(--rule); border-radius: 10px;
  overflow: hidden;
}
.feat {
  background: var(--paper); padding: 30px 28px;
  transition: background .2s;
}
.feat:hover { background: #fff; }
.feat .no {
  font-family: var(--mono); font-size: 12px; color: var(--mint);
  font-weight: 700; letter-spacing: .1em; display: block; margin-bottom: 14px;
}
.feat h3 {
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  color: var(--ink-deep); margin-bottom: 8px; letter-spacing: -0.01em;
}
.feat p { font-size: 15px; color: #52696C; }
@media (max-width: 860px) { .feat-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .feat-grid { grid-template-columns: 1fr; } }

/* pricing */
.price-grid {
  margin-top: 52px; display: grid; grid-template-columns: 1fr 1.15fr;
  gap: 26px; align-items: stretch; max-width: 860px;
}
.plan {
  background: #fff; border: 1px solid var(--rule); border-radius: 12px;
  padding: 38px 36px; display: flex; flex-direction: column;
}
.plan.pro { border: 2px solid var(--teal); position: relative; box-shadow: 0 18px 44px rgba(5,64,74,.10); }
.plan-flag {
  position: absolute; top: -13px; left: 32px;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .12em;
  background: var(--teal); color: var(--paper); padding: 4px 12px; border-radius: 100px;
}
.plan h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--ink-deep); }
.plan .tag { font-family: var(--mono); font-size: 13px; color: var(--teal); margin: 6px 0 24px; }
.plan ul { list-style: none; flex: 1; }
.plan li {
  padding: 10px 0 10px 28px; font-size: 15.5px; position: relative;
  border-bottom: 1px solid var(--rule-soft);
}
.plan li:last-child { border: none; }
.plan li::before {
  content: "✓"; position: absolute; left: 0; font-family: var(--mono);
  color: var(--mint); font-weight: 700;
}
.plan li.dim { color: #8A9694; }
.plan li.dim::before { content: "—"; color: #C4BFB2; }
.plan .plan-cta {
  margin-top: 26px; text-align: center; text-decoration: none;
  font-weight: 600; padding: 13px; border-radius: 100px; font-size: 15px;
}
.plan.free .plan-cta { border: 1.5px solid var(--rule); color: var(--ink-deep); }
.plan.pro .plan-cta { background: var(--ink-deep); color: var(--paper); }
.plan.pro .plan-cta:hover { background: var(--teal); }
.price-foot { margin-top: 26px; font-family: var(--mono); font-size: 13px; color: #6B7F80; }
@media (max-width: 720px) { .price-grid { grid-template-columns: 1fr; } }

/* faq */
.faq-list { margin-top: 48px; max-width: 760px; }
details {
  border-bottom: 1px solid var(--rule);
  padding: 4px 0;
}
details:first-child { border-top: 1px solid var(--rule); }
summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between;
  align-items: center; gap: 20px; padding: 20px 0;
  font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink-deep);
  letter-spacing: -0.01em;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; font-family: var(--mono); font-size: 22px; color: var(--teal);
  transition: transform .25s; flex-shrink: 0;
}
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 40px 22px 0; color: #3D5A5E; font-size: 16px; }

/* closing cta */
.close-cta {
  background: var(--ink-deep); color: var(--paper);
  border-top: 1px solid var(--rule);
  background-image: repeating-linear-gradient(to bottom, transparent 0 35px, rgba(125,199,171,.08) 35px 36px);
}
.close-cta .sec-label { color: var(--mint); }
.close-cta h2 { color: var(--paper); }
.close-cta .lede { color: #A9C4C1; }
.close-cta .btn-primary { background: var(--mint); color: var(--ink-deep); margin-top: 34px; }
.close-cta .btn-primary:hover { background: #92D5BC; }
.close-cta .btn-note { color: #7FA3A0; margin-left: 16px; }

/* ---------- footer ---------- */
footer { padding: 44px 0 52px; border-top: 1px solid var(--rule); }
.foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 20px; flex-wrap: wrap;
}
.foot-links { display: flex; gap: 24px; flex-wrap: wrap; }
.foot a { color: #52696C; text-decoration: none; font-size: 14px; }
.foot a:hover { color: var(--teal); text-decoration: underline; }
.foot-copy { font-family: var(--mono); font-size: 12.5px; color: #8A9694; }

/* ---------- legal pages ---------- */
.page { padding: 72px 0 96px; max-width: 720px; margin: 0 auto; }
.page h1 { font-size: clamp(34px, 5vw, 48px); margin-bottom: 10px; }
.page .updated { font-family: var(--mono); font-size: 13px; color: #8A9694; margin-bottom: 40px; }
.page h2 {
  font-size: 24px; margin: 44px 0 12px; max-width: none;
  padding-top: 28px; border-top: 1px solid var(--rule-soft);
}
.page p, .page li { color: #33504F; font-size: 16.5px; margin-bottom: 14px; }
.page ul { padding-left: 22px; margin-bottom: 14px; }
.page li { margin-bottom: 8px; }
.page a { color: var(--teal); }
.page .callout {
  background: var(--mint-wash); border-left: 3px solid var(--mint);
  padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 22px 0;
  font-size: 15.5px; color: #2A5A50;
}

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .doc, .stamp { animation: none; }
}
