/* tillsheet.com landing page: the columnar ledger pad. Self-hosted fonts, no external assets. */
@font-face { font-family: "Zilla Slab"; src: url("fonts/zilla-slab-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url("fonts/zilla-slab-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/public-sans-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("fonts/public-sans-italic-var.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Spline Sans Mono"; src: url("fonts/spline-sans-mono-var.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }

:root {
  --paper: #e6efe0;        /* green analysis-pad stock */
  --paper-2: #dce8d4;      /* header strip, a shade deeper */
  --rule: #9fb6d3;         /* blue row rules */
  --rule-soft: #c2d2e3;
  --red: #b8402c;          /* red column rules and buttons */
  --red-ink: #9c3220;
  --ink: #23302a;          /* graphite-green text */
  --ink-2: #4a5a51;
  --hole: #c9d7c2;
  --on-red: #fdf6ee;
  --row: 2.75rem;
  --sheet: 84rem;          /* one right edge for the whole pad */
  --gutter: clamp(1rem, 4vw, 4.5rem);
  --margin: clamp(0rem, 4.5vw, 4.5rem);   /* the pad's left margin */
  --display: "Zilla Slab", "Rockwell", "Roboto Slab", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121c16;
    --paper-2: #17241c;
    --rule: #2d4459;
    --rule-soft: #22344a;
    --red: #e0735d;
    --red-ink: #ef8a75;
    --ink: #e2ebe0;
    --ink-2: #a9bbad;
    --hole: #0b120e;
    --on-red: #1a0e0a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
}
::selection { background: color-mix(in srgb, var(--red) 28%, transparent); color: var(--ink); }
a { color: var(--red-ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--paper); padding: 0.5rem 0.9rem; z-index: 10; }
.skip:focus { top: 1rem; }

/* The pad: red double margin rule down the left, punched holes beside it. */
.pad { position: relative; padding-left: var(--margin); }
.pad::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--margin) - 7px); width: 5px;
  border-left: 1.5px solid var(--red); border-right: 1.5px solid var(--red); pointer-events: none;
}
.holes { position: absolute; top: 0; bottom: 0; left: calc(var(--margin) / 2 - 11px); display: flex; flex-direction: column; justify-content: space-around; padding: 12vh 0; }
.holes i { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--hole); box-shadow: inset 0 2px 3px rgb(0 0 0 / 0.18); }
@media (max-width: 720px) {
  :root { --margin: 1rem; }
  .pad::before { left: 0.45rem; width: 4px; }
  .holes { display: none; }
}
/* Ruled ground: faint blue row rules at the pad's pitch, below the header strip. */
main {
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--row) - 1px), color-mix(in srgb, var(--rule-soft) 60%, transparent) calc(var(--row) - 1px) var(--row));
}
/* Paper over paper: text and ruled components carry their own sheet, so the ground's
   ruling shows only in the open field and gutters, never through words or beside component rules. */
.block h2, .block > p, .split > div > p, .sheet-note, .closing h2, .block h3 { background: var(--paper); width: fit-content; }
.journal, .colkey, .ruled-pair, .extras-list, .faq details, .tabbar { background: var(--paper); }
.strip-top, .hero { max-width: var(--sheet); }
main > *, .foot > * { max-width: var(--sheet); }

/* Header strip */
.strip { background: var(--paper-2); border-bottom: 1.5px solid var(--red); box-shadow: 0 4px 0 -2.5px var(--paper), 0 4px 0 -1px var(--red); padding: 0 var(--gutter); }
.strip-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; min-height: var(--row); padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.wordmark { display: inline-flex; align-items: center; gap: 0.55rem; font: 700 1.6rem/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.mark { width: 1.6rem; height: 1.6rem; fill: var(--paper); stroke: var(--rule); stroke-width: 1.4; }
.mark .r { stroke: var(--red); }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.6rem; font-size: 0.97rem; }
nav a:not(.btn) { color: var(--ink); text-decoration: none; padding: 0.3rem 0; background: linear-gradient(var(--red), var(--red)) no-repeat 0 100% / 0 1.5px; transition: background-size 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
nav a:not(.btn):hover { background-size: 100% 1.5px; }
@media (max-width: 720px) { nav a[href="#columns"], nav a[href="#how"] { display: none; } }
@media (max-width: 480px) { .strip-top { flex-wrap: nowrap; } nav a[href="#pricing"] { display: none; } }

.hero { padding: clamp(1.75rem, 4vw, 3rem) 0 clamp(1.5rem, 3vw, 2.25rem); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 1.3rem + 4vw, 4.6rem); line-height: 0.98; margin: 0 0 1rem; max-width: 16em; }
.lede { font-size: clamp(1.1rem, 1rem + 0.45vw, 1.35rem); line-height: 1.5; max-width: 58rem; margin: 0 0 1.4rem; color: var(--ink); text-wrap: balance; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; }
.aside { margin: 0; color: var(--ink-2); font-size: 0.97rem; }

