/* Inpan's public pages (home and docs), on the shared KeaiUI public-web
   pattern: the same reading scale and rhythm as Ingrid's site, with Inpan's
   own evidence, a pivot table as static HTML in the grid's own look. */
@import url('./tokens.css');
@import url('./public-web.css');

:root {
  color-scheme: light;
}

html {
  min-width: 300px;
  background: var(--color-surface-page);
}

.landing-page {
  --keaiui-web-page-font-size: var(--text-size-web-subheading);
}

.site-shell {
  --keaiui-web-shell-width: 720px;
  min-height: 100vh;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  max-width: 24ch;
  margin: 0;
  font-size: var(--text-size-web-display);
  font-weight: 600;
  line-height: 1.2;
}

h2 {
  margin: 0;
  font-size: var(--text-size-web-heading);
  line-height: 1.3;
}

h3 {
  margin: 0;
  font-size: var(--text-size-web-subheading);
  line-height: 1.3;
}

.intro {
  padding: var(--space-8) 0 var(--space-7);
}

.hero-lede {
  max-width: 60ch;
  margin: var(--space-6) 0 0;
  font-size: var(--text-size-web-subheading);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-6);
  font-size: var(--text-size-web-body);
}

.fine-print {
  margin: var(--space-5) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-size-web-body);
}

.section {
  padding: var(--space-7) 0;
  border-top: 1px solid var(--color-border);
}

.section > p,
.section > ul {
  max-width: 60ch;
  margin: var(--space-5) 0 0;
}

.section > ul {
  padding-left: 1.2em;
}

.section li + li {
  margin-top: var(--space-2);
}

/* Work in progress: said plainly before anything else, as a notice band. */
.wip-note {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin: var(--space-6) 0 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-1);
  background: var(--color-warning-bg);
  color: var(--color-text);
  font-size: var(--text-size-web-body);
  line-height: 1.5;
}

.wip-note strong {
  flex: none;
  color: var(--color-warning);
  font-size: var(--text-size-web-meta);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The pivot example: a real result, drawn as the grid draws it. */
.pivot-example {
  margin: 0 0 var(--space-8);
}

.pivot-example figcaption {
  margin: var(--space-5) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-size-web-body);
  line-height: 1.5;
}

.pivot-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface-page);
  font-size: var(--text-size-web-body);
  font-variant-numeric: tabular-nums;
}

.pivot-table th,
.pivot-table td {
  padding: 3px var(--space-3);
  border: 1px solid var(--color-border);
  white-space: nowrap;
}

.pivot-table thead th {
  background: var(--color-surface-raised);
  font-weight: 600;
  text-align: right;
}

.pivot-table thead th:first-child,
.pivot-table tbody th {
  text-align: left;
}

.pivot-table tbody th {
  font-weight: 400;
}

.pivot-table td {
  text-align: right;
}

.pivot-table .total th,
.pivot-table .total td {
  background: var(--color-accent-soft);
  font-weight: 600;
}

.pivot-table .level-1 th {
  padding-left: calc(var(--space-3) + 1.2em);
}

.dataset-list {
  display: grid;
  gap: var(--space-3);
  max-width: 60ch;
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.dataset-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: baseline;
}

.dataset-list .count {
  color: var(--color-text-muted);
  font-size: var(--text-size-web-body);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The footer: maker credit beside the mark, then the destinations, as on
   Ingrid's pages. */
.site-footer {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-border-strong);
  color: var(--color-text-muted);
  font-size: var(--text-size-web-body);
}

.site-footer a {
  font-weight: 600;
}

.site-footer p {
  margin: 0;
}

.site-footer p > span {
  display: inline-block;
  width: 0.77em;
  height: 0.77em;
  margin-right: 4px;
  color: var(--color-accent);
}

/* Docs: the home page's reading column, with a contents list. Every page
   keeps one shell width so moving between them never shifts the layout. */

.docs-contents {
  margin: var(--space-6) 0 0;
  font-size: var(--text-size-web-body);
}

.docs-contents ol {
  margin: var(--space-2) 0 0;
  padding-left: 1.4em;
  columns: 2;
}

.docs-page .section h3 {
  margin-top: var(--space-6);
}

.docs-page kbd {
  padding: 0 4px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-1);
  background: var(--color-surface-raised);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

@media (max-width: 639px) {
  .wip-note {
    flex-direction: column;
    gap: var(--space-1);
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-3);
  }

  .hero-actions {
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .docs-contents ol {
    columns: 1;
  }

  .dataset-list li {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
