/* ssfn landing page. Direction "Ledger": paper, ink, one blue, square corners. */

:root {
  --paper: #F3F3EE;
  --ink: #0E0E14;
  --blue: #2B2BD9;
  --blue-deep: #1A1A8F;
  --blue-tint: #ECECFB;
  --white: #FFFFFF;
  --text-2: #3D4A54;
  --text-3: #55626C;
  --text-mono-2: #3A3A46;
  --rule-soft: #D5D5CC;
  --term-text: #E6ECE8;
  --term-comment: #A9B5AF;

  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Space Grotesk", Inter, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, dl, dd, pre { margin: 0; }

a { color: var(--blue); }
a:hover { color: var(--blue-deep); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.cta :focus-visible, .terminal:focus-visible { outline-color: var(--white); }

[id] { scroll-margin-top: 16px; }

.skip-link {
  position: absolute;
  left: 8px;
  top: -80px;
  z-index: 10;
  background: var(--ink);
  color: var(--white);
  padding: 12px 16px;
  font-weight: 600;
}
.skip-link:focus { top: 8px; color: var(--white); }

.container { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.section { padding-top: 72px; padding-bottom: 72px; }
.band { background: var(--white); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }

.stack { display: flex; flex-direction: column; gap: 36px; }
.stack-20 { display: flex; flex-direction: column; gap: 20px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }

.mono { font-family: var(--font-mono); }
.num { text-align: right; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 0;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}
.btn-small { min-height: 44px; padding: 0 20px; font-size: 15px; }
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: var(--blue-deep); color: var(--white); }
.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover { background: var(--blue); color: var(--white); }
.btn-outline { background: var(--white); color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--white); }
.btn-white { background: var(--white); color: var(--ink); min-height: 54px; padding: 0 28px; }
.btn-white:hover { background: var(--blue-tint); color: var(--ink); }

/* Header */
.site-header {
  padding-top: 20px;
  padding-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; font-size: 15px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.nav-link:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }

/* Hero */
.hero {
  padding-top: 56px;
  padding-bottom: 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: center;
}
.hero-copy { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.eyebrow { font-family: var(--font-mono); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.eyebrow-dot { flex: none; width: 10px; height: 10px; background: var(--blue); animation: lg-dot 1.6s infinite; }
.hero-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(38px, 9vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.hero-lead { font-size: 19px; line-height: 1.55; color: var(--text-2); max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.note { font-size: 14px; line-height: 1.5; color: var(--text-3); }

/* Calculator */
.calc {
  flex: 1 1 420px;
  min-width: 0;
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.calc-title { font-family: var(--font-head); font-weight: 600; font-size: 20px; }
.calc-field { display: flex; flex-direction: column; gap: 8px; }
.calc-label { font-size: 13px; color: var(--text-3); font-weight: 500; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font: 500 15px var(--font-body);
  cursor: pointer;
}
.pill:hover { background: var(--blue-tint); }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.calc-result { background: var(--blue-tint); padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.calc-result-text { font-size: 14px; color: var(--text-2); }
.calc-result-number {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 40px;
  line-height: 1.1;
  color: var(--blue-deep);
  font-variant-numeric: tabular-nums;
}

/* Features band */
.features {
  padding-top: 64px;
  padding-bottom: 64px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 40px;
}
.feature { display: flex; flex-direction: column; gap: 10px; color: var(--blue); }
.feature-title { font-family: var(--font-head); font-size: 21px; font-weight: 600; color: var(--ink); }
.feature-text { font-size: 16px; line-height: 1.55; color: var(--text-2); }

/* Section headings */
.section-title { font-family: var(--font-head); font-size: clamp(28px, 6vw, 36px); font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.section-title-sub { font-size: clamp(25px, 5.5vw, 30px); }
.stack > .section-title-sub { margin-top: 28px; }
.section-lead { font-size: 16px; line-height: 1.55; color: var(--text-2); max-width: 720px; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.card { background: var(--white); border: 2px solid var(--ink); padding: 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-step { font-family: var(--font-mono); font-size: 14px; color: var(--blue); }
.card-title { font-size: 18px; font-weight: 600; }
.card-text { font-size: 15px; line-height: 1.55; color: var(--text-2); }
.inline-code { font-family: var(--font-mono); font-size: 14px; }

/* Terminal */
.terminal { background: var(--ink); padding: 24px; overflow-x: auto; }
.terminal-pre, .terminal-pre code { font-family: var(--font-mono); font-size: 14px; line-height: 1.7; color: var(--term-text); }
.terminal-comment { color: var(--term-comment); }

/* Pricing */
.split { display: flex; flex-wrap: wrap; gap: 48px; }
.split-narrow { flex: 1 1 360px; min-width: 0; }
.split-wide { flex: 1 1 420px; min-width: 0; }
.price-list { display: flex; flex-direction: column; border-bottom: 1px solid var(--ink); }
.price-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 14px 0;
  border-top: 1px solid var(--ink);
  font-size: 16px;
}
.price-row dd { font-family: var(--font-mono); }
.table-box { overflow-x: auto; border: 2px solid var(--ink); }
.price-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.price-table th, .price-table td { padding: 12px 16px; text-align: left; }
.price-table th { font-weight: 600; background: var(--paper); }
.price-table .num { text-align: right; white-space: nowrap; }
.price-table tbody tr { border-top: 1px solid var(--ink); }

/* Use cases + ledger */
.use-list { padding-left: 20px; font-size: 16px; line-height: 1.9; color: var(--text-2); }
.ledger { flex: 1 1 440px; min-width: 0; background: var(--white); border: 2px solid var(--ink); display: flex; flex-direction: column; }
.ledger-head { padding: 20px 24px; border-bottom: 2px solid var(--ink); display: flex; flex-direction: column; gap: 4px; }
.ledger-caption { font-family: var(--font-mono); font-size: 12px; color: var(--text-mono-2); }
.ledger-counter {
  height: 1.2727em;
  overflow: hidden;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(30px, 9vw, 44px);
  line-height: 1.2727;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.ledger-counter-roll { animation: lg-roll 6s steps(5) infinite; }
.ledger-sub { font-size: 14px; color: var(--text-mono-2); }
.ledger-body { padding: 8px 24px 16px; font-family: var(--font-mono); font-size: 13px; overflow-x: auto; }
.ledger-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px 110px;
  gap: 12px;
  padding: 10px 0;
  min-width: 400px;
  border-top: 1px solid var(--rule-soft);
}
.ledger-row-head { border-top: 0; color: var(--text-mono-2); font-size: 12px; }
.ledger-row-1 { animation: lg-row 6s 0s infinite backwards; }
.ledger-row-2 { animation: lg-row 6s 1.2s infinite backwards; }
.ledger-row-3 { animation: lg-row 6s 2.4s infinite backwards; }
.ledger-row-4 { animation: lg-row 6s 3.6s infinite backwards; }

/* Closing call to action */
.cta { background: var(--ink); }
.cta-inner {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cta-title { font-family: var(--font-head); font-size: clamp(27px, 6vw, 34px); font-weight: 700; color: var(--white); max-width: 620px; line-height: 1.15; }

/* Footer */
.site-footer {
  padding-top: 28px;
  padding-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: 14px;
  color: var(--text-3);
}
.footer-name { font-family: var(--font-head); font-weight: 700; font-size: 16px; color: var(--ink); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0 24px; }
.footer-link { display: inline-flex; align-items: center; min-height: 44px; }

@keyframes lg-roll { 0% { transform: translateY(0); } 100% { transform: translateY(-83.333%); } }
@keyframes lg-row { 0% { opacity: 0; transform: translateY(-8px); } 8% { opacity: 1; transform: none; } 100% { opacity: 1; } }
@keyframes lg-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

@media (max-width: 560px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .section, .cta-inner { padding-top: 56px; padding-bottom: 56px; }
  .hero { padding-top: 32px; padding-bottom: 56px; gap: 40px; }
  .site-nav { gap: 4px 20px; }
  .calc { padding: 20px; }
  .calc-result-number { font-size: 34px; }
  .terminal { padding: 16px; }
  .terminal-pre, .terminal-pre code { font-size: 13px; }
  .ledger-head { padding: 16px; }
  .ledger-body { padding: 8px 16px 12px; }
  .price-table th, .price-table td { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; }
}

/* Links inside running text, and the width of a price list on a page of its own. */
.text-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: var(--ink); }
.doc-width { max-width: 720px; }