/* Buttons: red-ruled boxes filled with pad red. */
.btn {
  display: inline-block; background: var(--red); color: var(--on-red); text-decoration: none;
  font: 650 1.05rem/1 var(--sans); padding: 1rem 1.5rem; border-radius: 2px;
  outline: 1.5px solid var(--red); outline-offset: 3px;
  transition: background-color 0.2s, outline-offset 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn:hover { background: var(--red-ink); outline-offset: 5px; text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn-sm { font-size: 0.92rem; padding: 0.65rem 1rem; outline-offset: 2px; }

/* The sheet */
main { padding: 0 var(--gutter); }
.sheet-sec { padding: clamp(1.5rem, 3vw, 2.25rem) 0 0; }
.tabbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 0.25rem; border-bottom: 1.5px solid var(--ink); }
.tab { margin: 0; font: 600 0.95rem/1 var(--sans); letter-spacing: 0; padding: 0.7rem 1rem; color: var(--ink-2); border: 1px solid transparent; border-bottom: 0; }
.tab-on { color: var(--ink); background: var(--paper-2); border-color: var(--ink); position: relative; top: 1.5px; }
.sample { margin-left: auto; padding: 0.6rem 0; font: 500 0.85rem/1 var(--mono); color: var(--red-ink); }
@media (max-width: 640px) {
  .tab-wide { display: none; }
  .tab { padding: 0.65rem 0.8rem; font-size: 0.9rem; }
  .ledger .old { display: none; }   /* phones show yesterday's rows only, so they sit in the first screen */
}

.ledger-wrap { overflow-x: auto; scrollbar-color: var(--rule) transparent; scrollbar-width: thin; }
.ledger { border-collapse: collapse; width: 100%; min-width: 64rem; font: 400 1rem/1 var(--mono); background: var(--paper); }
.ledger th, .ledger td { height: var(--row); padding: 0 1rem; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--rule); }
.ledger th:first-child, .ledger td:nth-child(2) { text-align: left; }
.ledger thead th { font: 600 0.82rem/1.2 var(--sans); color: var(--ink-2); vertical-align: bottom; padding-bottom: 0.6rem; border-bottom: 3px double var(--red); white-space: normal; }
.ledger tbody th { font: 600 0.98rem/1 var(--sans); }
/* red column rules: double after the key columns, single between the money columns */
.ledger th:nth-child(2), .ledger td:nth-child(2) { border-right: 3px double var(--red); }
.ledger td:nth-child(n+3):not(:last-child), .ledger thead th:nth-child(n+3):not(:last-child) { border-right: 1px solid color-mix(in srgb, var(--red) 55%, transparent); }
.ledger td:nth-child(6) { font-weight: 600; }
.neg { color: var(--red-ink); }

/* Signature: yesterday's rows write themselves in, figure by figure, once the sheet is on screen.
   Without JavaScript the class never lands and the rows simply show. */
@media (prefers-reduced-motion: no-preference) {
  .ledger.play .new > * { animation: write 0.5s steps(9, end) both; }
  .ledger.play .new:nth-child(4) > * { animation-delay: calc(0.2s + var(--c, 0) * 0.11s); }
  .ledger.play .new:nth-child(5) > * { animation-delay: calc(0.75s + var(--c, 0) * 0.11s); }
  .ledger.play .new:nth-child(6) > * { animation-delay: calc(1.3s + var(--c, 0) * 0.11s); }
  .ledger tr > :nth-child(2) { --c: 1; } .ledger tr > :nth-child(3) { --c: 2; } .ledger tr > :nth-child(4) { --c: 3; }
  .ledger tr > :nth-child(5) { --c: 4; } .ledger tr > :nth-child(6) { --c: 5; } .ledger tr > :nth-child(7) { --c: 6; }
  .ledger tr > :nth-child(8) { --c: 7; } .ledger tr > :nth-child(9) { --c: 8; } .ledger tr > :nth-child(10) { --c: 9; }
  .ledger.play .new { animation: settle 2.8s 0.2s both; }
}
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes settle { 0%, 85% { background: color-mix(in srgb, var(--red) 9%, transparent); } 100% { background: transparent; } }
.sheet-note { margin: 0.9rem 0 0; color: var(--ink-2); font-size: 0.95rem; }

