/* ==========================================================================
   k-dgtal — shared stylesheet
   ========================================================================== */

:root {
  --bg: #0E121A;
  --surface: #141820;
  --surface-glass: rgba(20, 24, 32, 0.55);
  --surface-glass-strong: rgba(14, 18, 26, 0.72);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #E7EAF0;
  --muted: #9AA3B2;
  --faint: #7D8597; /* 5.1:1 on --bg, 4.8:1 on --surface (WCAG AA) */
  --white: #FFFFFF;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --max: 1600px;
  --radius: 18px;
  --radius-sm: 10px;
  --nav-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  overflow-x: clip; /* clip, not hidden: no scroll container, so sticky keeps working */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* fallback for browsers without clip */
  overflow-x: clip;
}

body.nav-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }

::selection { background: rgba(255, 255, 255, 0.9); color: var(--bg); }

:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--white);
  color: var(--bg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

main { flex: 1; }

.section { padding: clamp(72px, 11vw, 144px) 0; }
.section + .section { padding-top: 0; }

.rule { border: 0; border-top: 1px solid var(--line); }

/* ---------- Type ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  background: currentColor;
}

.display {
  font-size: clamp(2.75rem, 8.4vw, 10rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: var(--white);
}
.display .dim { color: var(--faint); }

.h1 {
  font-size: clamp(40px, 6.2vw, 88px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: var(--white);
}

.h2 {
  font-size: clamp(30px, 3.8vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--white);
}

.h3 {
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 500;
  color: var(--white);
}

.lead {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 46ch;
}

.body-copy { color: var(--muted); max-width: 72ch; }

/* Long-form text stays readable in the wide layout: paragraphs cap at 72ch, left-aligned. */
:where(main) p { max-width: 72ch; }
.body-copy p + p { margin-top: 1.1em; }
.body-copy strong { color: var(--text); font-weight: 500; }

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* Section header: label column + heading column (Swiss grid) */
.section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
@media (min-width: 900px) {
  .section-head {
    grid-template-columns: 3fr 9fr;
    align-items: start;
  }
  .section-head .eyebrow { padding-top: 0.9em; }
}
.section-head .lead { margin-top: 20px; }

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease),
              border-color 0.15s var(--ease), transform 0.15s var(--ease);
  white-space: nowrap;
}
.btn .arrow { transition: transform 0.15s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--white);
  border-color: var(--white);
  color: var(--bg);
}
.btn-primary:hover { background: #D9DDE5; border-color: #D9DDE5; }

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.32);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
  transition: border-color 0.15s var(--ease);
}
.link-arrow:hover { border-color: var(--white); }

/* ---------- Cards ---------- */

/* A plain raised surface with a hairline. Depth comes from the surface step, not blur or glow. */
.glass {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.glass.is-interactive:hover { border-color: var(--line-strong); }

/* ---------- Navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(14, 18, 26, 0.6);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: var(--surface-glass-strong);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--white);
}
.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
}

.brand-footer { display: inline-block; }
.brand-logo {
  width: clamp(112px, 14vw, 160px);
  height: auto;
}

/* The logo images are swapped for a spinning letter-ring canvas by main.js. */
.ring-canvas { display: block; aspect-ratio: 1; }

.nav-links {
  display: none;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.nav-links a:hover { color: var(--white); background: rgba(255, 255, 255, 0.05); }
.nav-links a[aria-current="page"] { color: var(--white); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--white);
}

.nav-cta { display: none; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
}
.nav-toggle-bars {
  position: relative;
  width: 20px;
  height: 10px;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}
.nav-toggle-bars::before { top: 0; }
.nav-toggle-bars::after { top: 8.5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 4.25px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 4.25px; transform: rotate(-45deg); }

@media (min-width: 860px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; min-height: 36px; padding: 0 16px; font-size: 14px; }
  .nav-toggle { display: none; }
}

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  padding: 24px var(--gutter) 40px;
  background: rgba(14, 18, 26, 0.94);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--line);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0s linear 0.35s;
  overflow-y: auto;
}
.drawer.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), visibility 0s;
}
.drawer ul { list-style: none; }
.drawer li { border-bottom: 1px solid var(--line); }
.drawer li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--muted);
}
.drawer li a[aria-current="page"] { color: var(--white); }
.drawer li a[aria-current="page"]::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--white);
}
.drawer-meta {
  margin-top: auto;
  padding-top: 40px;
  display: grid;
  gap: 8px;
  color: var(--muted);
}
.drawer-meta a:hover { color: var(--white); }

@media (min-width: 860px) {
  .drawer { display: none; }
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: clamp(40px, 8vw, 96px);
  border-top: 1px solid var(--line);
  padding: clamp(48px, 7vw, 88px) 0 32px;
  color: var(--muted);
  font-size: 14px;
}
.footer-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-brand p { margin-top: 16px; max-width: 32ch; }
.footer-col h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; display: grid; gap: 8px; }
.footer-col a { transition: color 0.15s var(--ease); overflow-wrap: anywhere; }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: clamp(48px, 7vw, 80px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}
.footer-legal ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-legal a { color: var(--muted); transition: color 0.15s var(--ease); }
.footer-legal a:hover { color: var(--white); }

/* ---------- Home: hero ---------- */

.hero {
  position: relative;
  padding: clamp(72px, 12vw, 160px) 0 clamp(64px, 9vw, 120px);
}
.hero .eyebrow { margin-bottom: clamp(28px, 4vw, 44px); }
.hero-foot {
  display: grid;
  gap: 32px;
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) {
  .hero-foot {
    grid-template-columns: 6fr 6fr;
    align-items: end;
  }
  .hero-actions { justify-self: end; }
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }


/* ---------- Home: flagship preview ---------- */

