/* ---- 2. Reset & base ----------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  /* The reference's base layer applies `border-border` to every element
     (`@layer base { * { @apply border-border outline-ring/50 } }`), so any
     border utility without an explicit colour resolves to the border token,
     not `currentColor`. PARITY B14 added this default to match. */
  border-color: var(--ta-border);
}

/* PARITY (B08, shared): the reference's `@layer base` sets every element's
   border colour to the border token (`* { @apply border-border }`, in
   old/core/app/app.css), which Tailwind's preflight (`border-color: inherit`)
   then propagates down the tree. Without the same default, a bare
   `border-b` / `divide-y` (no colour utility) resolves to `currentColor`
   instead of the hairline, so list rules and cell borders come out dark.
   Components that set their own border colour still win — this is only the
   default every un-coloured border inherits. */
* {
  border-color: var(--ta-border);
}

/* Touch: strip the browser's native tap-flash overlay — the grey/translucent
   "touch shadow" iOS Safari and Android Chrome paint over a link, button, nav
   row or table row for the instant it's tapped. It reads as a stray shadow
   over the app's flat surfaces, so silence it for every element. Keyboard
   focus is still signalled separately via `:focus-visible`, so accessibility
   is unaffected. */
* {
  -webkit-tap-highlight-color: transparent;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--ta-bg);
  color: var(--ta-text);
  font-family: var(--ta-font);
  font-size: 16px;
  font-weight: 400;
  /* Inter body readable; titles stay thin (100) */
  /* 1.5, the reference's body leading. Not a free parameter: it is the base
     every un-classed run of text inherits, so a looser value quietly makes
     every panel taller than the reference's and no per-component padding fix
     brings the two back into line. */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Remove horizontal scroll bars ---------------------------------------
   The app never shows a horizontal scrollbar. The page root clips any
   horizontal overflow (both `html` and `body`, the standard pattern; `clip`
   keeps `position: sticky`/`fixed` working because it does not create a
   scroll container, `hidden` is the fallback for older engines). Inner
   scroll bands (tables, tabs, boards, steppers, code blocks, …) keep
   scrolling in-band — we only hide the bar, never clip the content, so it
   stays reachable by trackpad, shift+wheel and keyboard. Vertical scrollbars
   are untouched. */
html,
body {
  overflow-x: hidden;
  overflow-x: clip;
}

/* Blink/WebKit (Chrome, Edge, Safari): hide the horizontal bar on every
   scrollable element; the `:horizontal` pseudo leaves vertical bars alone. */
::-webkit-scrollbar:horizontal {
  display: none;
  height: 0;
}

/* Firefox + legacy Edge can't hide just one axis, so scope `scrollbar-width`
   to the horizontal scroll bands only (the same treatment the root tab bars
   already carry via `[scrollbar-width:none]`). `.overflow-x-auto` is the
   shared Tailwind utility used by the root table wrappers. */
.table-scroll,
.tabs-list,
.board-columns,
.in-care-columns,
.doc-composer-preview,
.summary-table-scroll,
.view-bar,
.admin-code,
.stepper-body,
.overflow-x-auto {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5em;
  color: var(--ta-text);
  /* Titles keep the thin Inter (100) the user asked for. `!important` so no
     component rule (hero/page-head/card titles) can override the thin look;
     body text below is readable at 400 from `body`. */
  font-weight: 200 !important;
  line-height: 1.2;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}

/* PARITY (B08, shared): no `li { line-height }` here — the reference's
   `@layer base` sets none, so a list item inherits the body's 1.5 leading
   (a forced 1.55 made every audit-log / register row a fraction taller than
   the reference's). Components that want a looser list set it themselves. */

a {
  color: var(--ta-accent);
  text-decoration: none;
  transition: color 0.12s ease;
}

a:hover {
  color: var(--ta-accent-hover);
}

small {
  color: var(--ta-muted);
}

strong {
  font-weight: 650;
}

::selection {
  background: var(--ta-accent-soft);
}

/* ---- 3. Layout ------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

main.container {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: 3rem;
}

/* Pages whose first block isn't a topbar need a little air at the top. */
main.container:not(:has(> nav.topbar)) {
  padding-top: 2.5rem;
}

/* Anchored landing sections (#faq, #contact, #how-it-works, #features)
   scroll to just below the sticky topbar instead of hiding underneath it. */
main.container section[id] {
  scroll-margin-top: 5rem;
}

/* ---- 3a. Reference type scale (PARITY B10) -------------------------------
   The old app.css `@utility` type hierarchy, ported verbatim so parity
   components can keep their `text-headline` / `text-caption` classes. Each
   sets size, weight, line-height and negative tracking together — the four
   things that have to move as a unit for type to read as one system. These
   are shared foundation: any parity batch may use them. */
.text-hero {
  font-size: 2.25rem;
  line-height: 1.1;
  font-weight: 100;
  /* thin title tier */
  letter-spacing: -0.03em;
}

.text-large-title {
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 100;
  /* thin title tier */
  letter-spacing: -0.026em;
}

.text-title {
  font-size: 1.25rem;
  line-height: 1.25;
  font-weight: 100;
  /* thin title tier */
  letter-spacing: -0.02em;
}

.text-headline {
  font-size: 1.0625rem;
  line-height: 1.35;
  font-weight: 100;
  /* thin title tier */
  letter-spacing: -0.014em;
}

.text-body {
  font-size: 0.9375rem;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0;
}

.text-label {
  font-size: 0.8125rem;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0;
}

.text-caption {
  font-size: 0.75rem;
  line-height: 1.3;
  font-weight: 400;
}

.text-data {
  font-family: var(--ta-mono);
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 400;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.text-data-lg {
  font-family: var(--ta-mono);
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.text-mono-label {
  font-family: var(--ta-mono);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ta-muted);
  font-variant-numeric: tabular-nums;
}

/* PARITY U/R/A/X: placeholder rendered by unported component stubs. Agents
   replace each stub with the real port; this rule only shows while a batch
   is unfinished. */
.u-stub {
  padding: 24px;
}

.u-stub-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 120px;
  padding: 24px;
  border: 1px dashed var(--ta-border, rgba(127, 127, 127, 0.4));
  border-radius: var(--ta-r-md, 12px);
  color: var(--ta-muted, #888);
  font-size: 14px;
}

.u-stub-tag {
  font-family: var(--ta-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--ta-glass-soft, rgba(127, 127, 127, 0.12));
}