/*
  Element defaults and typography.
  Saira Condensed is reserved for brand and page-level titles (see
  docs/superpowers/specs/2026-08-31-web-ui-polish.md §3). Everything inside a
  card, tile, table or form is Inter.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Dark theme only: tells the UA to render its own chrome (scrollbars, date
     pickers, autofill) dark instead of light-on-white. */
  color-scheme: dark;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  color: var(--color-text-primary);
  background: var(--color-surface-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05" 1, "cv11" 1;
}

/* The public layout is topbar + main + footer; main takes the slack so the
   footer sits at the bottom of short pages without a magic min-height. */
body > main,
body > .app {
  flex: 1 0 auto;
}

a {
  color: var(--color-brand-orange);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-brand-orange-hover);
}

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure {
  margin: 0;
}

/* Page-level titles: the only place the display face appears outside the
   wordmark and standalone display numerals. */
h1 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--color-text-primary);
  font-size: var(--fs-display-md);
  line-height: var(--lh-display-md);
  letter-spacing: var(--ls-display-md);
}

/* Section titles inside product surfaces: body face, so they sit next to
   running Inter copy instead of fighting it. */
h2,
h3,
h4 {
  font-family: var(--font-body);
  color: var(--color-text-primary);
  font-weight: 600;
  letter-spacing: -0.005em;
}

h2 {
  font-size: var(--fs-heading-md);
  line-height: var(--lh-heading-md);
}

h3 {
  font-size: var(--fs-body-md);
  line-height: var(--lh-body-md);
}

h4 {
  font-size: var(--fs-body-md);
  line-height: var(--lh-body-md);
}

b,
strong {
  font-weight: 600;
}

/* Normalization the site actually needs. Bootstrap is no longer loaded (only
   Bootstrap Icons), so these come from here. */
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  margin: 0;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  appearance: button;
}

button:not(:disabled) {
  cursor: pointer;
}

table {
  border-collapse: collapse;
}

ul,
ol {
  margin: 0;
}

hr {
  height: 1px;
  margin: var(--space-5) 0;
  border: 0;
  background: var(--color-border-hairline);
}

::selection {
  background: var(--color-brand-orange);
  color: var(--color-text-on-accent);
}

/* One focus treatment for the whole site. Hairline borders are decorative and
   never carry focus on their own. */
:focus-visible {
  outline: 2px solid var(--color-brand-orange);
  outline-offset: 2px;
}

/* ---- Text utilities ---- */

.muted {
  color: var(--color-text-secondary);
}

.muted-sm {
  color: var(--color-text-secondary);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
}

/* Helper copy under a control or next to an action — smaller than reading copy
   on purpose, so a hint never competes with the body text of the page. */
.hint {
  color: var(--color-text-secondary);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
}

.caption {
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  letter-spacing: var(--ls-caption);
  text-transform: uppercase;
  font-weight: 600;
  color: var(--color-text-secondary);
}

/* Long-form copy stays inside a comfortable measure even in a wide column. */
.measure {
  max-width: var(--measure);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-body-sm);
  font-variant-numeric: tabular-nums;
}

.nums {
  font-variant-numeric: tabular-nums;
}

/* ---- Spacing utilities ---- */

.stack-2 { margin-top: var(--space-2); }
.stack-3 { margin-top: var(--space-3); }
.stack-4 { margin-top: var(--space-4); }
.stack-5 { margin-top: var(--space-5); }

.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;
}

/* ---- Scrollbars: match the dark canvas instead of the OS default ---- */

* {
  scrollbar-color: var(--color-border-strong) transparent;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border: 2px solid transparent;
  background-clip: content-box;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-faint);
  background-clip: content-box;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