/* Sections */
.block { padding: clamp(3.5rem, 8vw, 6rem) 0 0; }
.block h2 { font-size: clamp(1.9rem, 1.3rem + 2vw, 3rem); line-height: 1.04; margin: 0 0 1.5rem; max-width: 22ch; }
.block h3 { font-size: 1.3rem; margin: 0 0 0.75rem; }
.block p { max-width: 62ch; }
.fine { color: var(--ink-2); font-size: 0.95rem; }

/* How it works: a ruled journal, the time column carries the order. */
.journal { list-style: none; margin: 0; padding: 0; border-top: 3px double var(--red); }
.journal li { display: grid; grid-template-columns: 11rem 1fr; border-bottom: 1px solid var(--rule); }
.when { padding: 1.1rem 1rem 1.1rem 0; font: 500 0.95rem/1.5 var(--mono); color: var(--red-ink); border-right: 3px double var(--red); }
.what { padding: 1.1rem 0 1.1rem 1.5rem; max-width: 60ch; }
.what strong { display: block; font: 700 1.25rem/1.3 var(--display); margin-bottom: 0.2rem; }
@media (max-width: 560px) { .journal li { grid-template-columns: 6.5rem 1fr; } .when { font-size: 0.85rem; padding-right: 0.6rem; } .what { padding-left: 0.9rem; } }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.colkey { margin: 0; border-top: 3px double var(--red); }
.colkey div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
.colkey dt { font: 600 0.95rem/1.4 var(--mono); }
.colkey dd { margin: 0; color: var(--ink-2); }
@media (max-width: 480px) { .colkey div { grid-template-columns: 1fr; gap: 0.15rem; } }

.ruled-pair { display: grid; grid-template-columns: 1fr 1fr; border-top: 3px double var(--red); border-bottom: 1px solid var(--rule); margin-bottom: 1rem; }
.ruled-pair > div { padding: 1.25rem 2rem 0.75rem 0; }
.ruled-pair > div + div { padding-left: 2rem; border-left: 3px double var(--red); }
.ruled-pair ul { list-style: none; margin: 0; padding: 0; }
.ruled-pair li { padding: 0.6rem 0; border-top: 1px solid var(--rule-soft); }
@media (max-width: 640px) { .ruled-pair { grid-template-columns: 1fr; } .ruled-pair > div + div { padding-left: 0; border-left: 0; border-top: 3px double var(--red); } }

.extras-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); border-top: 3px double var(--red); }
.extras-list li { padding: 1rem 1.5rem 1rem 0; border-bottom: 1px solid var(--rule); }
.extras-list strong { font-family: var(--display); font-size: 1.15rem; display: block; }

.price { text-align: left; }
.price p { font-size: 1.15rem; margin: 0 0 1.75rem; }

.faq details { border-bottom: 1px solid var(--rule); background: var(--paper); }
.faq details:first-of-type { border-top: 3px double var(--red); }
.faq summary { cursor: pointer; list-style: none; padding: 1.1rem 2.5rem 1.1rem 0; font: 600 1.15rem/1.35 var(--display); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 0.4rem; top: 50%; width: 0.7rem; height: 0.7rem; border-right: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: translateY(-70%) rotate(45deg); transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { margin: 0 0 1.25rem; color: var(--ink-2); }

.closing { margin: clamp(4rem, 9vw, 7rem) 0 0; padding: clamp(2.5rem, 6vw, 4rem) 0; border-top: 3px double var(--red); border-bottom: 3px double var(--red); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.closing h2 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3.3rem); line-height: 1.04; margin: 0; max-width: 20ch; }

.foot { padding: 2rem var(--gutter) 3rem; color: var(--ink-2); font-size: 0.9rem; }
.foot p { margin: 0 0 0.6rem; max-width: 70ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; font-size: 0.97rem; }

@media print {
  .holes, .pad::before, .skip { display: none; }
  .ledger .new, .ledger .new > * { animation: none; }
}
