/*
 * The whole stylesheet. Plain CSS, one file, no preprocessor.
 *
 * Nothing here reaches the network. No @import, no url(), no webfont. Same
 * rule as apps/site, for the same reason: the page that names the company is
 * a page a store reviewer fetches, and a font or a pixel from somewhere else
 * tells that somewhere else who fetched it. The test in test/site.test.ts
 * fails if a remote reference appears.
 *
 * The values are the literals from @subber/tokens, so this page looks like
 * subber.ca rather than like an unrelated document. They are literals because
 * a file copied to a bucket has no build step that could read the TypeScript.
 * The test compares every variable here against the token it came from.
 *
 * The Subber poster uses the dark-scheme literals directly, in both schemes.
 * It is a printed object, a playbill, and it has to stay night-coloured when
 * the rest of the page is the light paper. Those literals are the same ones
 * the dark :root declares.
 */

:root {
  --color-bg-gradient-from: #e8eaf6;
  --color-bg-gradient-to: #dee1ee;
  --color-bg-surface: #ffffff;
  --color-bg-surface-muted: #f3f4f8;

  --color-text-primary: #1e1e2e;
  --color-text-secondary: #4b5563;
  --color-text-muted: #5b6270;

  --color-brand-primary: #00c853;
  --color-brand-secondary: #7c4dff;
  --color-brand-secondary-hover: #6a3fe6;

  --color-border-default: rgba(124, 77, 255, 0.15);
  --color-border-focus: #7c4dff;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 30px;

  /*
   * Inter first, because that is the token, then the platform UI font.
   * Inter is used if the reader happens to have it and is never downloaded.
   * The display face is a local serif for the same reason: a media house sets
   * its name in a text face, and downloading one would be a third party.
   */
  --font-family-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-family-display: "Palatino Linotype", Palatino, "Iowan Old Style", Georgia, "Times New Roman", serif;

  --layout-prose-width: 42rem;
  --layout-page-width: 72rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --color-bg-gradient-from: #0f0f18;
    --color-bg-gradient-to: #191926;
    --color-bg-surface: #22222f;
    --color-bg-surface-muted: #2e2e3f;

    --color-text-primary: #f2f3f7;
    --color-text-secondary: #c3c7d4;
    --color-text-muted: #9298ab;

    --color-brand-primary: #31d67f;
    --color-brand-secondary: #a78bff;
    --color-brand-secondary-hover: #c0abff;

    --color-border-default: rgba(167, 139, 255, 0.22);
    --color-border-focus: #a78bff;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text-primary);
  background:
    radial-gradient(1200px 520px at 12% -10%, rgba(124, 77, 255, 0.16), transparent 60%),
    linear-gradient(165deg, var(--color-bg-gradient-from) 0%, var(--color-bg-gradient-to) 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 14px;
  border: 1px solid var(--color-border-default);
  border-radius: 2px;
  pointer-events: none;
  z-index: 4;
}

a:focus-visible,
:focus-visible {
  outline: 3px solid var(--color-border-focus);
  outline-offset: 3px;
  border-radius: var(--radius-md);
}

a {
  color: var(--color-brand-secondary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-brand-secondary-hover);
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.bar {
  width: 100%;
  max-width: var(--layout-page-width);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.masthead {
  padding-top: var(--space-lg);
}

.masthead .bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border-default);
}

.wordmark {
  font-family: var(--font-family-display);
  font-size: var(--font-size-xl);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  text-decoration: none;
}

.wordmark::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-right: 0.7em;
  background: var(--color-brand-primary);
  vertical-align: 0.05em;
}

.mast-place {
  margin: 0;
  font-size: var(--font-size-sm);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.hero {
  padding-top: clamp(3rem, 8vw, 6.5rem);
  padding-bottom: var(--space-2xl);
}

.kicker {
  margin: 0 0 var(--space-md);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-brand-secondary);
}

