/* The site's whole look (docs/design.md, ui-plan §11.1). Every colour, size and space comes
   from tokens.css, which build.ts generates from @saints/shared/design/tokens, so light and
   dark follow prefers-color-scheme there. Nothing on the site animates.

   Classes, for pages and components (src/components.ts renders most of them):
   layout     .skip-link .stripe .site-header .wordmark .content .site-footer
   type       .lede .muted .small .meta-line
   headings   .heading-block .heading-block--sky .heading-block--gold
   links      .arrow-link (plain <a> is underlined too)
   buttons    .button .button--harbour .button--crimson .button-row
   forms      .field .label .input .hint
   panels     .status .status--info .status--ok .status--error .notice
   blocks     .section .faq .faq-answer .badges .badge .badges-soon .pill .poster-slot
   [hidden] always hides, even on elements with a display rule. */

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

[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: [hidden] must beat every class that sets display, or a hidden panel would show. */
  display: none !important;
}

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

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

a {
  color: var(--color-harbour);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

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

/* Layout */

.skip-link {
  position: absolute;
  left: var(--space-gutter);
  top: calc(-1 * var(--space-xxl) * 2);
  z-index: 1;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-harbour);
}

.skip-link:focus {
  top: var(--space-sm);
}

.stripe {
  display: flex;
  height: var(--size-stripe);
}

.stripe span {
  flex: 1;
}

.stripe span:nth-child(1) {
  background: var(--stripe-1);
}

.stripe span:nth-child(2) {
  background: var(--stripe-2);
}

.stripe span:nth-child(3) {
  background: var(--stripe-3);
}

.site-header,
.content,
.site-footer {
  max-width: calc(var(--size-text-max) + 2 * var(--space-gutter));
  margin: 0 auto;
  padding-left: var(--space-gutter);
  padding-right: var(--space-gutter);
}

.site-header {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-lg);
}

.wordmark {
  display: inline-block;
  max-width: 100%;
}

.wordmark img {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
}

.content {
  padding-bottom: var(--space-xl);
}

.content:focus {
  outline: none;
}

.site-footer {
  margin-top: var(--space-xxl);
  padding-top: var(--space-lg);
  padding-bottom: var(--space-xl);
  border-top: 1px solid var(--color-hairline);
  color: var(--color-muted);
  font-size: var(--text-small);
}

/* The footer is the site's only way to Support and Delete your account, so each link is a full
   tap target (ui-plan §13) and the row wraps on a phone. The separators are decoration. */
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-left: calc(-1 * var(--space-xs));
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-tap-target);
  padding: var(--space-md) var(--space-xs);
  color: var(--color-muted);
  font-weight: 400;
}

/* Type */

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
}

h1 {
  margin: var(--space-lg) 0 var(--space-md);
  font-size: var(--text-screen-title);
}

h2 {
  margin: var(--space-xxl) 0 var(--space-md);
  font-size: var(--text-section-heading);
}

h3 {
  margin: var(--space-xl) 0 var(--space-sm);
  font-size: var(--text-card-title);
}

p,
ul,
ol {
  margin: 0 0 var(--space-lg);
}

ul,
ol {
  padding-left: var(--space-xl);
}

li + li {
  margin-top: var(--space-xs);
}

strong {
  font-weight: 700;
}

.lede {
  font-size: var(--text-card-title);
}

.muted {
  color: var(--color-muted);
}

.small {
  font-size: var(--text-small);
}

.meta-line {
  margin-bottom: var(--space-md);
  color: var(--color-muted);
  font-size: var(--text-small);
}

/* Tinted heading blocks hug their text (design.md "Signature details"). */

.heading-block {
  display: table;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-heading-block);
  background: var(--color-sky-tint);
  color: var(--color-ink);
}

.heading-block--sky {
  background: var(--color-sky-tint);
}

.heading-block--gold {
  background: var(--color-gold-tint);
}

.heading-block a {
  color: var(--color-ink);
}

/* Links: underlined; arrow links end in "→" from the markup. */

.arrow-link {
  white-space: normal;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
.input:focus-visible {
  outline: 2px solid var(--color-harbour);
  outline-offset: 2px;
}

/* Buttons: filled, full width, at the primary height. */

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--size-primary-button);
  margin: 0 0 var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border: 0;
  border-radius: var(--radius-card);
  background: var(--color-harbour);
  color: var(--color-on-harbour);
  font-family: var(--font-heading);
  font-size: var(--text-button);
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button--harbour {
  background: var(--color-harbour);
  color: var(--color-on-harbour);
}

.button--crimson {
  background: var(--color-crimson);
  color: var(--color-on-crimson);
}

.button:disabled,
.button[aria-disabled="true"] {
  background: var(--color-hairline);
  color: var(--color-muted);
  cursor: not-allowed;
}

.button-row {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.button-row .button {
  margin: 0;
}

/* Forms */

.field {
  margin: 0 0 var(--space-lg);
}

.label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 700;
}

.input {
  display: block;
  width: 100%;
  min-height: var(--size-primary-button);
  padding: var(--space-md);
  border: 1px solid var(--color-muted);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
}

.hint {
  margin-top: var(--space-xs);
  color: var(--color-muted);
  font-size: var(--text-small);
}

/* Panels */

.status {
  margin: 0 0 var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--color-hairline);
  border-left-width: var(--space-xs);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.status > :last-child {
  margin-bottom: 0;
}

/* The deletion pages move focus to the panel that answers the press (tabindex="-1"). */
.status:focus-visible {
  outline: 2px solid var(--color-harbour);
  outline-offset: 2px;
}

.status--info {
  border-left-color: var(--color-harbour);
}

.status--ok {
  border-left-color: var(--color-green);
}

.status--error {
  border-left-color: var(--color-crimson);
  color: var(--color-crimson-text);
}

.notice {
  margin: var(--space-lg) 0;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-heading-block);
  background: var(--color-gold-tint);
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-weight: 600;
}

/* A notice's first line is its label; a list under it (the legal drafts' reviewer notes) is
   ordinary reading text. */
.notice p {
  margin: var(--space-xs) 0;
}

.notice ul {
  margin: var(--space-xs) 0;
  padding-left: var(--space-lg);
  font-family: var(--font-body);
  font-weight: 400;
}

.section {
  margin: var(--space-xxl) 0;
}

.faq {
  margin: 0 0 var(--space-lg);
  border-top: 1px solid var(--color-hairline);
}

.faq details {
  border-bottom: 1px solid var(--color-hairline);
}

.faq summary {
  padding: var(--space-md) 0;
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
}

.faq-answer {
  padding: 0 0 var(--space-md);
}

.faq-answer > :last-child {
  margin-bottom: 0;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.badge {
  display: inline-block;
  line-height: 0;
}

.badge img {
  display: block;
  width: auto;
  height: 40px;
}

.badges-soon {
  margin: 0;
  color: var(--color-muted);
}

.pill {
  display: inline-block;
  padding: 2px var(--space-sm);
  border: 1px solid var(--color-muted);
  border-radius: var(--radius-pill);
  color: var(--color-ink);
  font-family: var(--font-heading);
  font-size: var(--text-pill);
  font-weight: 600;
  line-height: 1.4;
}

.poster-slot {
  aspect-ratio: 16 / 9;
  margin: 0 0 var(--space-lg);
  overflow: hidden;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.poster-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Nothing above animates; this keeps it that way for anyone who asks for less motion. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none;
    transition: none;
    scroll-behavior: auto;
  }
}