.flagship {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .flagship { grid-template-columns: 5fr 7fr; }
}
.flagship-copy {
  padding: clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.flagship-copy .actions { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 12px; }
.flagship-visual {
  position: relative;
  padding: clamp(20px, 3vw, 40px);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
@media (min-width: 960px) {
  .flagship-visual { border-top: 0; border-left: 1px solid var(--line); }
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.tag.is-live { color: var(--white); }
.tag.is-live::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: #4cc38a;
}

/* Mock ledger UI */
.mock {
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 13, 19, 0.85);
  font-size: 13px;
  overflow: hidden;
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
}
.mock-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}
.mock-bar span { margin-left: 8px; color: var(--faint); font-family: var(--font-mono); font-size: 12px; }
.mock-body { padding: 16px; display: grid; gap: 16px; }
.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mock-stat {
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.mock-stat small { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.mock-stat b { display: block; margin-top: 4px; font-size: clamp(14px, 1.6vw, 18px); font-weight: 500; color: var(--white); font-variant-numeric: tabular-nums; }
.mock-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.mock-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--faint);
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
}
.mock-table td { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.mock-table td:last-child, .mock-table th:last-child { text-align: right; }
.mock-table tr:last-child td { border-bottom: 0; }
.mock-table td b { color: var(--text); font-weight: 500; }
/* Receipts by month: neutral bars, the current month in off-white, month labels in mono */
.mock-chart { display: grid; gap: 8px; }
.mock-chart-head { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.mock-bars { display: flex; align-items: end; gap: 8px; height: 64px; border-bottom: 1px solid var(--line); }
.mock-bars span {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: rgba(255, 255, 255, 0.14);
}
.mock-bars span.is-current { background: var(--text); }
.mock-months { display: flex; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.mock-months span { flex: 1; text-align: center; }
.mock-months span.is-current { color: var(--text); }

/* ---------- Value grid / pillars ---------- */

.grid-3 {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.grid-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

.feature {
  padding: clamp(28px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}
.feature .index { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.feature .icon {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
}
.feature .icon svg { width: 20px; height: 20px; }
.feature p { color: var(--muted); }

/* Stat row */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
}
@media (min-width: 860px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat {
  padding: 28px 20px 0 0;
}
.stat b {
  display: block;
  font-size: clamp(36px, 4.6vw, 60px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; max-width: 22ch; }

/* ---------- CTA band ---------- */

.cta {
  padding: clamp(36px, 6vw, 80px);
  display: grid;
  gap: 32px;
}
@media (min-width: 900px) {
  .cta { grid-template-columns: 8fr 4fr; align-items: end; }
  .cta .hero-actions { justify-self: end; }
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero { padding: clamp(64px, 10vw, 136px) 0 clamp(48px, 7vw, 88px); }
.page-hero .eyebrow { margin-bottom: 28px; }
.page-hero .lead { margin-top: 28px; }

/* ---------- Products ---------- */

.product {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.product + .product { margin-top: 16px; }
@media (min-width: 960px) {
  .product { grid-template-columns: 7fr 5fr; }
}
.product-main {
  padding: clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.product-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.product-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.08em;
}
.product-main .body-copy { max-width: 72ch; }
.product-main .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.product-side {
  padding: clamp(28px, 4vw, 56px);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}
@media (min-width: 960px) {
  .product-side { border-top: 0; border-left: 1px solid var(--line); }
}
.spec { list-style: none; display: grid; }
.spec li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.spec li:first-child { padding-top: 0; }
.spec li:last-child { border-bottom: 0; }
.spec dt, .spec .k {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  padding-top: 2px;
}
.spec .v { color: var(--text); }

.checklist { list-style: none; display: grid; gap: 8px; color: var(--muted); }
.checklist li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; }
.checklist li::before {
  content: "";
  width: 10px;
  height: 1px;
  margin-top: 0.8em;
  background: var(--white);
}

/* ---------- About ---------- */

.story {
  display: grid;
  gap: 32px;
}
@media (min-width: 900px) {
  .story { grid-template-columns: 3fr 9fr; }
}
.story .body-copy { font-size: clamp(17px, 1.4vw, 19px); max-width: 72ch; }

.quote {
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: var(--white);
  max-width: 24ch;
}
.quote .dim { color: var(--faint); }

.principles { list-style: none; border-top: 1px solid var(--line); }
.principles li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 760px) {
  .principles li { grid-template-columns: 3fr 4fr 5fr; gap: 24px; align-items: baseline; }
}
.principles .n { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.principles .t { font-size: 18px; font-weight: 500; color: var(--white); letter-spacing: -0.01em; }
.principles .d { color: var(--muted); }

/* ---------- Contact ---------- */

.contact-cards { margin-bottom: 16px; }
.contact-card {
  padding: clamp(28px, 3.5vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}
.contact-card .addr {
  margin-top: auto;
  padding-top: 28px;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--white);
  overflow-wrap: anywhere;
}
.contact-card .card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.copy-btn:hover { color: var(--white); border-color: rgba(255, 255, 255, 0.32); background: rgba(255, 255, 255, 0.05); }
.copy-btn.is-copied { color: var(--white); border-color: var(--white); }

.form-shell {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .form-shell { grid-template-columns: 4fr 8fr; }
}
.form-intro {
  padding: clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 960px) {
  .form-intro { border-bottom: 0; border-right: 1px solid var(--line); }
}
.form-intro .spec { margin-top: auto; padding-top: 16px; }

.form {
  padding: clamp(28px, 4vw, 56px);
  display: grid;
  gap: 22px;
}
.form-row { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 8px; }
.field label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(8, 10, 15, 0.55);
  color: var(--white);
  font-size: 16px;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 160px; resize: vertical; line-height: 1.55; }
.field select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239AA3B2' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}
.field select option { background: var(--surface); color: var(--text); }
.field input::placeholder,
.field textarea::placeholder { color: var(--faint); }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: rgba(255, 255, 255, 0.26); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--white);
  background: rgba(8, 10, 15, 0.8);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #F2A7A7; }
.field-error { font-size: 13px; color: #F2A7A7; min-height: 0; }
.field-error:empty { display: none; }

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 6px;
}
.form-note { font-size: 13px; color: var(--faint); max-width: 44ch; }
.form-note a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.form-status {
  font-size: 14px;
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}
.form-status[hidden] { display: none; }

/* ---------- 404 ---------- */

.not-found { padding: clamp(96px, 16vw, 200px) 0; }
.not-found .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* ---------- Cursor ---------- */

.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease), width 0.3s var(--ease), height 0.3s var(--ease),
              margin 0.3s var(--ease), background-color 0.3s var(--ease), border-color 0.3s var(--ease);
  will-change: transform;
}
.cursor-ring.is-visible { opacity: 1; }
/* The custom cursor that follows the mouse is retired; the system cursor is enough. */
.cursor-ring { display: none !important; }
.cursor-ring.is-hover {
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}
.cursor-ring.is-down { width: 24px; height: 24px; margin: -12px 0 0 -12px; }

/* ---------- Reveal ---------- */

/* One short fade and rise for the first screen only; everything further down is simply there. */
.js :is(.hero, .page-hero, .detail-hero) .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  transition-delay: var(--d, 0s);
}
.js :is(.hero, .page-hero, .detail-hero) .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .cursor-ring { display: none; }
}

@media (hover: none), (pointer: coarse) {
  .cursor-ring { display: none; }
  .glass.is-interactive:hover { transform: none; }
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass { background: var(--surface); }
  .site-header, .drawer { background: var(--bg); }
}

/* Line breaks only on wide screens */
.br-lg { display: none; }
@media (min-width: 900px) { .br-lg { display: inline; } }

/* ---------- Product detail pages ---------- */

.breadcrumb {
  padding-top: clamp(28px, 4vw, 44px);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 10px; }
.breadcrumb li + li::before { content: "/"; color: var(--faint); }
.breadcrumb a { color: var(--muted); transition: color 0.2s var(--ease); }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb [aria-current="page"] { color: var(--white); }

.detail-hero { padding: clamp(40px, 7vw, 96px) 0 clamp(48px, 7vw, 88px); }
.detail-hero .tag-row { margin-bottom: 28px; }
.detail-hero .h1 { max-width: 16ch; }
.detail-hero .lead { margin-top: 28px; max-width: 54ch; }
.detail-hero .hero-actions { margin-top: 40px; }

.badge-store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 20px 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}
.badge-store svg { width: 20px; height: 20px; color: var(--white); flex: none; }
.badge-store b { display: block; font-size: 15px; font-weight: 600; color: var(--white); letter-spacing: -0.01em; }

.spec-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 900px) { .spec-strip { grid-template-columns: repeat(4, 1fr); } }
.spec-strip > div { padding: 24px 20px 24px 0; }
.spec-strip > div + div { padding-left: 20px; border-left: 1px solid var(--line); }
@media (max-width: 899px) {
  .spec-strip > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .spec-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
.spec-strip small {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}
.spec-strip b {
  display: block;
  margin-top: 8px;
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--white);
}

.steps {
  list-style: none;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  counter-reset: step;
}
@media (min-width: 760px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .steps.steps-3 { grid-template-columns: repeat(3, 1fr); } }
.step {
  padding: clamp(28px, 3vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}
.step-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.step-num {
  font-size: clamp(48px, 5vw, 72px);
  font-weight: 600;
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.35);
  font-variant-numeric: tabular-nums;
  transition: color 0.4s var(--ease), -webkit-text-stroke-color 0.4s var(--ease);
}
.step:hover .step-num { color: var(--white); -webkit-text-stroke-color: var(--white); }
.step .icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  color: var(--white);
}
.step .icon svg { width: 20px; height: 20px; }
.step p { color: var(--muted); }
.step .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }
.step .chips .tag { height: 24px; padding: 0 10px; font-size: 11px; }

