/*
  What: styles for squarebooks.ai. The spike's tokens (paper, ink, violet, ochre), an accountant's columnar pad
        under the working paper, and the Design canvas sections below it. Light theme only.
  Inputs: self-hosted fonts in fonts/ (SIL Open Font License).
  Outputs: the page layout at desktop, tablet (1020 px) and phone (640 px) widths.
*/
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 700; font-display: swap; src: url(fonts/bricolage-grotesque-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 800; font-display: swap; src: url(fonts/bricolage-grotesque-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 400; font-display: swap; src: url(fonts/schibsted-grotesk-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 500; font-display: swap; src: url(fonts/schibsted-grotesk-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Schibsted Grotesk'; font-weight: 600; font-display: swap; src: url(fonts/schibsted-grotesk-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 400; font-display: swap; src: url(fonts/geist-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 500; font-display: swap; src: url(fonts/geist-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 600; font-display: swap; src: url(fonts/geist-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Caveat'; font-weight: 600; font-display: swap; src: url(fonts/caveat-latin-600-normal.woff2) format('woff2'); }

:root {
  color-scheme: light;
  --paper: #f7f3ec;
  --pad: #efe8db;
  --sheet: #fdfbf6;
  --ink: #1a160f;
  --ink-soft: #5d5447;
  --violet: #503c98;
  --violet-deep: #432f86;
  --violet-wash: #ece8f7;
  --violet-text: #e4def5;
  --ochre: #aa7f37;        /* ticks and pad ruling */
  --ochre-text: #8a6526;   /* the pencil note: darker so it reads at 4.5:1 */
  --rule: #cfc6b6;
  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --text: 'Schibsted Grotesk', ui-sans-serif, system-ui, sans-serif;
  --figures: 'Geist', 'Schibsted Grotesk', ui-sans-serif, sans-serif;
  --pencil: 'Caveat', 'Segoe Print', cursive;
  --gutter: clamp(16px, 4vw, 56px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 400 16px/1.55 var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--violet); }
a:hover { color: var(--violet-deep); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; border-radius: 4px; }
.wrap { padding-inline: var(--gutter); max-width: 1440px; margin: 0 auto; }
.fig { font-family: var(--figures); font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--sheet); padding: 8px 12px; z-index: 10; }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 19px/1 var(--display); letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.tile { width: 30px; height: 30px; border-radius: 8px; background: var(--violet); color: #fff; display: grid; place-items: center; font: 800 17px/1 var(--display); flex: none; }
.links { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.links a:not(.btn) { color: var(--ink); text-decoration: none; }
.links a:not(.btn):hover { color: var(--violet); }
.btn { display: inline-flex; align-items: center; border-radius: 999px; padding: 12px 22px; font: 600 15px/1 var(--text); text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-deep); color: #fff; }
.btn-quiet { color: var(--ink); border-color: var(--rule); background: transparent; }
.btn-quiet:hover { border-color: var(--ink-soft); color: var(--ink); }

/* Hero */
.statement { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 72px); align-items: end; padding-block: clamp(20px, 5vh, 56px) clamp(28px, 5vh, 48px); }
h1 { font: 800 clamp(40px, 5.6vw, 84px)/0.96 var(--display); letter-spacing: -0.04em; margin: 0; text-wrap: balance; }
.lede { font-size: clamp(17px, 1.3vw, 19px); color: var(--ink-soft); margin: 0 0 22px; max-width: 32em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.note { font-size: 14px; color: var(--ink-soft); }

/* The columnar pad: green-ledger ruling in the brand's ochre and rule colours. */
.pad { position: relative; border-radius: 22px; padding: clamp(16px, 3vw, 44px); overflow: hidden;
       background-color: var(--pad);
       background-image:
         linear-gradient(90deg, transparent 54px, rgba(170,127,55,.45) 54px, rgba(170,127,55,.45) 55px, transparent 55px, transparent 58px, rgba(170,127,55,.45) 58px, rgba(170,127,55,.45) 59px, transparent 59px),
         repeating-linear-gradient(90deg, transparent 0 119px, rgba(26,22,15,.06) 119px 120px),
         repeating-linear-gradient(180deg, transparent 0 27px, rgba(26,22,15,.07) 27px 28px); }
.stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }

.sheet { position: relative; background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 22px 26px 20px;
         box-shadow: 0 1px 0 #fff inset, 0 34px 60px -36px rgba(60, 44, 20, .45), 0 2px 6px rgba(60, 44, 20, .07); }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.sheet-title { font: 700 19px/1.2 var(--display); letter-spacing: -0.01em; margin: 0; }
.sheet-sub { font-size: 13.5px; color: var(--ink-soft); margin-top: 3px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; font: 500 12.5px/1 var(--text); color: var(--ink-soft); border: 1px solid var(--rule); border-radius: 999px; padding: 7px 11px; background: var(--paper); }
.chip b { color: var(--ink); font-weight: 600; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); }
.bar { height: 2px; background: var(--rule); margin-top: 16px; position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--violet); }
.status { font-size: 13px; color: var(--ink-soft); margin-top: 8px; min-height: 20px; }

.table-wrap { overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; }
.flux { width: 100%; border-collapse: collapse; margin-top: 4px; font-variant-numeric: tabular-nums; }
.flux th { font: 500 12.5px/1 var(--text); color: var(--ink-soft); text-align: right; padding: 10px 10px 8px; white-space: nowrap; }
.flux th:first-child { text-align: left; padding-left: 0; }
.flux td { padding: 7px 10px; text-align: right; font: 400 15.5px/1.2 var(--figures); white-space: nowrap; }
.flux td:first-child { text-align: left; padding-left: 0; font-family: var(--text); }
.flux tbody tr.lit td { background: var(--violet-wash); }
.flux td.tickcell { width: 30px; padding: 0 0 0 4px; }
.tick { width: 22px; height: 18px; overflow: visible; display: block; }
.tick path { fill: none; stroke: var(--ochre); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.flux tr.total td { font-weight: 600; padding-top: 11px; position: relative; }
.foot { position: absolute; left: 10px; right: 10px; height: 1px; background: var(--ink); transform-origin: left; transform: scaleX(0); }
.foot.single { top: 2px; }
.foot.double { bottom: -5px; height: 4px; background: none; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.flux tr.total td:first-child .foot { left: 0; }

.pencil { position: absolute; right: 46px; top: 0; font: 600 22px/1 var(--pencil); color: var(--ochre-text); transform: rotate(-4deg); white-space: nowrap; pointer-events: none; opacity: 0; }

.commentary { margin-top: 40px; border-top: 1px solid var(--rule); padding-top: 16px; }
.claude-who { display: flex; align-items: center; gap: 8px; font: 600 13.5px/1.2 var(--text); margin-bottom: 6px; }
.claude-who span { font-weight: 400; color: var(--ink-soft); }
.claude-text { font-size: 16px; line-height: 1.6; min-height: 5.2em; margin: 0; max-width: 62ch; }
.amt { font-family: var(--figures); font-weight: 500; white-space: nowrap; background-image: linear-gradient(var(--ochre), var(--ochre)); background-size: 0 1.5px; background-repeat: no-repeat; background-position: 0 100%; }
.amt .tick { display: inline-block; width: 15px; height: 12px; margin-left: 2px; vertical-align: -1px; }
.caret { display: inline-block; width: 2px; height: 1.05em; background: var(--violet); vertical-align: -3px; margin-left: 1px; }

.signoff { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.stamps { display: flex; gap: 18px; font-size: 13.5px; color: var(--ink-soft); }
.stamps b { color: var(--ink); font-weight: 600; }
.lock { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 8px 14px; font: 600 13.5px/1 var(--text); background: var(--ink); color: var(--paper); }
.lock svg { width: 13px; height: 13px; }

/* Run log: who did each step. */
.log { background: rgba(253, 251, 246, .86); border: 1px solid var(--rule); border-radius: 14px; padding: 18px 18px 16px; }
.log h2 { font: 700 15px/1.2 var(--display); margin: 0 0 12px; letter-spacing: 0; }
.log ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.log li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 13.5px; line-height: 1.35; }
.who { font: 500 11.5px/1 var(--text); border-radius: 999px; padding: 4px 8px; align-self: start; white-space: nowrap; }
.who.code { background: #ebe4d6; color: var(--ink); }
.who.claude { background: var(--violet-wash); color: var(--violet); }
.who.you { background: transparent; border: 1px solid var(--rule); color: var(--ink-soft); }
.log .meta { grid-column: 1 / -1; color: var(--ink-soft); font-size: 12.5px; }
.log-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); font: 600 13.5px/1.4 var(--text); }
.log-foot span { display: block; font-weight: 400; color: var(--ink-soft); }

.under { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 14px 0; font-size: 13.5px; color: var(--ink-soft); }
.replay { background: none; border: 0; padding: 2px 0; font: 500 13.5px/1 var(--text); color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Sections below the pad (from the Design canvas). */
.section { padding-top: clamp(72px, 10vw, 120px); scroll-margin-top: 16px; }
h2.big { margin: 0 0 14px; font: 800 clamp(34px, 3.8vw, 52px)/1 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.intro { margin: 0 0 30px; font-size: 18px; color: var(--ink-soft); max-width: 40em; }
.steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.steps li { padding: 22px 22px 0; border-right: 1px solid var(--rule); }
.steps li:first-child { padding-left: 0; }
.steps li:last-child { border-right: 0; padding-right: 0; }
.steps .num { font-size: 14px; color: var(--ochre-text); font-weight: 600; margin-bottom: 14px; }
.steps h3 { margin: 0 0 8px; font: 700 20px/1.2 var(--display); }
.steps p { margin: 0; font-size: 15px; color: var(--ink-soft); }

.cols2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.cols2.flip { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.points { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; }
.points > * { border-top: 1px solid var(--rule); padding-top: 14px; }
.points dt { font-weight: 600; margin-bottom: 4px; }
.points dd { margin: 0; color: var(--ink-soft); font-size: 15px; }
.points li span { color: var(--ink-soft); }

.diagram { display: flex; flex-direction: column; gap: 14px; padding: clamp(20px, 3vw, 36px); border-radius: 22px; background: var(--pad); }
.node { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 18px 20px; }
.node b { display: block; font: 700 17px/1.2 var(--display); }
.node span { display: block; font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; }
.node.run { border-color: var(--violet); }
.node.run b { color: var(--violet); }
.node.kept { border-style: dashed; border-color: var(--ochre); }
.link { display: flex; align-items: center; gap: 10px; padding-left: 28px; font-size: 13px; color: var(--ink-soft); }
.link i { width: 2px; height: 34px; background: var(--violet); flex: none; }
.link.kept i { background: var(--ochre); }

.pack { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 28px 30px; box-shadow: 0 34px 60px -36px rgba(60,44,20,.4); }
.pack-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--ink); padding-bottom: 12px; }
.pack-head b { font: 700 19px/1.2 var(--display); }
.pack-head span { font-size: 13px; color: var(--ink-soft); }
.wp { width: 100%; border-collapse: collapse; margin-top: 6px; }
.wp th { font: 500 12.5px/1 var(--text); color: var(--ink-soft); text-align: left; padding: 10px 10px 8px 0; }
.wp td { padding: 8px 10px 8px 0; vertical-align: top; }
.wp td.ref { color: var(--ochre-text); font-weight: 600; width: 44px; }

.early { margin-top: clamp(80px, 11vw, 140px); border-radius: 22px; background: var(--violet); color: #fff; padding: clamp(36px, 6vw, 72px) clamp(24px, 5vw, 64px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 32px; }
.early h2 { margin: 0 0 14px; font: 800 clamp(34px, 4vw, 56px)/1 var(--display); letter-spacing: -0.03em; }
.early p { margin: 0; font-size: 19px; color: var(--violet-text); max-width: 34em; }
.early .cta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.btn-light { background: var(--sheet); color: var(--ink); padding: 15px 28px; font-size: 16px; }
.btn-light:hover { background: #fff; color: var(--ink); }
.early .mail { font-size: 14px; color: var(--violet-text); user-select: all; }
.early :focus-visible { outline-color: #fff; }

.footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding-block: 40px 48px; font-size: 13.5px; color: var(--ink-soft); }
.footer .brand { font-size: 16px; }
.footer .tile { width: 24px; height: 24px; border-radius: 7px; font-size: 14px; }
.footer p { margin: 0; }

@media (max-width: 1020px) {
  .statement, .stage, .cols2, .cols2.flip { grid-template-columns: 1fr; align-items: start; }
  .steps { grid-template-columns: 1fr; border-top: 0; }
  .steps li, .steps li:first-child, .steps li:last-child { padding: 18px 0; border-right: 0; border-top: 1px solid var(--rule); }
  .steps li:first-child { border-top-color: var(--ink); }
  .cols2.flip .pack { order: 2; }
}
@media (max-width: 640px) {
  .links a:not(.btn) { display: none; }
  .nav .btn { padding: 10px 16px; font-size: 14px; }
  .col-aug { display: none; }
  .sheet { padding: 16px 14px; }
  .flux td { padding: 7px 6px; font-size: 14.5px; }
  .flux th { padding: 10px 6px 8px; }
  .pencil { display: none; }
  .pad { border-radius: 16px; }
  .pack { padding: 20px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
