/* monstrous.dev · macrostructure: Bento Grid · tone: calm-competent · anchor hue: 270 · nav: N1b · footer: Ft2 · theme: Indigo */
/* Pattern ported from docs/ledgerline (Coral) — re-themed for an analytics & data software company.
   Geist display/body + Geist Mono as the data outlier (wordmark + figures only).
   Motion budget: one-shot tile stagger · button micro-lift. Nothing else moves.
   Every colour and font arrives via tokens.css — no inline OKLCH/hex here.
   Conformance additions vs. ledgerline: skip link, scroll-padding (focus-not-obscured),
   text-wrap: pretty, forced-colors repair, prefers-contrast guard. */

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; color-scheme: light;
  /* sticky 64px nav must never obscure a focused/followed anchor (WCAG 2.2) */
  scroll-padding-top: calc(64px + var(--space-lg)); }
body { overflow-x: clip; margin: 0; background: var(--color-paper); color: var(--color-body);
  font-family: var(--font-body); font-size: var(--text-base); line-height: 1.6; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { margin: 0; color: var(--color-ink); font-family: var(--font-display); font-style: normal;
  line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; overflow-wrap: anywhere; min-width: 0; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
::selection { background: var(--color-accent-soft); color: var(--color-ink); }
.wrap { max-width: var(--page-max); margin-inline: auto; padding-inline: var(--page-gutter); }

/* ── Skip link — first focusable element on every page ── */
.skip { position: fixed; top: var(--space-sm); left: var(--space-sm); z-index: calc(var(--z-sticky) + 1);
  padding: var(--space-sm) var(--space-md); background: var(--color-ink); color: var(--color-paper);
  border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 500; text-decoration: none;
  transform: translateY(calc(-100% - var(--space-xl))); }
.skip:focus-visible { transform: none; }

/* ── Links ── */
.link { color: var(--color-accent-deep); font-weight: 500; text-decoration: underline;
  text-decoration-color: var(--color-rule-2); text-underline-offset: 3px; border-radius: 2px;
  transition: color var(--dur-micro) var(--ease-out), text-decoration-color var(--dur-micro) var(--ease-out); }
.link:hover { color: var(--color-accent-text); text-decoration-color: var(--color-accent-deep); }

/* ── Buttons — pill, all states ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2xs);
  min-height: 44px; padding: 0 var(--space-lg); border: 1px solid transparent; border-radius: var(--radius-pill);
  font: 500 var(--text-sm)/1 var(--font-body); letter-spacing: 0.01em; white-space: nowrap; cursor: pointer;
  text-decoration: none; position: relative;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out),
    border-color var(--dur-micro) var(--ease-out), transform 100ms var(--ease-out); }
.btn--primary { background: var(--color-ink); color: var(--color-paper); }
.btn--primary:hover { background: var(--color-ink-hover); transform: translateY(-1.5px); }
.btn--secondary { border-color: var(--color-line-strong); background: transparent; color: var(--color-ink); }
.btn--secondary:hover { background: var(--color-paper-2); transform: translateY(-1.5px); }
.btn--mono { font-family: var(--font-data); font-weight: 500; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── N1b nav — brand · centred cluster · CTA ── */
.nav { position: fixed; inset: 0 0 auto; z-index: var(--z-sticky); border-bottom: 1px solid transparent;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); }
.nav.is-scrolled { background: color-mix(in oklch, var(--color-paper) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%); border-bottom-color: var(--color-rule); }
.nav__inner { max-width: var(--page-max); margin-inline: auto; padding-inline: var(--page-gutter);
  height: 64px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: var(--space-2xs); justify-self: start;
  font-family: var(--font-data); font-weight: 500; font-size: var(--text-md); letter-spacing: -0.01em;
  color: var(--color-ink); text-decoration: none; }
.brand__mark { width: 1em; height: 1em; flex: none; fill: currentColor; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.nav__center { justify-self: center; display: flex; gap: var(--space-3xs); }
.nav__right { justify-self: end; display: flex; align-items: center; gap: var(--space-md); }
.nav__link { display: inline-flex; align-items: center; gap: var(--space-3xs); padding: var(--space-2xs) var(--space-sm);
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--color-neutral);
  font-size: var(--text-sm); font-weight: 400; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
.nav__link:hover { color: var(--color-ink); background: var(--color-paper-2); }
.nav__burger { display: none; justify-self: end; width: 44px; height: 44px; padding: 0; border: 0;
  background: none; cursor: pointer; border-radius: var(--radius-sm); }
.nav__burger span, .nav__burger span::before, .nav__burger span::after { content: ""; display: block;
  width: 18px; height: 2px; border-radius: 1px; background: var(--color-ink); margin-inline: auto;
  transition: transform var(--dur-short) var(--ease-out), opacity var(--dur-micro) var(--ease-out); }
.nav__burger span { position: relative; }
.nav__burger span::before, .nav__burger span::after { position: absolute; left: 0; }
.nav__burger span::before { top: -6px; }
.nav__burger span::after { top: 6px; }
.nav__burger[aria-expanded="true"] span { background: transparent; }
.nav__burger[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }
.nav__sheet { display: none; position: fixed; inset: 64px 0 auto; z-index: calc(var(--z-sticky) - 1);
  background: var(--color-paper); border-bottom: 1px solid var(--color-rule); padding: var(--space-md) var(--page-gutter) var(--space-lg);
  max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; }
.nav__sheet.is-open { display: grid; gap: var(--space-3xs); animation: sheet-in 150ms var(--ease-out); }
.nav__sheet a { padding: var(--space-sm) var(--space-2xs); border-radius: var(--radius-sm); color: var(--color-ink);
  font-size: var(--text-base); white-space: nowrap; text-decoration: none; }
.nav__sheet a:hover { background: var(--color-paper-2); }
.nav__sheet a:active { background: var(--color-paper-2); }
.nav__sheet .btn { margin-top: var(--space-sm); justify-self: start; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 56rem) {
  .nav__center, .nav__right > .nav__link { display: none; }
  .nav__inner { grid-template-columns: 1fr auto; }
  .nav__burger { display: block; }
}
@media (max-width: 40rem) {
  /* phone header: wordmark + burger only — the CTA lives in the sheet */
  .nav__right .btn { display: none; }
}

/* ── Home hero — centred display ── */
.hero { padding-block: calc(64px + var(--space-4xl)) var(--space-2xl); text-align: center; }
.hero h1 { font-size: var(--text-display); font-weight: 650; letter-spacing: -0.03em; max-width: 14ch; margin-inline: auto; }
.hero__lede { max-width: 54ch; margin: var(--space-md) auto 0; font-size: var(--text-md); line-height: 1.5; color: var(--color-neutral); }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-sm); margin-top: var(--space-lg); }
.hero__meta { margin-top: var(--space-md); font-family: var(--font-data); font-size: var(--text-xs); color: var(--color-muted); }
/* phones: tighter ascent, full-width thumb CTAs */
@media (max-width: 40rem) {
  .hero { padding-block: calc(64px + var(--space-2xl)) var(--space-xl); }
  .hero__cta .btn { flex: 1 1 100%; }
}
@media (max-height: 40rem) and (orientation: landscape) {
  .hero { padding-block: calc(64px + var(--space-xl)) var(--space-lg); }
}

