/* godengine.in: "the decision register"
   Concept: a GodEngine decision is filed like an entry in an Indian business ledger (bahi-khata).
   Warm ledger paper, blue-black ink, a vermilion margin rule and rubber-stamp marks, figures in Indian grouping.
   No external fonts, no inline styles. Light and dark follow prefers-color-scheme. */

:root {
  color-scheme: light dark;
  --paper: #f6f0e1;
  --sheet: #fffaf0;
  --ink: #1b2350;
  --ink-2: #4a4f6a;
  --rule: #e2d7bd;
  --rule-strong: #c8b78e;
  --margin: #c2453a;
  --stamp: #a3271d;
  --brass: #6f540c;
  --ok: #1d6436;
  --warn: #8a4500;
  --link: #1d3fa8;
  --chip-bg: #efe6cf;
  --band-a: #e8dcc0;
  --band-b: #d9e2f3;
  --band-c: #f1d9d3;
  --focus: #1d3fa8;
  --scroll-shade: rgba(27, 35, 80, 0.28);
  --shadow: 0 1px 0 rgba(27, 35, 80, 0.06), 0 10px 30px -18px rgba(27, 35, 80, 0.35);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", "Noto Serif", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.2rem + 2.6vw, 2.6rem);
  --step-4: clamp(2.2rem, 1.3rem + 3.6vw, 3.5rem);
  --gutter: 16px;
  --measure: 66ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11152a;
    --sheet: #181d36;
    --ink: #ede5d0;
    --ink-2: #bcb5a1;
    --rule: #262c4c;
    --rule-strong: #3a4270;
    --margin: #e0675b;
    --stamp: #ff8f80;
    --brass: #e3c068;
    --ok: #86d6a1;
    --warn: #ffb870;
    --link: #a9c3ff;
    --chip-bg: #222847;
    --band-a: #2b2f4a;
    --band-b: #24345e;
    --band-c: #4a2a33;
    --focus: #a9c3ff;
    --scroll-shade: rgba(0, 0, 0, 0.7);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 32px -18px rgba(0, 0, 0, 0.8);
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-wrap: break-word;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a[href^="tel:"] { white-space: nowrap; }

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 0.5rem; }

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

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

@media (min-width: 40rem) { :root { --gutter: 24px; } }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 3px double var(--rule-strong);
  background: var(--paper);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 0.9rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand svg { width: 2.1rem; height: 2.1rem; flex: none; }
.brand .tld { color: var(--stamp); }
.brand .lg-bg { fill: var(--ink); }
.brand .lg-mg { stroke: var(--margin); }
.brand .lg-fk { stroke: var(--paper); }
.brand .lg-on { fill: var(--paper); }
.brand .lg-off { fill: var(--ink); stroke: var(--margin); }
.brand:hover { text-decoration: none; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
}
.site-nav a {
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--rule-strong); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--stamp); color: var(--stamp); }

/* ---------- Type ---------- */
h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.18;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); margin: 0 0 0.9rem; }
h3 { font-size: var(--step-1); margin: 1.6rem 0 0.5rem; }
p, ul, ol, dl { margin: 0 0 1rem; }
.lede { font-size: var(--step-1); color: var(--ink-2); max-width: var(--measure); }
.prose { max-width: var(--measure); }
.prose li { margin-bottom: 0.4rem; }
.small { font-size: var(--step--1); color: var(--ink-2); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
strong { font-weight: 700; }

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.6rem;
}

/* ---------- Folio layout (ledger margin) ---------- */
main { display: block; }

.folio {
  padding-block: 2.75rem;
  border-bottom: 1px solid var(--rule);
}
.folio:last-of-type { border-bottom: 0; }
.folio > .wrap { display: block; }
.folio-no {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stamp);
  margin-bottom: 0.75rem;
}
@media (min-width: 52rem) {
  .folio > .wrap {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    column-gap: 2rem;
  }
  .folio-no {
    margin: 0.55rem 0 0;
    padding-right: 1rem;
    border-right: 4px double var(--margin);
    text-align: right;
    align-self: start;
    min-height: 3.5rem;
  }
}

/* ---------- Hero ---------- */
.hero { padding-block: 2.5rem 3rem; border-bottom: 1px solid var(--rule); }
.hero .wrap { display: grid; gap: 2.25rem; }
@media (min-width: 60rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: start; }
}
.hero .lede { margin-bottom: 1.4rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0 0.5rem; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.15rem;
  border: 2px solid var(--ink);
  border-radius: 3px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.2;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: transparent; color: var(--ink); }
.btn-quiet { color: var(--ink); background: transparent; }
.btn-quiet:hover { background: var(--chip-bg); }

