/*
  Learn AI Here — public site (W1), "Night Shift" style.

  A dark, terminal-flavoured editorial layout: near-black ground (#0f1115), raised slate surfaces for cards and fields,
  light grey text, and one lime accent (#b5f23d) for primary actions, highlighted links and small details. IBM Plex Sans
  sets the text and IBM Plex Mono the labels, metadata and examples (self-hosted, see fonts.css, which the layout loads
  first). Brand details: the ">_" mark, "// " kickers, a block cursor after the home page title, and a three-bar level
  meter that always sits next to the level's name. No frameworks; every page works without JavaScript.

  Contrast (WCAG 2.2 AA; tests/PublicSite/ThemeContrastTests.cs reads these tokens): text #e8eaed on the ground about
  15:1; muted #a0a7b4 about 7.8:1 on the ground and 7.2:1 on a surface; lime on the ground about 14:1; the near-black
  ground colour on a lime fill about 14:1; field borders #6b7382 at least 3.6:1 against fields and the ground.

  The article itself (_DetailBody) is styled by content.css, which the layout loads right after this file and which
  follows these tokens.
*/

:root {
  color-scheme: dark;

  --color-bg: #0f1115;
  --color-bg-alt: #12151a;
  --color-bg-deep: #0b0d10;
  --color-bg-strip: #13161c;
  --color-surface: #161a21;
  --color-surface-raised: #1d222b;
  --color-text: #e8eaed;
  --color-heading: #f5f6f7;
  --color-muted: #a0a7b4;
  --color-subtle: #8b93a1;
  --color-accent: #b5f23d;
  --color-accent-hover: #cdf779;
  --color-on-accent: #0f1115;
  --color-accent-tint: #232b23;
  --color-rule: #272d38;
  --color-rule-strong: #3a414d;
  --color-chip-border: #2e3542;
  /* Outline buttons and text fields: about 3.6:1 on a surface and 4.0:1 on the ground (WCAG 1.4.11 for fields). */
  --color-control-border: #6b7382;
  --color-input-border: #6b7382;
  --color-code-bg: #161a21;
  --color-code-inline-bg: #232934;
  --color-meter-off: #3a414d;
  --color-error: #ff8f87;
  --color-error-tint: #2b1716;
  --color-success: #8ee0a4;
  --color-success-tint: #13241a;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --measure: 70ch;
  --page-width: 75rem;
  --gutter: 1rem;
  --radius: 8px;
  --radius-card: 12px;
  --focus-ring: 3px solid var(--color-accent);
}

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

/* The root takes the footer colour, so on a page shorter than the window the space below the footer continues it;
   the body paints the ground behind the content. */
html {
  background: var(--color-bg-deep);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}

img,
iframe,
video {
  max-width: 100%;
}

::selection {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

/* ---------- Typography ---------- */

h1,
h2,
h3,
h4 {
  margin: 1.5em 0 0.5em;
  color: var(--color-heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-top: 0.5em;
}

h2 {
  font-size: 1.4rem;
}

h3 {
  font-size: 1.15rem;
}

p,
ul,
ol,
dl,
blockquote,
pre,
table {
  margin: 0 0 1rem;
}

strong,
b {
  font-weight: 600;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration-thickness: 2px;
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  background: var(--color-code-inline-bg);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}

pre {
  background: var(--color-code-bg);
  border: 1px solid var(--color-rule);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  line-height: 1.7;
  tab-size: 4;
  white-space: pre;
  max-width: 100%;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
}

blockquote {
  margin-left: 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--color-rule-strong);
  color: var(--color-muted);
}

hr {
  border: 0;
  border-top: 1px solid var(--color-rule);
  margin: 2rem 0;
}

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

th,
td {
  border: 1px solid var(--color-rule);
  padding: 0.45rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--color-surface);
}

/* ---------- Accessibility helpers ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
  border-radius: 0 0 var(--radius) var(--radius);
}

.skip-link:focus {
  top: 0;
  color: var(--color-on-accent);
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

main:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

/* Inline stroke icons (search, arrows, play): decorative, aria-hidden in the markup, drawn in the text colour. */
.icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}

/* ---------- Buttons and labels ---------- */

/* Outline button: light text on the ground with a grey outline; the outline turns lime on hover. */
.button,
.subscribe-callout__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.subscribe-callout__link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  text-decoration: none;
}