/* ── Short/long button labels — long labels don't survive 320px ── */
.when-short { display: none; }
@media (max-width: 27rem) {
  .when-long { display: none; }
  .when-short { display: inline; }
}

/* ── Interior page head ── */
.pagehead { padding-block: calc(64px + var(--space-3xl)) var(--space-2xl); }
.pagehead h1 { font-size: var(--text-display-s); font-weight: 650; letter-spacing: -0.025em; max-width: 20ch; }
.pagehead__lede { max-width: 58ch; margin-top: var(--space-md); font-size: var(--text-md); line-height: 1.5; color: var(--color-neutral); }
.pagehead__meta { margin-top: var(--space-md); font-family: var(--font-data); font-size: var(--text-xs); color: var(--color-muted); }

/* ── Vision intro — blockquote + facts panel ── */
.story--intro { border-top: 0; padding-top: 0; }
.sect-h { font-size: var(--text-xl); font-weight: 600; }
.story { display: grid; gap: var(--space-lg); padding-block: var(--space-2xl); border-top: 1px solid var(--color-rule); }
.story blockquote { margin: 0; display: grid; gap: var(--space-md); }
.story blockquote p { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500;
  line-height: 1.4; letter-spacing: -0.01em; color: var(--color-ink); max-width: 30ch; }
.story cite { font-style: normal; font-family: var(--font-data); font-size: var(--text-xs); color: var(--color-muted); }
.story__body { display: grid; gap: var(--space-md); max-width: 62ch; }
@media (min-width: 64rem) {
  .story { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-2xl); align-items: start; }
}

/* ── Principle rows ── */
.about-sect { margin-top: var(--space-2xl); }

/* ── Numbered process steps ── */
.steps { display: grid; gap: var(--space-sm); margin-top: var(--space-xl); counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-left: var(--space-xl);
  font-size: var(--text-sm); color: var(--color-body); max-width: 62ch; }