/* ---------- The slip (a decision record printed like a voucher) ---------- */
.slip {
  position: relative;
  background-color: var(--sheet);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 1.85rem, var(--rule) 1.85rem, var(--rule) calc(1.85rem + 1px));
  border: 1px solid var(--rule-strong);
  border-top: 2px dashed var(--rule-strong);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.5rem 1.6rem;
  overflow: hidden;
}
.slip::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0.7rem;
  border-left: 3px double var(--margin);
}
.slip-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 0.6rem;
}
.slip-head span { white-space: nowrap; }
.slip dl { margin: 0; }
.slip dt {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
  margin-top: 0.7rem;
}
.slip dd { margin: 0.1rem 0 0; line-height: 1.5; }
.slip .q { font-family: var(--serif); font-size: 1.1rem; }
.slip .win { font-weight: 700; color: var(--ok); }
.slip .lose { color: var(--stamp); }
.slip-stamp {
  position: absolute;
  right: -0.4rem;
  bottom: 0.4rem;
  width: 8.5rem;
  height: 8.5rem;
  opacity: 0.9;
  transform: rotate(-12deg);
  pointer-events: none;
}
.slip-stamp .ring, .stamp-ring { fill: none; stroke: var(--stamp); }
.slip-stamp text, .stamp-text { fill: var(--stamp); font-family: var(--mono); }
/* The stamp is absolutely placed at the bottom right. The foot reserves its full height and width,
   so the stamp never prints over the record text at any width. */
.slip-foot { margin-top: 1rem; padding-right: 7.75rem; min-height: 7.6rem; }

/* ---------- Cards and grids ---------- */
.grid-2, .grid-3, .assess-grid, .family {
  display: grid;
  gap: 1rem;
}
.grid-2, .grid-3, .assess-grid { margin-bottom: 1.25rem; }
@media (min-width: 44rem) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.assess-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); }

.card {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 1.1rem 1.15rem 1.2rem;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.assess {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  border-top: 4px solid var(--ink);
  padding: 1rem 1rem 1.1rem;
}
.assess h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.assess .asks { font-size: var(--step--1); color: var(--ink-2); margin-bottom: 0.6rem; }
.assess .sample { font-family: var(--mono); font-size: 0.85rem; margin: 0; }
.assess.is-auth { border-top-color: var(--stamp); }

.never-avg {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.35rem 0.7rem;
  border: 2px solid var(--stamp);
  color: var(--stamp);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-1.5deg);
}

/* ---------- Ledger tables ---------- */
.table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin: 0 0 1.25rem;
  border: 1px solid var(--rule-strong);
  /* Scroll shadows: the two "local" covers travel with the content and hide the edge shadows
     once the table is scrolled fully to that side, so a shadow only shows where more columns sit. */
  background:
    linear-gradient(to right, var(--sheet) 40%, transparent) left / 2.5rem 100% no-repeat local,
    linear-gradient(to left, var(--sheet) 40%, transparent) right / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shade), transparent) left / 0.9rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shade), transparent) right / 0.9rem 100% no-repeat scroll,
    var(--sheet);
}
.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.ledger caption {
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 3px double var(--rule-strong);
}
.ledger th, .ledger td {
  padding: 0.55rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}