.hero h1,
.missing h1 {
  margin: 0;
  max-width: 11ch;
  font-family: var(--font-family-display);
  font-size: clamp(3.4rem, 9vw, 7.25rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 36rem;
  margin: var(--space-xl) 0 0;
  font-family: var(--font-family-display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text-primary);
}

.hero-note {
  max-width: 38rem;
  margin: var(--space-lg) 0 0;
  color: var(--color-text-secondary);
}

.feature {
  padding-bottom: var(--space-2xl);
}

.poster {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xl);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  background: #0f0f18;
  color: #f2f3f7;
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 70px rgba(15, 15, 24, 0.28);
}

.poster-index {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 5.5rem;
  padding-right: var(--space-lg);
  border-right: 1px solid rgba(167, 139, 255, 0.35);
}

.poster .kicker {
  color: #31d67f;
}

.catalogue {
  margin: var(--space-xl) 0 0;
  font-family: var(--font-family-display);
  font-size: clamp(3rem, 6vw, 4.5rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: #f2f3f7;
}

.catalogue.lone {
  margin: 0 0 var(--space-md);
  color: var(--color-text-primary);
}

.poster h2 {
  margin: 0;
  font-family: var(--font-family-display);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.poster p {
  max-width: 38rem;
  margin: var(--space-lg) 0 0;
  color: #c3c7d4;
}

.poster-link {
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-xl);
  color: #f2f3f7;
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  text-decoration: none;
  border-bottom: 1px solid #31d67f;
  width: fit-content;
}

.poster-link span {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-sm);
  letter-spacing: 0.04em;
  color: #9298ab;
}

.poster-link:hover {
  color: #31d67f;
}

.record {
  display: grid;
  grid-template-columns: minmax(16rem, 0.8fr) 1.2fr;
  gap: var(--space-xl);
  padding-bottom: var(--space-2xl);
}

.record-intro h2,
.correspond h2,
.missing h1 {
  margin: 0;
  font-family: var(--font-family-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.record-intro h2,
.correspond h2 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  max-width: 12ch;
}

.record-intro p:last-child {
  max-width: 28rem;
  margin: var(--space-md) 0 0;
  color: var(--color-text-secondary);
}

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list li {
  margin: 0;
  border-top: 1px solid var(--color-border-default);
}

.link-list li:last-child {
  border-bottom: 1px solid var(--color-border-default);
}

.link-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-lg);
  padding: var(--space-md) 0;
  color: var(--color-text-primary);
  font-weight: 600;
  text-decoration: none;
}

.link-list a::after {
  content: "→";
  color: var(--color-brand-primary);
  font-weight: 500;
}

.link-list a:hover {
  color: var(--color-brand-secondary);
}

.link-list span {
  margin-right: auto;
  font-weight: 400;
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.correspond {
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

.mail {
  display: inline-block;
  margin-top: var(--space-md);
  font-family: var(--font-family-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--color-text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-brand-primary);
}

.mail:hover {
  color: var(--color-brand-secondary);
}

.place {
  margin: var(--space-lg) 0 0;
  color: var(--color-text-secondary);
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border-default);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: var(--space-lg) var(--space-2xl);
  font-size: var(--font-size-sm);
}

.footer-note {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.site-footer a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--color-brand-secondary);
}

@media (max-width: 52rem) {
  body::before {
    inset: 8px;
  }

  .poster,
  .record,
  .footer-row,
  .link-list a {
    display: block;
  }

  .poster-index {
    flex-direction: row;
    align-items: baseline;
    padding-right: 0;
    padding-bottom: var(--space-md);
    border-right: 0;
    border-bottom: 1px solid rgba(167, 139, 255, 0.35);
  }

  .catalogue {
    margin: 0;
  }

  .link-list span {
    display: block;
    margin: var(--space-xs) 0 0;
  }

  .link-list a::after {
    display: none;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(900px 420px at 80% -10%, rgba(167, 139, 255, 0.18), transparent 55%),
      linear-gradient(165deg, var(--color-bg-gradient-from), var(--color-bg-gradient-to));
  }

  .poster {
    background: #22222f;
    box-shadow: none;
    border: 1px solid rgba(167, 139, 255, 0.38);
  }
}