.steps li b { display: block; color: var(--color-ink); font-weight: 600; margin-bottom: var(--space-3xs); }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 2px;
  font-family: var(--font-data); font-size: var(--text-xs); color: var(--color-accent-deep); }

.team { margin-top: var(--space-xl); border-top: 1px solid var(--color-rule); }
.team__row { display: grid; gap: var(--space-3xs) var(--space-lg); padding-block: var(--space-md);
  border-bottom: 1px solid var(--color-rule); }
.team__row b { color: var(--color-ink); font-weight: 500; }
.team__row span { color: var(--color-neutral); font-size: var(--text-sm); }
@media (min-width: 40rem) { .team__row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }

/* ── Bento grid — irregular spans, the grid is the rhythm ── */
#work > .sect-h { margin-bottom: var(--space-xl); }
.bento { display: grid; gap: var(--space-md); grid-template-columns: minmax(0, 1fr); grid-auto-flow: dense; }
.cell { display: flex; flex-direction: column; gap: var(--space-sm); min-width: 0; padding: var(--space-lg);
  background: var(--color-paper-2); border: 1px solid var(--color-rule); border-radius: var(--radius-lg);
  transition: border-color var(--dur-micro) var(--ease-out); }
.cell:hover { border-color: var(--color-rule-2); }
.cell h3 { font-size: var(--text-lg); font-weight: 600; }
.cell p { font-size: var(--text-sm); color: var(--color-neutral); max-width: 46ch; }
.cell--wide { grid-column: 1 / -1; }
@media (min-width: 40rem) {
  .cell--2x2 { grid-row: span 2; }
  .cell--tall { grid-row: span 2; }
}
.cell--ink { background: var(--color-ink-panel); border-color: var(--color-ink-panel); }
.cell--ink h3 { color: var(--color-paper); }
.cell--ink p { color: var(--color-paper-2); opacity: 0.82; }
.cell--soft { background: var(--color-accent-soft); border-color: var(--color-accent-soft); }
.cell--soft h3 { color: var(--color-accent-ink); }
.cell--soft p { color: var(--color-accent-ink); opacity: 0.85; }
.cell__fact { font-family: var(--font-data); font-variant-numeric: tabular-nums; font-size: var(--text-xl);
  font-weight: 500; color: var(--color-ink); line-height: 1.15; letter-spacing: -0.01em; }
.cell--ink .cell__fact { color: var(--color-paper); }
.cell--soft .cell__fact { color: var(--color-accent-ink); }
.cell__label { font-family: var(--font-data); font-size: var(--text-xs); color: var(--color-muted); }
.cell--ink .cell__label { color: var(--color-paper-2); opacity: 0.7; }
.cell--soft .cell__label { color: var(--color-accent-ink); opacity: 0.75; }
.cell__link { margin-top: auto; padding-top: var(--space-sm); display: inline-flex; align-items: center; gap: var(--space-3xs);
  color: var(--color-accent-deep); font-size: var(--text-sm); font-weight: 500; white-space: nowrap;
  text-decoration: none; }
.cell__link::after { content: "→"; transition: transform var(--dur-micro) var(--ease-out); }
.cell__link:hover::after { transform: translateX(3px); }
.cell--ink .cell__link { color: var(--color-accent); }
/* one-shot entry stagger — capped, opacity + 8px rise only */
.bento .cell { opacity: 0; transform: translateY(8px); animation: cell-in var(--dur-long) var(--ease-out) forwards; }
.bento .cell:nth-child(1) { animation-delay: 0ms; }
.bento .cell:nth-child(2), .bento .cell:nth-child(6) { animation-delay: 60ms; }
.bento .cell:nth-child(3), .bento .cell:nth-child(7) { animation-delay: 120ms; }
.bento .cell:nth-child(4), .bento .cell:nth-child(8) { animation-delay: 180ms; }
.bento .cell:nth-child(5), .bento .cell:nth-child(n+9) { animation-delay: 240ms; }
.bento .cell:nth-child(n+11) { animation-delay: 300ms; }
@keyframes cell-in { to { opacity: 1; transform: none; } }
@media (min-width: 40rem) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell--wide { grid-column: span 2; }
}
@media (min-width: 64rem) {
  .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cell--2x2 { grid-column: span 2; grid-row: span 2; }
}

/* ── Product panels — abstract app views, no chrome ── */
.panel { display: grid; gap: var(--space-sm); margin-top: var(--space-xs);
  background: var(--color-paper); border: 1px solid var(--color-rule); border-radius: var(--radius-md); padding: var(--space-md); }