.ledger thead th {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--chip-bg);
}
.ledger tbody th { font-weight: 600; }
.ledger td.amt, .ledger th.amt { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger code, .ledger .mono { font-family: var(--mono); font-size: 0.9em; }
.ledger tr:last-child th, .ledger tr:last-child td { border-bottom: 0; }
.refused { color: var(--stamp); font-weight: 600; }
.accepted { color: var(--ok); font-weight: 600; }

code { font-family: var(--mono); font-size: 0.92em; background: var(--chip-bg); padding: 0.05em 0.3em; border-radius: 2px; }

/* ---------- Steps register ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 1rem 0 1rem 3.4rem;
  border-bottom: 1px solid var(--rule);
}
.steps > li:last-child { border-bottom: 0; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1rem;
  width: 2.5rem;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--stamp);
  border-right: 3px double var(--margin);
  padding-right: 0.4rem;
  text-align: right;
}
.steps h3 { margin: 0 0 0.35rem; }
.steps p:last-child, .steps ul:last-child { margin-bottom: 0; }

/* ---------- Figures (inline SVG art) ---------- */
figure { margin: 0 0 1.25rem; }
.figure-box {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  padding: 1rem;
}
figcaption { font-size: var(--step--1); color: var(--ink-2); margin-top: 0.6rem; }
.fig-svg { display: block; width: 100%; max-width: 32rem; height: auto; margin-inline: auto; }
.fig-svg .axis { stroke: var(--ink); stroke-width: 2; }
.fig-svg .tick { stroke: var(--ink); stroke-width: 1.5; }
.fig-svg .grid { stroke: var(--rule-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.fig-svg .band-a { fill: var(--band-a); }
.fig-svg .band-b { fill: var(--band-b); }
.fig-svg .band-c { fill: var(--band-c); }
.fig-svg .edge { stroke: var(--stamp); stroke-width: 2.5; }
.fig-svg .pin { fill: var(--ink); }
.fig-svg .bar-ok { fill: var(--ok); }
.fig-svg .bar-no { fill: none; stroke: var(--stamp); stroke-width: 2; stroke-dasharray: 5 4; }
.fig-svg .bar-no-fill { fill: var(--band-c); }
.fig-svg text { fill: var(--ink); font-family: var(--sans); font-size: 14px; }
.fig-svg .t-mono { font-family: var(--mono); font-size: 13px; }
.fig-svg .t-muted { fill: var(--ink-2); }
.fig-svg .t-stamp { fill: var(--stamp); font-weight: 700; }
.fig-svg .t-ok { fill: var(--ok); font-weight: 700; }
.fig-svg .t-bold { font-weight: 700; }
.fig-svg .t-serif { font-family: var(--serif); font-size: 16px; }

/* decorative register motif */
.motif { display: block; width: 100%; max-width: 30rem; height: auto; margin: 0 0 1rem; }
.motif .ln { stroke: var(--rule-strong); stroke-width: 1; }
.motif .mg { stroke: var(--margin); stroke-width: 2; }
.motif .dot { fill: var(--ink); }
.motif .dot-r { fill: var(--stamp); }
.motif .lnk { stroke: var(--ink); stroke-width: 1.5; fill: none; }

/* ---------- Status chips (filled at runtime from /data/) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex: none;
}
.chip.is-live { color: var(--ok); border-color: currentColor; }
.chip.is-live::before { background: currentColor; }
.chip.is-beta { color: var(--link); border-color: currentColor; }
.chip.is-beta::before { background: currentColor; }
.chip.is-demo { color: var(--brass); border-color: currentColor; }
.chip.is-building, .chip.is-landing { color: var(--warn); border-color: currentColor; }
.chip.is-offline { color: var(--stamp); border-color: currentColor; }

.status-detail { display: block; font-size: var(--step--1); color: var(--ink-2); margin-top: 0.35rem; overflow-wrap: anywhere; }
.status-detail:empty { display: none; }

/* ---------- Product register ---------- */
.family { gap: 0; border-top: 3px double var(--rule-strong); }
.entry {
  display: grid;
  gap: 0.4rem 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 48rem) {
  .entry { grid-template-columns: 3rem minmax(0, 1fr) 15rem; }
}
.entry-no {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--stamp);
  padding-top: 0.2rem;
}
.entry h3 { margin: 0 0 0.3rem; }
.entry p { margin-bottom: 0.5rem; }
.entry .meta { font-size: var(--step--1); color: var(--ink-2); }
.entry-side { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.entry-side .go { font-weight: 700; }
.note-box {
  border-left: 4px solid var(--brass);
  background: var(--sheet);
  padding: 0.8rem 1rem;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}
.disclaimer {
  border: 1px solid var(--stamp);
  border-left-width: 4px;
  background: var(--sheet);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

/* ---------- Lists ---------- */
.ticks { list-style: none; padding: 0; }
.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: 0.55rem; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.55em;
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--stamp);
  transform: rotate(45deg);
}

dl.faq dt { font-family: var(--serif); font-weight: 700; font-size: 1.12rem; margin-top: 1.25rem; }
dl.faq dd { margin: 0.3rem 0 0; max-width: var(--measure); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 3px double var(--rule-strong);
  margin-top: 1rem;
  padding-block: 2rem 2.5rem;
  font-size: var(--step--1);
  color: var(--ink-2);
}
.site-footer .wrap { display: grid; gap: 1.25rem; }
@media (min-width: 48rem) {
  .site-footer .wrap { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}
.site-footer p { margin-bottom: 0.6rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.site-footer a { color: var(--ink); }
.site-footer .legal { color: var(--ink); font-weight: 600; }

/* ---------- 404 ---------- */
.notfound { padding-block: 4rem; }
.notfound .num-big { font-family: var(--mono); font-size: clamp(3rem, 12vw, 6rem); color: var(--stamp); line-height: 1; margin: 0 0 0.5rem; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn, .site-nav a, .btn-quiet { transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-nav, .skip-link, .actions { display: none; }
  body { background: #fff; color: #000; }
}