/* The one filled button per form or section (Search, Subscribe): near-black on lime, about 14:1. */
.button--primary,
.subscribe-callout__link {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.button--primary:hover,
.subscribe-callout__link:hover {
  border-color: var(--color-accent-hover);
  background: var(--color-accent-hover);
  color: var(--color-on-accent);
}

.button--large {
  min-height: 3rem;
  padding: 0.5rem 1.4rem;
}

/* Content type chip ("Tip", "News", "Video"): mono capitals in a thin outline. */
.label {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--color-rule-strong);
  border-radius: 4px;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.6;
}

/* Small mono heading above a group of controls ("Browse by topic"). */
.section-label {
  margin: 0 0 0.9rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* A section heading with its "All …" link at the other end of the row. */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

.section-head__title {
  margin: 0;
  font-size: 1.75rem;
}

.section-head__title--small {
  font-size: 1.5rem;
}

.section-head__more {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Controls beside the "All …" link (the home tips' Previous/Next buttons). */
.section-head__actions {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 1rem;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-rule);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 2.25rem;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0.75rem var(--gutter);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-logo:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* The ">_" mark: a lime tile with a near-black prompt (also in the footer, the favicon and the share cards). */
.site-logo__mark,
.site-footer__mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.site-logo__mark {
  width: 2.125rem;
  height: 2.125rem;
  font-size: 0.95rem;
}

/*
  On phones the menu always takes its own row. Whether it would fit beside the logo depends on which font has loaded,
  so letting it wrap late would push the whole page down when IBM Plex Mono arrives (a layout shift).
*/
.site-nav {
  flex-basis: 100%;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  border-bottom: 2px solid transparent;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav__link:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* The current section is marked by a lime underline as well as the lime colour (not colour alone). */
.site-nav__link[aria-current] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.site-search {
  display: flex;
  flex: 1 1 18rem;
  align-items: center;
  gap: 0.5rem;
  max-width: 25rem;
  margin-left: auto;
}

/* The label is read by screen readers; sighted readers see the magnifier, the placeholder and the Search button. */
.site-search__label {
  font-weight: 600;
}

.site-search__field {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.site-search__icon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  color: var(--color-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.site-search__input,
.search-form__input,
.filters__select,
.form__input,
.form-field > input[type="email"],
.form-field > input[type="text"] {
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-input-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.site-search__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding-left: 2.4rem;
  font-size: 0.95rem;
}

::placeholder {
  color: var(--color-subtle);
  opacity: 1;
}

/* ---------- Page frame ---------- */

.site-main {
  display: block;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 2rem var(--gutter) 4rem;
}

.page-header {
  max-width: var(--measure);
  margin-bottom: 2rem;
}

.page-header__kicker {
  margin: 0 0 0.75rem;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Decorative prefix with empty alternative text, so screen readers do not read "slash slash". */
.page-header__kicker::before {
  content: "// ";
  content: "// " / "";
}

.page-header__title {
  margin-bottom: 0.75rem;
}

.page-header__lede {
  margin: 0;
  color: var(--color-muted);
  font-size: 1.125rem;
  line-height: 1.6;
}

.page-header__intro {
  margin-top: 1rem;
}

.empty-state {
  max-width: var(--measure);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.empty-state h2 {
  margin-top: 0.25rem;
}

/*
  ---------- Cards ----------
  Tip, news and video cards (Views/Shared/_ContentCard.cshtml), their lists, the share controls, the player and the
  level meter are styled by cards.css, which the layout loads after content.css and the admin previews load too.
*/

/* ---------- Filters and pagination ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  max-width: var(--measure);
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  background: var(--color-bg-alt);
}

.filters__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 11rem;
}

.filters__label {
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filters__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.filters__clear {
  padding: 0.4rem 0;
  font-weight: 600;
}

.listing__count,
.search-page__count {
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.pagination {
  max-width: var(--measure);
  margin: 2rem 0 0;
}

.pagination__status {
  margin: 0 0 0.6rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.pagination__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  text-decoration: none;
}

/* Flex items drop the leading space of " →", so the step links space their arrow with a gap instead. */
.pagination__link--step {
  gap: 0.4em;
}

a.pagination__link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* The current page: a lime fill, bold figures and aria-current (not colour alone). */
.pagination__link--current {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 600;
}

.pagination__gap {
  display: inline-flex;
  align-items: center;
  padding: 0 0.25rem;
  color: var(--color-muted);
}

/* ---------- Home ---------- */

/* One plain line: the title with the terminal cursor, and a muted sentence. No kicker, no buttons. */
.home-intro {
  max-width: var(--measure);
  padding: 0.5rem 0 2.5rem;
}

.home-intro__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* The terminal cursor after the title (decorative, aria-hidden, never blinks). */
.home-intro__cursor {
  display: inline-block;
  width: 0.48em;
  height: 0.86em;
  margin-left: 0.14em;
  vertical-align: -0.06em;
  background: var(--color-accent);
}

.home-intro__lede {
  margin: 0;
  color: var(--color-muted);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* Tips, News, Videos: each section starts on a fine rule. */
.home-section {
  padding: 2.5rem 0 1rem;
  border-top: 1px solid var(--color-rule);
}

.home-section .section-head {
  margin-bottom: 1.25rem;
}

.home-section .card-list--ruled {
  max-width: var(--measure);
}

/* ---------- Topic chips (home page, search suggestions, error page) ---------- */

.topic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.topic-links__item {
  display: flex;
}

.topic-links__link {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.35rem 1rem;
  border: 1px solid var(--color-chip-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-decoration: none;
}

.topic-links__link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  text-decoration: none;
}

.topic-links__count {
  color: var(--color-accent);
  font-weight: 600;
}

/* ---------- Topics ---------- */

.topic-directory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-directory__item {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.topic-directory__name {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

.topic-directory__name a {
  color: var(--color-heading);
  text-decoration: none;
}

.topic-directory__name a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.topic-directory__excerpt {
  margin: 0 0 0.6rem;
  color: var(--color-muted);
  font-size: 0.95rem;
}

.topic-directory__count {
  margin: 0;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.topic-hub__counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.start-here {
  max-width: var(--measure);
  margin-bottom: 2rem;
  padding: 1rem 1.5rem 0.25rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-card);
  background: var(--color-accent-tint);
}

.start-here__heading {
  margin: 0.25rem 0 0.25rem;
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-here .card-list {
  margin-bottom: 0.5rem;
}

/*
  ---------- Detail pages ----------
  The article (Views/Content/_DetailBody.cshtml) is styled by content.css, scoped to .content-detail-layout, which the
  public layout loads right after this file and the admin and import previews load on their own.
*/

/* ---------- Prose (Markdown output: static pages, topic introductions, tip cards) ---------- */

.prose > :first-child {
  margin-top: 0;
}

.prose li + li {
  margin-top: 0.25rem;
}

.prose h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

/* ---------- Search ---------- */

.search-form {
  max-width: var(--measure);
  margin: 0 0 1.5rem;
}

.search-form__label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-form__input {
  flex: 1 1 14rem;
  min-width: 0;
}

.search-form__reset {
  margin: 0.5rem 0 0;
}

/*
  ---------- Static pages and forms ----------
  The contact form (W1) uses .form__* classes; the email subscription pages (W5, Views/Subscriptions) use
  .subscribe-page, .subscribe-form, .form-field, .form-check, .form-hint, .field-error and .form-status. Both share one
  set of rules: labels above fields, full-width inputs, a 2px error border plus an "Error:" text prefix (never colour
  alone), and checkboxes of at least 1.15rem next to labels that are part of the click target.
*/

.static-page,
.subscribe-page {
  max-width: var(--measure);
}

.static-page__lede,
.subscribe-page__intro {
  color: var(--color-text);
  font-size: 1.1rem;
}

.form__field,
.form-field {
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.form__label,
.form-field > label,
.form-field > legend {
  display: block;
  margin-bottom: 0.3rem;
  padding: 0;
  font-weight: 600;
}

.form-field > legend {
  margin-bottom: 0.5rem;
}

.form__optional,
.form__hint,
.form-hint {
  color: var(--color-muted);
  font-weight: 400;
}

.form__hint,
.form-hint {
  margin: 0 0 0.3rem;
  font-size: 0.92rem;
}

.form__input,
.form-field > input[type="email"],
.form-field > input[type="text"] {
  display: block;
  width: 100%;
}

/* An email address needs no full measure; the field still shrinks with the screen. */
.subscribe-form .form-field > input[type="email"] {
  max-width: 32rem;
}

.form__textarea {
  min-height: 10rem;
  resize: vertical;
}

.form__input[aria-invalid="true"],
.form-field > input[aria-invalid="true"] {
  border: 2px solid var(--color-error);
}

.form__choice,
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
}

.form__choice input,
.form-check input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--color-accent);
}

/* A checkbox label may wrap or carry a hint on a second line: keep the box level with the first line. */
.form-check {
  align-items: flex-start;
  padding: 0.2rem 0;
}

.form-check input {
  margin-top: 0.2rem;
}

.form-check label {
  font-weight: 600;
}

.form-check label .form-hint {
  display: block;
  margin: 0;
}

.form__error,
.field-error {
  margin: 0 0 0.3rem;
  color: var(--color-error);
  font-weight: 600;
}

.form-errors {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1.1rem;
  border: 2px solid var(--color-error);
  border-radius: var(--radius);
  background: var(--color-error-tint);
}

.form-errors__heading,
.form-errors h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.form-errors ul {
  margin: 0;
}

.form-errors a {
  color: var(--color-error);
  font-weight: 600;
}

/* A saved or completed action, announced by role="status"; the message itself says what happened. */
.form-status {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--color-success);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--color-success-tint);
  font-weight: 600;
}

.form__note,
.subscribe-form__consent {
  color: var(--color-muted);
  font-size: 0.92rem;
}

/* Honeypot: kept out of view and out of the accessibility tree. */
.form__honeypot,
.subscribe-form__hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Email subscriptions (W5) ---------- */

.subscribe-page form {
  margin: 0 0 1.25rem;
}

.subscribe-form {
  margin-bottom: 1.5rem;
}

.subscribe-page__unsubscribe {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-rule);
}

.subscribe-page__unsubscribe h2 {
  margin-top: 0;
}

/* Call to action at the start of the footer (only while subscriptions are enabled). */
.subscribe-callout {
  max-width: var(--measure);
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.subscribe-callout__heading {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.subscribe-callout__text {
  margin: 0 0 0.9rem;
  color: var(--color-muted);
}

.subscribe-callout__action {
  margin: 0;
}

.error-page__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0;
  list-style: none;
  font-weight: 600;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-rule);
  background: var(--color-bg-deep);
  font-size: 0.875rem;
}

.site-footer__inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
}

.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.875rem;
  margin: 0;
}

.site-footer__mark {
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
}

.site-footer__name {
  font-family: var(--font-mono);
  font-weight: 600;
}

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

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  color: var(--color-text);
}

.site-footer__links a:hover {
  color: var(--color-accent);
}

.site-footer__links a[aria-current] {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration-thickness: 2px;
}

.site-footer__operator {
  margin: 0;
  color: var(--color-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ---------- Wider screens ---------- */

@media (min-width: 48rem) {
  :root {
    --gutter: 1.5rem;
  }

  .site-main {
    padding-top: 2.5rem;
  }

  .site-nav {
    flex-basis: auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* High-contrast modes draw no backgrounds: keep the lime tiles and bars visible as outlines. */
@media (forced-colors: active) {
  .site-logo__mark,
  .site-footer__mark,
  .home-intro__cursor {
    border: 1px solid CanvasText;
  }
}

/* Print on white paper: switch the tokens to dark text on white and drop the bands and shadows. */
@media print {
  :root {
    color-scheme: light;
    --color-bg: #ffffff;
    --color-bg-alt: #ffffff;
    --color-bg-deep: #ffffff;
    --color-bg-strip: #f1f1ec;
    --color-surface: #ffffff;
    --color-surface-raised: #f1f1ec;
    --color-text: #111111;
    --color-heading: #111111;
    --color-muted: #444444;
    --color-subtle: #555555;
    --color-accent: #111111;
    --color-accent-hover: #111111;
    --color-on-accent: #ffffff;
    --color-accent-tint: #ffffff;
    --color-rule: #cccccc;
    --color-rule-strong: #999999;
    --color-code-bg: #f1f1ec;
    --color-code-inline-bg: #f1f1ec;
  }

  .site-header,
  .site-footer,
  .skip-link {
    display: none !important;
  }
}