.callout {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) { .callout { grid-template-columns: 5fr 7fr; } }
.callout-head {
  padding: clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 960px) {
  .callout-head { border-bottom: 0; border-right: 1px solid var(--line); }
}
.callout-body { padding: clamp(28px, 4vw, 56px); }
.callout-body .spec li { grid-template-columns: 130px 1fr; }
@media (max-width: 520px) {
  .callout-body .spec li, .spec li { grid-template-columns: 1fr; gap: 6px; }
}

.pager {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 760px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(24px, 3vw, 36px);
}
.pager .pager-next { text-align: right; align-items: flex-end; }
.pager small {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}
.pager b {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--white);
}
.pager span { color: var(--muted); font-size: 14px; }
.pager-all { margin-top: 24px; margin-inline: auto; text-align: center; }

.product-title-link { transition: color 0.2s var(--ease); }
.product-title-link:hover { color: var(--muted); }

/* ---------- Legal pages ---------- */

.legal-date { margin-top: 20px; color: var(--faint); }
.legal-section { padding-top: 0; }
.legal-layout { display: grid; gap: 40px; }
@media (min-width: 900px) {
  .legal-layout { grid-template-columns: 3fr 9fr; align-items: start; }
  .legal-toc { position: sticky; top: calc(var(--nav-h) + 32px); }
}
.legal-toc ol { list-style: none; display: grid; gap: 4px; margin-top: 16px; }
.legal-toc a {
  display: inline-block;
  padding: 4px 0;
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s var(--ease);
}
.legal-toc a:hover { color: var(--white); }
@media (max-width: 899px) { .legal-toc { display: none; } }

.legal-body { max-width: 72ch; }
.legal-summary { padding: clamp(24px, 3vw, 32px); margin-bottom: 48px; }
.legal-summary-title { font-size: 16px; font-weight: 500; color: var(--white); margin-bottom: 16px; }

.prose { color: var(--muted); line-height: 1.7; }
.prose section + section { margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--line); }
.prose h2 {
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 16px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
.prose p + p, .prose p + ul, .prose ul + p, .prose p + ol, .prose ol + p { margin-top: 16px; }
.prose ul, .prose ol { display: grid; gap: 8px; padding-left: 20px; }
.prose li::marker { color: var(--faint); }
.prose strong { color: var(--text); font-weight: 500; }
.prose a, .legal-note a {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s var(--ease);
}
.prose a:hover, .legal-note a:hover { text-decoration-color: var(--white); }
.prose section { scroll-margin-top: calc(var(--nav-h) + 24px); }

.legal-note {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
  max-width: 72ch;
}

/* ---------- Home: product showcase carousel ---------- */

.showcase { --gap: 16px; --ease-out: cubic-bezier(0.16, 1, 0.3, 1); position: relative; }

/* The track is a native horizontal scroller: one banner per view, snapping into place.
   Touch swipes are the browser's own; main.js adds autoplay, buttons and mouse drag. */
.showcase-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;         /* old Edge */
  /* room for the hover lift and focus ring without clipping them */
  padding-block: 6px;
  margin-block: -6px;
}
.showcase-track::-webkit-scrollbar { display: none; } /* Chrome, Safari */
.js .showcase-track { user-select: none; -webkit-user-select: none; }
.js .showcase.is-dragging .showcase-track { cursor: grabbing; }

.showcase-slide {
  flex: 0 0 100%;
  min-width: 100%;
  box-sizing: border-box;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
              transform 0.35s var(--ease-out), background-color 0.25s var(--ease-out);
}
/* Desktop: copy and CTAs on the left, preview on the right */
@media (min-width: 1024px) {
  .showcase-slide { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: stretch; }
}

.slide-copy {
  padding: clamp(1.5rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.slide-title {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.5rem);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--white);
}
.slide-text { color: var(--muted); font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem); max-width: 48ch; }
.slide-actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

/* The whole card is one link: the title link's overlay covers the slide. */
.slide-link { color: inherit; }
.slide-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.slide-link:focus-visible { outline: none; }
.showcase-slide:has(.slide-link:focus-visible) { outline: 2px solid var(--white); outline-offset: -3px; }

/* The headline animates an inner span, so the link and its full-card overlay never get trapped
   inside an animating element. */
.slide-title .slide-anim { display: inline-block; }

/* Secondary actions sit above the card link and work on their own; the rest of the row lets
   clicks fall through to the card. */
.slide-actions { position: relative; z-index: 2; pointer-events: none; }
.slide-secondary { pointer-events: auto; }

.slide-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
}
.slide-more .arrow { display: inline-block; transition: transform 0.3s var(--ease-out); }

.slide-visual {
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  align-items: center;
}
.slide-visual .mock { width: 100%; min-width: 0; }
.slide-visual .mock-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 480px) {
  .slide-visual .mock-stat { padding: 8px; }
  .slide-visual .mock-stat b { font-size: 13px; }
  .slide-visual .mock-table { font-size: 12px; }
  .slide-visual .mock-table th:nth-child(3), .slide-visual .mock-table td:nth-child(3) { display: none; }
}
@media (min-width: 1024px) {
  .slide-visual { border-top: 0; border-left: 1px solid var(--line); }
}

/* Desktop hover: glass edge glow, slight lift, arrow glides */
@media (hover: hover) and (pointer: fine) {
  .showcase-slide:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 32px -8px rgba(255, 255, 255, 0.12);
  }
  .showcase-slide:hover .slide-more .arrow { transform: translateX(4px); }
  .js .showcase.is-dragging .showcase-slide:hover { transform: none; }
}
.slide-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.4); }

/* Entrance: badge, headline, copy and visual fade and glide up in turn whenever a slide becomes active */
.js .showcase .slide-anim {
  opacity: 0;
  transform: translateY(14px);
}
.js .showcase.is-inview .showcase-slide.is-active .slide-anim {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms + 60ms);
}

/* Controls */
.showcase-controls { display: none; }
.js .showcase-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.showcase-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s var(--ease-out), border-color 0.15s var(--ease-out), background-color 0.15s var(--ease-out);
}
.showcase-btn svg { width: 22px; height: 22px; }
.showcase-btn:hover { color: var(--white); border-color: rgba(255, 255, 255, 0.32); background: rgba(255, 255, 255, 0.05); }
.showcase-toggle { margin-left: 8px; }
.showcase-toggle .icon-play { display: none; }
.showcase.is-user-paused .showcase-toggle .icon-play { display: block; }
.showcase.is-user-paused .showcase-toggle .icon-pause { display: none; }
.showcase.no-autoplay .showcase-toggle { display: none; }

.showcase-pills { display: flex; align-items: center; }
.showcase-pill {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
}
.pill-bar {
  position: relative;
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
  transition: background-color 0.2s var(--ease-out);
}
.showcase-pill:hover .pill-bar { background: rgba(255, 255, 255, 0.32); }
.pill-fill {
  position: absolute;
  inset: 0;
  background: var(--white);
  transform: scaleX(0);
  transform-origin: left center;
}
.showcase-pill[aria-current="true"] .pill-bar { background: rgba(255, 255, 255, 0.24); }
/* The active pill's fill is animated by main.js over the 5.5s autoplay interval. */
.showcase.no-autoplay .showcase-pill[aria-current="true"] .pill-fill { transform: none; }