.cell--ink .panel { background: var(--color-ink-panel-2); border-color: var(--color-ink-rule); }
.rows { display: grid; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md);
  padding-block: var(--space-sm); border-bottom: 1px solid var(--color-rule); font-size: var(--text-sm); }
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row:first-child { padding-top: 0; }
.row__name { color: var(--color-ink); font-weight: 500; min-width: 0; }
.row__name small { display: block; color: var(--color-muted); font-weight: 400; font-size: var(--text-xs); }
.row__amt { font-family: var(--font-data); font-variant-numeric: tabular-nums; color: var(--color-ink); white-space: nowrap; }
.cell--ink .row { border-bottom-color: var(--color-ink-rule); }
.cell--ink .row__name, .cell--ink .row__amt { color: var(--color-paper); }
.cell--ink .row__name small { color: var(--color-paper-2); opacity: 0.65; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: var(--space-3xs) 10px; border-radius: var(--radius-pill);
  background: var(--color-accent-soft); color: var(--color-accent-ink);
  font-family: var(--font-data); font-size: var(--text-xs); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: var(--radius-pill); background: var(--color-accent); }
.chip--plain::before { display: none; }
.chip--plain { background: var(--color-paper-3); color: var(--color-body); }
.chip--live { background: var(--color-success-soft); color: var(--color-success-text); }
.chip--live::before { background: var(--color-success); }

/* ── Open source band ── */
.oss { margin-top: var(--space-3xl); padding-block: var(--space-2xl); border-top: 1px solid var(--color-rule); }
.oss__grid { display: grid; gap: var(--space-xl); align-items: center; }
.oss h2 { font-size: var(--text-2xl); font-weight: 650; letter-spacing: -0.025em; max-width: 22ch; }
.oss__copy { margin-top: var(--space-sm); max-width: 52ch; color: var(--color-neutral); }
.oss .btn { margin-top: var(--space-lg); }
@media (min-width: 64rem) {
  .oss__grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

/* ── CTA band + Ft2 footer ── */
.cta-band { margin-top: var(--space-3xl); padding-block: var(--space-2xl); border-top: 1px solid var(--color-rule); }
.cta-band h2 { font-size: var(--text-2xl); font-weight: 650; letter-spacing: -0.025em; max-width: 22ch; }
.cta-band p { margin-top: var(--space-sm); max-width: 52ch; color: var(--color-neutral); }
.cta-band .hero__cta { justify-content: flex-start; margin-top: var(--space-lg); }
.foot { margin-top: var(--space-3xl); border-top: 1px solid var(--color-rule); }
.foot__line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg);
  padding-block: var(--space-lg); font-size: var(--text-sm); color: var(--color-neutral); }
.foot__line .brand { font-size: var(--text-sm); }
.foot__line a { color: var(--color-neutral); text-decoration: none; white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out); }
.foot__line a:hover { color: var(--color-ink); text-decoration: underline; text-underline-offset: 3px; }
.foot__copy { margin-left: auto; font-family: var(--font-data); font-size: var(--text-xs); color: var(--color-muted); }
@media (max-width: 40rem) {
  .foot__line a { padding-block: var(--space-2xs); }
  .foot__copy { margin-left: 0; flex-basis: 100%; }
}

/* ── Forced colours — repair what the palette would flatten ── */
@media (forced-colors: active) {
  .btn { border: 1px solid ButtonText; }
  .btn--primary { background: ButtonText; color: ButtonFace; }
  .cell, .panel { border-color: CanvasText; }
  .skip { background: Highlight; color: HighlightText; }
}

/* ── Touch — never leave hover stuck after a tap ── */
@media (hover: none) {
  .btn:hover { transform: none; }
  .btn--primary:hover { background: var(--color-ink); }
  .btn--secondary:hover { background: transparent; }
  .cell:hover { border-color: var(--color-rule); }
  .nav__link:hover { background: none; color: var(--color-neutral); }
  .nav__sheet a:hover { background: none; }
  .foot__line a:hover { color: var(--color-neutral); text-decoration: none; }
  .link:hover { color: var(--color-accent-deep); text-decoration-color: var(--color-rule-2); }
  .cell__link:hover::after { transform: none; }
}

/* ── Reduced motion — collapse to ≤150ms opacity ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 150ms !important; animation-duration: 150ms !important;
    animation-iteration-count: 1 !important; }
  .bento .cell { transform: none; animation: cell-in-r 150ms var(--ease-out) forwards; }
  .btn:hover { transform: none; }
  @keyframes cell-in-r { to { opacity: 1; } }
}