/* Previews for the other products, built like the ledger preview */
.mock-read { gap: 12px; }
.mock-read-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.mock-read-head b { font-family: var(--font-sans); font-size: 16px; font-weight: 500; color: var(--white); }
.mock-read p { color: var(--muted); font-size: 14px; line-height: 1.7; max-width: none; }
.mock-read p.is-marked { color: var(--text); background: rgba(255, 255, 255, 0.06); border-left: 2px solid var(--white); padding: 8px 12px; border-radius: 0 6px 6px 0; }
.mock-read sup { font-family: var(--font-mono); font-size: 10px; color: var(--faint); margin-right: 6px; }
.mock-note { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; color: var(--text); }
.mock-note small { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }

.mock-deck { grid-template-columns: 1fr; }
@media (min-width: 560px) { .mock-deck { grid-template-columns: 4fr 8fr; align-items: start; } }
.mock-deck-list { list-style: none; display: grid; gap: 4px; counter-reset: deck; }
.mock-deck-list li {
  counter-increment: deck;
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
}
.mock-deck-list li::before { content: counter(deck); font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.mock-deck-list li.is-current { background: rgba(255, 255, 255, 0.06); color: var(--white); box-shadow: inset 0 0 0 1px var(--line-strong); }
.mock-stage {
  aspect-ratio: 16 / 9;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 16px;
  border-radius: 6px;
  background: #05070b;
  border: 1px solid var(--line);
  text-align: center;
  position: relative;
}
.mock-stage small { position: absolute; top: 8px; left: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.mock-stage p { font-size: clamp(16px, 1.6vw, 22px); font-weight: 500; color: var(--white); line-height: 1.3; max-width: none; }
.mock-stage span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.mock-quest { gap: 14px; }
.mock-quest-head { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.mock-progress { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mock-progress span { display: block; height: 100%; background: var(--text); border-radius: 3px; }
.mock-quest p { font-size: clamp(18px, 1.8vw, 24px); font-weight: 500; color: var(--white); max-width: none; }
.mock-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mock-answers span {
  display: grid;
  place-items: center;
  height: 72px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.mock-answers span.is-picked { border-color: #4cc38a; color: #4cc38a; background: rgba(76, 195, 138, 0.08); }

@media (prefers-reduced-motion: reduce) {
  .showcase-track { scroll-behavior: auto; }
  .js .showcase .slide-anim { opacity: 1; transform: none; transition: none; }
  .showcase-slide, .showcase-slide:hover { transform: none; }
}

/* ---------- PinoyLedger: quick start stepper ---------- */

/* Mobile and tablet: a vertical stepper. Wide desktop: five compact cards in a row. */
.quickstart {
  list-style: none;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
}
.quickstart-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  padding: clamp(20px, 2.4vw, 28px);
  overflow: visible;
}
/* A thin line joins each number to the next step on the vertical layout. */
.quickstart-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(clamp(20px, 2.4vw, 28px) + 20px);
  top: calc(clamp(20px, 2.4vw, 28px) + 44px);
  bottom: -13px;
  width: 1px;
  background: var(--line-strong);
}
.quickstart-num {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.quickstart-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.quickstart-title {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--white);
  padding-top: 8px;
}
.quickstart-body p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.quickstart-body p a {
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.quickstart-body p a:hover { text-decoration-color: var(--white); }
/* Where to click inside the app, styled like a small keycap */
.quickstart-where {
  align-self: flex-start;
  margin-top: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .quickstart { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .quickstart-step { grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; }
  .quickstart-title { padding-top: 0; }
  .quickstart-body { height: 100%; }
  .quickstart-where { margin-top: auto; }
  /* On the row layout the connector runs sideways to the next card */
  .quickstart-step:not(:last-child)::after {
    left: calc(clamp(20px, 2.4vw, 28px) + 44px);
    right: -13px;
    top: calc(clamp(20px, 2.4vw, 28px) + 20px);
    bottom: auto;
    width: auto;
    height: 1px;
  }
}

/* ---------- PinoyLedger: books-to-statements highlight ---------- */

.fs-sync {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px);
  padding: clamp(28px, 3vw, 40px);
  align-items: center;
}
@media (min-width: 960px) {
  .fs-sync { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
}
.fs-sync-copy { display: flex; flex-direction: column; gap: 14px; }
.fs-sync-copy .icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  color: var(--white);
}
.fs-sync-copy .icon svg { width: 22px; height: 22px; }
.fs-sync-copy p { color: var(--muted); }

/* Books on the left flow into statements on the right */
.fs-sync-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.fs-col { list-style: none; display: grid; gap: 8px; }
.fs-col li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.fs-col b { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--white); }
.fs-col span { font-size: 12px; color: var(--faint); }
.fs-out li { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.04); }
.fs-out b { font-family: var(--font-sans); font-size: 14px; }
.fs-arrow {
  position: relative;
  width: 56px;
  height: 1px;
  background: var(--line-strong);
}
.fs-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -4px;
  width: 8px;
  height: 8px;
  border-top: 1px solid var(--text);
  border-right: 1px solid var(--text);
  transform: rotate(45deg);
}
.fs-arrow span {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--faint);
}
@media (max-width: 520px) {
  .fs-sync-flow { grid-template-columns: minmax(0, 1fr); }
  .fs-arrow { width: 1px; height: 32px; margin: 4px auto 16px; }
  .fs-arrow::after { top: auto; bottom: 0; right: -4px; transform: rotate(135deg); }
  .fs-arrow span { bottom: auto; top: 50%; left: 12px; transform: translateY(-50%); }
}

/* ---------- Selah: in-page privacy policy ---------- */

.policy-meta { margin-top: 16px; color: var(--muted); }
.policy-meta strong { color: var(--text); font-weight: 500; }
.policy-standalone { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.policy-standalone .mono { color: var(--faint); font-size: 12px; }
.policy-card { padding: clamp(24px, 4vw, 48px); }
.policy-card .prose { max-width: 72ch; }
.policy-intro { color: var(--text); font-size: clamp(16px, 1.3vw, 18px); }
.policy-card .prose section { scroll-margin-top: calc(var(--nav-h) + 24px); }
.policy-card .prose > p + section { margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--line); }
.policy-card .prose section + section { margin-top: 40px; padding-top: 40px; }
.policy-card h3 {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.3;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 16px;
}
.policy-card .prose p + p { margin-top: 16px; }
.policy-callout {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 2px solid var(--line-strong);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.03);
}
.policy-callout p + p { margin-top: 4px; }
.policy-callout .note { margin-top: 12px; font-size: 14px; color: var(--faint); }
/* The empty first column lines the card up under the heading on wide screens only */
@media (max-width: 899px) { #privacy .legal-layout > div[aria-hidden] { display: none; } }
#privacy .legal-layout { gap: 20px; } /* same gap as the heading row, so the card lines up under the title */

/* ---------- Home: curtain-wipe stage ---------- */

:root { --wipe: cubic-bezier(0.77, 0, 0.175, 1); }

/* Header, rails and stage controls take their ink from the slide on screen */
body.home {
  --ui-ink: #FFFFFF;
  --ui-soft: rgba(255, 255, 255, 0.66);
  --ui-line: rgba(255, 255, 255, 0.22);
}
body.home[data-stage-theme="light"] {
  --ui-ink: #0E121A;
  --ui-soft: rgba(14, 18, 26, 0.68);
  --ui-line: rgba(14, 18, 26, 0.2);
}
/* Small type on the red slide is obsidian: white at this size is under 4.5:1 on #E84C3D */
body.home[data-stage-theme="accent"] {
  --ui-ink: #0E121A;
  --ui-soft: #0E121A;
  --ui-line: rgba(14, 18, 26, 0.3);
}
body.home.past-stage,
body.home.nav-open {
  --ui-ink: #FFFFFF;
  --ui-soft: var(--muted);
  --ui-line: var(--line);
}

.home .site-header {
  position: fixed;
  inset: 0 0 auto 0;
  color: var(--ui-ink);
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom-color: transparent;
  transition: color 0.9s var(--wipe), background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.home.past-stage .site-header,
.home.nav-open .site-header {
  background: var(--surface-glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-bottom-color: var(--line);
}
.home .site-header :focus-visible { outline-color: var(--ui-ink); }

.brand-group { display: flex; align-items: center; gap: 16px; min-width: 0; }
.home .brand { color: inherit; font-weight: 600; letter-spacing: -0.02em; }
.home .brand .ring-canvas { transition: filter 0.9s var(--wipe); }
/* The ring's white lettering would vanish on the off-white slide, so it turns dark there */
.home[data-stage-theme="light"]:not(.past-stage):not(.nav-open) .brand .ring-canvas {
  filter: invert(1) hue-rotate(180deg);
}

/* The brand word rolls up one line per slide */
.brand-morph { display: block; height: 1.3em; line-height: 1.3; overflow: hidden; }
.brand-morph-track { display: flex; flex-direction: column; transition: transform 0.9s var(--wipe); }
.brand-morph-track > span { display: block; height: 1.3em; white-space: nowrap; }

.brand-caption {
  padding-left: 16px;
  border-left: 1px solid var(--ui-line);
  font-size: 12px;
  line-height: 1.3;
  color: var(--ui-soft);
  white-space: nowrap;
  transition: color 0.9s var(--wipe), border-color 0.9s var(--wipe);
}
@media (max-width: 560px) { .brand-caption { display: none; } }

.home .nav-links a {
  color: var(--ui-soft);
  transition: color 0.9s var(--wipe);
}
.home .nav-links a:hover,
.home .nav-links a[aria-current="page"] { color: var(--ui-ink); background: transparent; }
.home .nav-links a[aria-current="page"]::after { display: none; }
.home .nav-links a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.nav-indexed sup {
  margin-left: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 0;
  vertical-align: super;
}
.home .nav-toggle { color: var(--ui-ink); }
.home .nav-toggle-bars::before,
.home .nav-toggle-bars::after { background: currentColor; }

/* Vertical rails at the window edges */
.edge-rail {
  position: fixed;
  top: 50%;
  z-index: 90;
  writing-mode: vertical-rl;
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--ui-ink);
  opacity: 0.55;
  pointer-events: none;
  transition: color 0.9s var(--wipe), opacity 0.4s var(--ease);
}
.edge-rail-left { left: calc(var(--gutter) / 2); transform: translate(-50%, -50%) rotate(180deg); }
.edge-rail-right { right: calc(var(--gutter) / 2); transform: translate(50%, -50%); }
.home.past-stage .edge-rail { opacity: 0.4; }
.home.past-stage .edge-rail-right { opacity: 0; }
@media (max-width: 640px) { .edge-rail { display: none; } }

/* The stage */
.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #0E121A;
  isolation: isolate;
  touch-action: pan-y;
}
.stage-slides { position: absolute; inset: 0; }
.stage-slide {
  position: absolute;
  inset: 0;
  display: flex;
  background: var(--slide-bg);
  color: var(--slide-ink);
  visibility: hidden;
}
.stage-slide:first-child { visibility: visible; }
.js .stage-slide { visibility: hidden; }
.js .stage-slide.is-current,
.js .stage-slide.is-entering { visibility: visible; }
.stage-slide.is-current { z-index: 1; }
.stage-slide.is-entering { z-index: 2; }

.theme-dark   { --slide-bg: #0E121A; --slide-ink: #FFFFFF; --slide-soft: rgba(255, 255, 255, 0.66); --slide-link: #FFFFFF; }
.theme-light  { --slide-bg: #F5F5F3; --slide-ink: #0E121A; --slide-soft: rgba(14, 18, 26, 0.68); --slide-link: #0E121A; }
.theme-accent { --slide-bg: #E84C3D; --slide-ink: #FFFFFF; --slide-soft: #0E121A; --slide-link: #0E121A; }

.stage-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: calc(var(--nav-h) + clamp(24px, 6vh, 64px));
  padding-bottom: clamp(120px, 17vh, 168px);
}
.stage-kicker {
  display: flex;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slide-soft);
}
.stage-title {
  font-size: clamp(3.5rem, 9vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--slide-ink);
}
/* Each line rises through its own mask */
.stage-mask { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.stage-line { display: block; will-change: transform; }

.stage-foot {
  margin-top: clamp(24px, 4vh, 40px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
}
.stage-copy { max-width: 40ch; font-size: 15px; line-height: 1.55; color: var(--slide-soft); }
.stage-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  color: var(--slide-link);
  border-bottom: 1px solid currentColor;
}
.stage-link span { transition: transform 0.3s var(--ease); }
.stage-link:hover span { transform: translateX(4px); }
.stage :focus-visible { outline-color: currentColor; }

/* Hairline timer and slide controls */
.stage-ui { display: none; }
.js .stage-ui {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(8px, 2vh, 20px);
  z-index: 3;
  color: var(--ui-ink);
  transition: color 0.9s var(--wipe);
}
.stage-rule { position: relative; height: 1px; overflow: hidden; background: var(--ui-line); transition: background-color 0.9s var(--wipe); }
.stage-rule-fill {
  position: absolute;
  inset: 0;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
}
.stage-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 4px; }
.stage-dots { display: flex; gap: 4px; margin-left: -12px; }
.stage-dots button,
.stage-toggle {
  min-width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ui-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  transition: color 0.2s var(--ease);
}
.stage-dots button:hover,
.stage-dots button[aria-current="true"],
.stage-toggle:hover { color: var(--ui-ink); }
.stage-dots button[aria-current="true"] { text-decoration: underline; text-underline-offset: 6px; }
.stage-toggle { display: grid; place-items: center; margin-right: -12px; }
.stage-toggle svg { width: 20px; height: 20px; }
.stage-toggle .icon-play { display: none; }
.stage.is-user-paused .stage-toggle .icon-play { display: block; }
.stage.is-user-paused .stage-toggle .icon-pause { display: none; }
.stage.no-autoplay .stage-toggle { visibility: hidden; }

@media (max-width: 640px) {
  .stage-foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-morph-track,
  .home .site-header,
  .edge-rail,
  .js .stage-ui { transition: none; }
}
/* Below the stage the brand word returns to k-dgtal. */
.home.past-stage .brand-morph-track { transform: translateY(0) !important; }

/* ---------- Responsive refinements ---------- */

/* Touch: footer, legal and breadcrumb links get a comfortable tap height */
.footer-col a,
.footer-legal a,
.breadcrumb a,
.drawer-meta a { display: inline-flex; align-items: center; min-height: 32px; }
@media (max-width: 1024px) {
  .footer-col a,
  .footer-legal a,
  .breadcrumb a,
  .drawer-meta a { min-height: 44px; min-width: 44px; }
}
.footer-col ul { gap: 0; }
.footer-legal ul { gap: 0 20px; }

/* Phones in landscape and other short screens: the stage fits the window instead of overflowing it */
@media (max-height: 560px) and (orientation: landscape) {
  .stage { min-height: 0; }
  .stage-inner { padding-top: calc(var(--nav-h) + 8px); padding-bottom: 80px; }
  .stage-kicker,
  .stage-copy { display: none; }
  .stage-title { font-size: clamp(2.5rem, 17vh, 8.5rem); }
  .stage-foot { margin-top: 12px; }
  .js .stage-ui { bottom: 4px; }
}

/* Small phones: the four books sit in a 2 x 2 grid so the sync diagram stays short */
@media (max-width: 520px) {
  .fs-sync-flow .fs-col:not(.fs-out) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- About: founder's note ---------- */

.founder-note {
  display: grid;
  gap: 32px;
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
@media (min-width: 900px) {
  .founder-note { grid-template-columns: 3fr 9fr; }
}
.founder-note > .eyebrow { align-self: start; }
.founder-body { max-width: 70ch; }
.founder-title {
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: var(--white);
  max-width: 24ch;
}
.founder-copy {
  margin-top: clamp(28px, 3vw, 40px);
  color: var(--muted);
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.75;
}
.founder-copy p + p { margin-top: 1.2em; }
.founder-sign {
  margin-top: 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--faint);
}
.founder-cta { margin-top: 24px; }

/* ---------- About: PH small business stat strip ---------- */

.ph-stats { margin-bottom: clamp(56px, 7vw, 96px); }
.ph-stats-grid {
  list-style: none;
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  background: var(--line-strong);
  border: 1px solid var(--line-strong);
}
@media (min-width: 600px) { .ph-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1025px) { .ph-stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ph-stat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(24px, 2.4vw, 32px);
  background: var(--surface);
}
.ph-stat-value {
  font-size: clamp(40px, 4.4vw, 60px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 500;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.ph-stat-label {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
}
.ph-stat-note { font-size: 14px; line-height: 1.6; color: var(--muted); }
.ph-stats-source {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--faint);
  max-width: 90ch;
}

/* ---------- Mobile & tablet pass (<= 1024px) ---------- */

/* The stage never grows past the visible screen, so the progress bar stays in view
   on short phones (iPhone SE with Safari's bars shows about 548px). */
.stage { min-height: min(560px, 100svh); }

@media (max-width: 1024px) {
  /* 44px touch targets */
  .brand { min-height: 44px; }
  .nav-links a { height: 44px; }
  .nav-cta { min-height: 44px; }
  /* Arrow links keep their look; an invisible pad grows the tap area to 45px */
  .link-arrow { position: relative; }
  .link-arrow::before { content: ""; position: absolute; inset: -8px 0; }
  .copy-btn { height: 44px; }
  .product-title-link { display: inline-flex; align-items: center; min-height: 44px; }
  .showcase-btn, .showcase-pill { flex: none; }
  .legal-toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
  .legal-toc ol { gap: 0; }
}

/* With the menu open over a light or red slide, the header turns solid so the
   brand and close button sit on obsidian rather than a muddy see-through grey. */
body.home.nav-open .site-header { background: var(--bg); }

/* ---------- Mascot creatures ----------
   One character on every page, in a different pastel each time. The body is a picture; the
   face is drawn here so the bead eyes can follow the cursor, blink, and smile when the
   pointer is on it (creatures.js sets --eye-x / --eye-y and the lean).
   Layers: lean (toward the cursor) > move (the idle loop) > picture + face. */
.critter {
  --face-x: 50%;  /* centre of the face, set to the picture's measurements */
  --face-y: 31%;
  --face-w: 27%;
  position: absolute;
  z-index: 1;
  user-select: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.critter-lean {
  /* --critter-x is set on each creature by creatures.js (setting it on <html> restyled the whole page) */
  transform: translateX(calc(var(--critter-x, 0) * 12px)) rotate(calc(var(--critter-x, 0) * 4deg));
  transform-origin: 50% 100%;
  transition: transform 0.6s var(--ease);
}
.critter-move { position: relative; transform-origin: 50% 100%; }
.critter-move img { display: block; width: 100%; height: auto; }
.critter-shadow {
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -5px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent);
}
.theme-light .critter-shadow { background: radial-gradient(closest-side, rgba(0, 0, 0, 0.28), transparent); }
.theme-accent .critter-shadow { background: radial-gradient(closest-side, rgba(80, 10, 0, 0.45), transparent); }

/* The face: bead eyes and a small flat mouth */
.critter-face {
  position: absolute;
  left: calc(var(--face-x) - var(--face-w) / 2);
  top: var(--face-y);
  width: var(--face-w);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translate(calc(var(--eye-x, 0) * 10%), calc(-50% + var(--eye-y, 0) * 35%));
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.bead {
  position: relative;
  width: 12%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, #2b2630 0 55%, #141118 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  transform: translate(calc(var(--eye-x, 0) * 22%), calc(var(--eye-y, 0) * 22%));
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), scale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: critter-blink 5s infinite;
}
.bead i {
  position: absolute;
  top: 16%;
  left: 20%;
  width: 36%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}
@keyframes critter-blink {
  0%, 93%, 100% { scale: 1 1; }
  95.5% { scale: 1 0.1; }
}
.critter-mouth {
  width: 22%;
  height: 0;
  border-bottom: 2px solid #2b2630;
  border-radius: 50%;
  transition: height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.3s ease;
}
/* Each character blinks on its own beat: see the clay cast block below */

/* Idle loops */
.loop-bob .critter-move { animation: critter-bob 3.6s ease-in-out infinite; }
.loop-bob .critter-shadow { animation: critter-bob-shadow 3.6s ease-in-out infinite; }
@keyframes critter-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5%) rotate(2deg); }
}
@keyframes critter-bob-shadow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.85); opacity: 0.7; }
}
.loop-hop .critter-move { animation: critter-hop 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
.loop-hop .critter-shadow { animation: critter-hop-shadow 2.6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
@keyframes critter-hop {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  12% { transform: translateY(0) scale(1.07, 0.92); }
  30% { transform: translateY(-22%) scale(0.95, 1.06); }
  42% { transform: translateY(-26%) scale(1, 1); }
  58% { transform: translateY(0) scale(1.09, 0.9); }
  68% { transform: translateY(0) scale(0.97, 1.03); }
  78% { transform: translateY(0) scale(1, 1); }
}
@keyframes critter-hop-shadow {
  0%, 12%, 58%, 100% { transform: scale(1); opacity: 1; }
  42% { transform: scale(0.6); opacity: 0.45; }
}
.loop-sway .critter-move { animation: critter-sway 4.2s ease-in-out infinite; }
.loop-sway .critter-shadow { animation: critter-sway-shadow 4.2s ease-in-out infinite; }
@keyframes critter-sway {
  0%, 100% { transform: rotate(-3deg) scale(1, 1); }
  50% { transform: rotate(3deg) scale(1.025, 0.975); }
}
@keyframes critter-sway-shadow {
  0%, 100% { transform: translateX(-4%) scaleX(1); }
  50% { transform: translateX(4%) scaleX(1.06); }
}

/* Pointer on it (or a tap): the eyes widen, the mouth smiles, a happy squish */
.critter:hover .bead,
.critter.is-happy .bead { scale: 1.4; animation: none; }
.critter:hover .critter-mouth,
.critter.is-happy .critter-mouth { width: 26%; height: 7px; }
.critter:hover .critter-move,
.critter.is-happy .critter-move { animation: critter-happy 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) infinite; }
.critter:hover .critter-shadow,
.critter.is-happy .critter-shadow { animation: none; }
@keyframes critter-happy {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  20% { transform: translateY(0) scale(1.08, 0.9); }
  45% { transform: translateY(-12%) scale(0.95, 1.06); }
  70% { transform: translateY(0) scale(1.05, 0.95); }
}

/* Home slides: bottom right of each slide; only the slide on screen animates */
.stage-critter {
  right: clamp(24px, 9vw, 160px);
  bottom: clamp(150px, 24vh, 240px);
  width: clamp(130px, 14vw, 210px);
}
.js .stage-slide:not(.is-current):not(.is-entering) .critter * { animation-play-state: paused; }
.stage-critter.is-popping { animation: critter-pop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.45s both; }
@keyframes critter-pop {
  from { opacity: 0; transform: translateY(40px) scale(0.6); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Inner pages: beside the headline */
.page-hero.has-critter { position: relative; }
.hero-critter {
  right: clamp(24px, 10vw, 180px);
  bottom: clamp(24px, 5vw, 64px);
  width: clamp(120px, 13vw, 190px);
}

@media (max-width: 900px) {
  .stage-critter { top: calc(var(--nav-h) + 40px); bottom: auto; right: clamp(16px, 6vw, 48px); width: clamp(110px, 28vw, 170px); }
  .hero-critter { top: clamp(8px, 3vw, 32px); bottom: auto; right: clamp(16px, 5vw, 40px); width: clamp(72px, 19vw, 120px); }
}
@media (prefers-reduced-motion: reduce) {
  .critter *, .stage-critter.is-popping { animation: none !important; }
  .critter-lean { transform: none; transition: none; }
  .critter-face, .bead { transition: none; }
}

/* Product carousel: the current product's creature rises slowly from behind the top of
   the card, and a tiny one sits behind each slide bar. The clip boxes end exactly at the
   card's top edge and at the bar, so the creatures look like they come up from behind. */
.showcase-peek {
  position: absolute;
  z-index: 0;
  bottom: calc(100% - 12px); /* tucked a little behind the card, which sits on top */
  right: clamp(24px, 8%, 120px);
  width: clamp(72px, 7vw, 100px);
  height: clamp(50px, 4.9vw, 70px);
  /* Hide only what is below the edge they peek over; never crop a tall head */
  clip-path: inset(-400% -100% 0 -100%);
  pointer-events: none;
}
.showcase-viewport { position: relative; z-index: 1; }
.peek-critter {
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(105%);
  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}
.peek-critter.is-up { transform: translateY(32%); transition-delay: 0.5s; }
.peek-critter:not(.is-up) { transition-duration: 0.5s; }

.showcase-pill { position: relative; }
.pill-peek {
  position: absolute;
  left: 50%;
  bottom: calc(50% + 1px);
  width: 24px;
  height: 20px;
  margin-left: -12px;
  /* Hide only what is below the edge they peek over; never crop a tall head */
  clip-path: inset(-400% -100% 0 -100%);
  pointer-events: none;
}
.pill-critter {
  position: absolute;
  left: 1px;
  bottom: 0;
  width: 22px;
  transform: translateY(68%);
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.pill-critter img { display: block; width: 100%; height: auto; }
/* Two dot eyes, big enough to read at this size */
.pill-critter i {
  position: absolute;
  top: 30%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #1d1a22;
}
.pill-critter i:nth-of-type(1) { left: 38%; }
.pill-critter i:nth-of-type(2) { left: 56%; }
.showcase-pill:hover .pill-critter { transform: translateY(45%); }
.showcase-pill[aria-current="true"] .pill-critter { transform: translateY(6%); transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .peek-critter, .pill-critter { transition: none; }
}

/* Tiny teams: little rows of creatures peeking over an edge (the footer's top line on
   every page, and the top of the contact panel). They rise one after another when the
   edge scrolls into view (creatures.js adds .is-in), and pop up a little more on hover. */
.tiny-team {
  position: absolute;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  /* Hide only what is below the edge they peek over; never crop a tall head */
  clip-path: inset(-400% -100% 0 -100%);
  pointer-events: none;
}
.mini-critter {
  position: relative;
  flex: none;
  width: var(--mini, 26px);
  transform: translateY(105%);
  transition: transform 1.1s cubic-bezier(0.34, 1.4, 0.64, 1);
  transition-delay: calc(var(--i, 0) * 0.14s + 0.2s);
  pointer-events: auto;
}
.mini-critter img { display: block; width: 100%; height: auto; }
.mini-critter i {
  position: absolute;
  top: 30%;
  width: max(2px, 7%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #1d1a22;
}
.mini-critter i:nth-of-type(1) { left: 39%; }
.mini-critter i:nth-of-type(2) { left: 57%; }
.tiny-team.is-in .mini-critter { transform: translateY(var(--peek, 38%)); }
.tiny-team.is-in .mini-critter:hover { transform: translateY(4%); transition-delay: 0s; transition-duration: 0.35s; }
/* Each creature has its own peek height, so the row looks lively */
.mini-critter:nth-child(3n + 1) { --peek: 30%; }
.mini-critter:nth-child(3n + 2) { --peek: 18%; }
.mini-critter:nth-child(3n) { --peek: 38%; }

.site-footer { position: relative; }
.footer-team {
  --mini: 34px;
  gap: 8px;
  right: var(--gutter, 24px);
  bottom: calc(100% + 1px);
  height: 34px;
}
.wrap.has-team { position: relative; }
.cta-team {
  --mini: 46px;
  gap: 10px;
  left: clamp(36px, 6vw, 80px);
  bottom: calc(100% - 10px); /* tucked behind the panel's top edge; the panel paints on top */
  height: 54px;
  z-index: 0;
}
.wrap.has-team > .cta { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .mini-critter { transition: none; }
}

/* Products page: two creatures playing catch in the space under PinoyLedger's specs.
   The ball crosses in 1.3s each way: its sideways move is linear, its height eases out on
   the way up and in on the way down, so it follows an arc. Each player squashes as the ball
   reaches it and stretches as it throws. Their eyes rise and fall with the ball. */
.product-side:has(.play-pair) { display: flex; flex-direction: column; }
.play-pair {
  --play: 2.6s;
  position: relative;
  margin-top: auto;
  padding-top: 24px;
  height: 150px;
  min-height: 150px;
  pointer-events: none;
}
.play-floor {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent);
}
.player {
  position: absolute;
  bottom: 0;
  width: 58px;
}
.player-a { left: 10%; }
.player-b { right: 10%; }
.player-body {
  position: relative;
  display: block;
  transform-origin: 50% 100%;
  animation: player-catch var(--play) ease-in-out infinite;
}
.player-b .player-body { animation-delay: calc(var(--play) / -2); }
.player-body img { display: block; width: 100%; height: auto; }
.player-body i {
  position: absolute;
  top: 30%;
  width: 7%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #1d1a22;
  animation: player-look var(--play) infinite;
}
/* Each player glances toward the other */
.player-a .player-body i:nth-of-type(1) { left: 42%; }
.player-a .player-body i:nth-of-type(2) { left: 60%; }
.player-b .player-body i:nth-of-type(1) { left: 33%; }
.player-b .player-body i:nth-of-type(2) { left: 51%; }
@keyframes player-catch {
  0% { transform: translateY(0) scale(1.1, 0.88); }      /* the ball lands: squash */
  7% { transform: translateY(-10%) scale(0.94, 1.08); }  /* throw: stretch up */
  16% { transform: translateY(0) scale(1.03, 0.97); }
  24%, 86% { transform: translateY(0) scale(1, 1); }
  94% { transform: translateY(0) scale(1.03, 0.97); }    /* gets ready */
  100% { transform: translateY(0) scale(1.1, 0.88); }
}
@keyframes player-look {
  0%, 50%, 100% { transform: translateY(0); animation-timing-function: ease-out; }
  25%, 75% { transform: translateY(-140%); animation-timing-function: ease-in; }
}
/* The ball's path runs between the two players' hands */
.play-ball {
  position: absolute;
  left: calc(10% + 44px);
  right: calc(10% + 44px);
  bottom: 30px;
  height: 0;
}
.play-ball { container-type: inline-size; } /* lets the ball travel 100cqw: the path's width */
.play-ball-x {
  position: absolute;
  left: 0;
  bottom: 0;
  animation: ball-x var(--play) linear infinite;
  will-change: transform;
}
.play-ball-y {
  display: block;
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd2cb 0 18%, #ff7a6b 48%, #d9493a 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  animation: ball-y var(--play) infinite;
}
@keyframes ball-x {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(100cqw); }
}
@keyframes ball-y {
  0%, 50%, 100% { transform: translateY(0); animation-timing-function: ease-out; }
  25%, 75% { transform: translateY(-80px); animation-timing-function: ease-in; }
}
@media (prefers-reduced-motion: reduce) {
  .player-body, .player-body i, .play-ball-x, .play-ball-y { animation: none; }
}

/* Home slideshow: four creatures above the slides, chasing each other. troupe.js moves
   them every frame with transforms only: the outer element runs along the ground (so the
   shadow stays down), the inner .critter-move hops, squashes, leans and tumbles. The
   creature matching the slide on screen leads the chase; now and then a chaser trips. */
.stage-troupe {
  position: absolute;
  z-index: 2;
  right: clamp(24px, 5vw, 96px);
  bottom: clamp(150px, 24vh, 240px);
  width: clamp(320px, 44vw, 640px);
  height: clamp(150px, 16vw, 210px);
  pointer-events: none;
}
.troupe-critter {
  left: 0;
  bottom: 0;
  transform-origin: 50% 100%;
  width: clamp(76px, 7.6vw, 116px);
  pointer-events: auto;
  will-change: transform;
}
.troupe-critter .critter-move {
  will-change: transform;
  transform-origin: 50% 100%;
}
.troupe-critter .critter-shadow { transform-origin: 50% 50%; }
body[data-stage-theme="light"] .troupe-critter .critter-shadow { background: radial-gradient(closest-side, rgba(0, 0, 0, 0.25), transparent); }
/* Knocked over: the eyes squeeze shut until it gets back up */
.troupe-critter.is-dazed .bead { scale: 1 0.12; animation: none; }
@media (max-width: 900px) {
  /* Phones: in the open space between the slide label and the headline */
  .stage-troupe { top: calc(var(--nav-h) + 96px); bottom: auto; right: 6vw; width: 86vw; height: min(40vw, 190px); }
  .troupe-critter { width: min(15vw, 76px); }
}

/* The black creature: dark bead eyes need a light ring to read on its body, and a faint
   rim of light keeps its outline from melting into the navy slide */
.char-ink .bead { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.6), 0 1px 0 rgba(255, 255, 255, 0.45); }
.char-ink .critter-mouth { border-bottom-color: rgba(255, 255, 255, 0.65); }
.char-ink img { transition: filter 0.9s var(--wipe); }
body:not([data-stage-theme="light"]):not([data-stage-theme="accent"]) .char-ink img { filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.3)) drop-shadow(0 0 8px rgba(170, 190, 255, 0.14)); }

/* The couch and the TV in the home troupe. troupe.js sizes and places them (once, and on
   resize) on the back of the track. The TV's screen lights up and flickers while the
   creatures are on the couch watching it. */
.troupe-prop {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 5; /* behind every creature: they play in front of the couch and beside the TV */
  transform-origin: 0 100%;
  pointer-events: none;
}
.troupe-prop img { display: block; width: 100%; height: auto; }
.tv-screen {
  position: absolute;
  left: 52%;
  top: 31.5%;
  width: 33%;
  height: 46.5%;
  border-radius: 22% / 18%;
  opacity: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 2px, transparent 2px 4px),
    radial-gradient(circle at 40% 35%, #e9f3ff 0 12%, #9fd0ff 40%, #6c8cff 75%, #3b3f8f 100%);
  box-shadow: 0 0 18px 4px rgba(150, 190, 255, 0.45);
  transition: opacity 0.4s var(--ease);
}
.stage-troupe.is-tv-on .tv-screen {
  opacity: 1;
  animation: tv-flicker 2.2s steps(1) infinite;
}
/* A few "scenes" cut together: the picture jumps between colours */
@keyframes tv-flicker {
  0% { filter: none; }
  22% { filter: hue-rotate(80deg) brightness(1.08); }
  41% { filter: hue-rotate(200deg); }
  58% { filter: brightness(1.18); }
  77% { filter: hue-rotate(300deg) brightness(0.95); }
  100% { filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .stage-troupe.is-tv-on .tv-screen { animation: none; }
}

/* ---------- The clay cast ----------
   Six characters, one picture each. The face is drawn by CSS, so each character says where
   its face sits in its picture (measured by tools/cast_build.py). The tiny ones (teams, slide
   bars, the catch game) place their two dot eyes from the same numbers. */
.char-dumpling { --face-x: 49.9%; --face-y: 44.7%; --face-w: 33.0%; }
.char-dumpling .bead { animation-delay: -0.4s; }
.char-cub { --face-x: 49.8%; --face-y: 31.1%; --face-w: 27.5%; }
.char-cub .bead { animation-delay: -2.4s; }
.char-bloom { --face-x: 49.8%; --face-y: 37.8%; --face-w: 23.2%; }
.char-bloom .bead { animation-delay: -1.0s; }
.char-cactus { --face-x: 51.0%; --face-y: 29.2%; --face-w: 24.0%; }
.char-cactus .bead { animation-delay: -3.1s; }
.char-clay { --face-x: 43.9%; --face-y: 46.2%; --face-w: 32.9%; }
.char-clay .bead { animation-delay: -1.8s; }
.char-ink { --face-x: 49.9%; --face-y: 29.5%; --face-w: 27.1%; }
.char-ink .bead { animation-delay: -4.2s; }
.mini-critter[class*="char-"] i,
.pill-critter[class*="char-"] i,
.player-body[class*="char-"] i {
  top: var(--face-y);
  translate: -50% -50%;
}
.mini-critter[class*="char-"] i:nth-of-type(1),
.pill-critter[class*="char-"] i:nth-of-type(1) { left: calc(var(--face-x) - var(--face-w) * 0.44); }
.mini-critter[class*="char-"] i:nth-of-type(2),
.pill-critter[class*="char-"] i:nth-of-type(2) { left: calc(var(--face-x) + var(--face-w) * 0.44); }
/* Catch-game players glance toward each other */
.player-a .player-body[class*="char-"] i:nth-of-type(1) { left: calc(var(--face-x) - var(--face-w) * 0.3); }
.player-a .player-body[class*="char-"] i:nth-of-type(2) { left: calc(var(--face-x) + var(--face-w) * 0.55); }
.player-b .player-body[class*="char-"] i:nth-of-type(1) { left: calc(var(--face-x) - var(--face-w) * 0.55); }
.player-b .player-body[class*="char-"] i:nth-of-type(2) { left: calc(var(--face-x) + var(--face-w) * 0.3); }
/* Dark dot eyes vanish on the black character: light ones there */
.char-ink > i { background: #ece8f2; }

/* The troupe's bodies are moved by troupe.js every frame; the hover bounce would fight it
   and snap a runner out of its stride. Pointing at one still makes it smile. */
.troupe-critter:hover .critter-move,
.troupe-critter.is-happy .critter-move { animation: none; }
