/* ============================================================================
   Components — nav, footer, buttons, cards, forms, panels
   ============================================================================ */

/* --- Navigation ---------------------------------------------------------- */

.nav {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.nav__brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: var(--display-weight, 400);
  font-size: 22px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.nav__mark {
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--accent);
  border-radius: 50%;
  transform: translateY(-2px);
  transition: transform 0.4s var(--ease);
}
.nav__brand:hover .nav__mark { transform: translateY(-2px) scale(1.5); }
.nav__brand small {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-left: 4px;
}

.nav__links {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav__link {
  position: relative;
  display: inline-block;
  color: var(--fg-dim);
  padding: 6px 0;
  transition: color 0.3s var(--ease);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.nav__link:hover { color: var(--fg); }
.nav__link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__link[aria-current="page"] { color: var(--fg); }
.nav__link[aria-current="page"]::after { transform: scaleX(1); background: var(--accent); }

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg);
  white-space: nowrap;
}
.nav__cta .dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

/* Mobile menu button — the source design simply hid the links under 820px
   with nothing to replace them, which left small screens unnavigable. */
.nav__toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  place-items: center;
  color: var(--fg);
}
.nav__toggle-bars {
  display: block;
  width: 16px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: background 0.2s var(--ease);
}
.nav__toggle-bars::before,
.nav__toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s var(--ease);
}
.nav__toggle-bars::before { top: -5px; }
.nav__toggle-bars::after { top: 5px; }

.nav[data-open="true"] .nav__toggle-bars { background: transparent; }
.nav[data-open="true"] .nav__toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.nav[data-open="true"] .nav__toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

.nav__drawer {
  display: none;
  position: absolute;
  inset-inline: 0;
  top: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 8px var(--gutter) 28px;
  box-shadow: var(--shadow-lift);
}
.nav__drawer a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: -0.02em;
  color: var(--fg-dim);
  transition: color 0.25s var(--ease), padding-left 0.3s var(--ease);
}
.nav__drawer a:hover,
.nav__drawer a[aria-current="page"] { color: var(--fg); padding-left: 10px; }
.nav__drawer a span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
}

@media (max-width: 900px) {
  .nav { padding: 18px var(--gutter); }
  .nav__links { display: none; }
  .nav__brand small { display: none; }
  .nav__toggle { display: grid; }
  .nav[data-open="true"] .nav__drawer { display: block; }
}
@media (max-width: 560px) {
  /* The lone status dot reads as a stray mark once its label is gone, and the
     drawer already carries a Contact link. */
  .nav__cta { display: none; }
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--fg);
  background: transparent;
  transition:
    background-color 0.3s var(--ease),
    color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    transform 0.3s var(--ease);
}
.btn:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.btn--block { width: 100%; }

.btn .arrow { transition: transform 0.3s var(--ease); flex: none; }
.btn:hover .arrow { transform: translateX(4px); }

.link-underline {
  display: inline-block;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: color 0.3s var(--ease);
}
.link-underline:hover { color: var(--accent); }

/* Circular arrow affordance used on rows and cards */
.arrow-circle {
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease),
              border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.arrow-circle svg { width: 14px; height: 14px; }
.arrow-circle--sm { width: 34px; height: 34px; }
.arrow-circle--sm svg { width: 12px; height: 12px; }

/* --- Pills, tags, filters ------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: all 0.3s var(--ease);
}
.pill:hover { border-color: var(--accent); color: var(--fg); }
.pill[aria-pressed="true"],
.pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 var(--gutter) 32px;
  border-bottom: 1px solid var(--line);
}

.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: #43c98a;
  box-shadow: 0 0 0 3px rgba(67, 201, 138, 0.18);
}

/* --- Marquee -------------------------------------------------------------- */

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 26px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex;
  width: max-content;
  gap: 72px;
  white-space: nowrap;
  animation: marquee 46s linear infinite;
  font-family: var(--font-display);
  font-weight: var(--display-weight, 400);
  font-size: calc(clamp(34px, 6vw, 84px) * var(--display-scale, 1));
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.marquee__item { display: inline-flex; align-items: center; gap: 72px; }
.marquee__item--ghost {
  color: transparent;
  -webkit-text-stroke: 1px var(--fg);
}
.marquee__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

/* --- Cards ---------------------------------------------------------------- */

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--bg-2);
  overflow: hidden;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.card:hover { border-color: var(--accent-line); }

.card-art {
  position: relative;
  overflow: hidden;
  background: var(--bg-3);
}
.card-art svg { width: 100%; height: 100%; }
.card-art__inner { transition: transform 0.8s var(--ease); height: 100%; }
.card:hover .card-art__inner { transform: scale(1.04); }

/* --- Forms ---------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 8px; }
.field label,
.field-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--fg-faint); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 140px; line-height: 1.55; }

.field--invalid input,
.field--invalid textarea { border-color: #e0574f; }
.field__error {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #ff8f86;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--fg);
}
.flash--alert { border-color: rgba(224, 87, 79, 0.5); background: rgba(224, 87, 79, 0.09); }

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

.site-footer {
  padding: clamp(56px, 8vw, 88px) var(--gutter) 40px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(28px, 4vw, 48px);
}
.site-footer__mark {
  font-family: var(--font-display);
  font-weight: var(--display-weight, 400);
  font-size: calc(clamp(38px, 7vw, 92px) * var(--display-scale, 1));
  letter-spacing: -0.03em;
  line-height: 0.95;
  align-self: start;
}
.site-footer__mark p {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: 0;
  color: var(--fg-dim);
  max-width: 34ch;
  margin-top: 24px;
}
.footer-col h2 {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 20px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  color: var(--fg-dim);
  font-size: 15px;
  transition: color 0.3s var(--ease);
}
.footer-col a:hover { color: var(--accent); }

.site-footer__bottom {
  grid-column: 1 / -1;
  margin-top: clamp(32px, 5vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

@media (max-width: 900px) {
  .site-footer { grid-template-columns: 1fr 1fr; }
  .site-footer__mark { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .site-footer { grid-template-columns: 1fr; }
}

/* --- Turbo progress bar ----------------------------------------------------
   Turbo injects its own default stylesheet for this, which the CSP blocks
   (that <style> carries no nonce). Defining it here means the bar works from a
   stylesheet served by this origin — and matches the accent instead of Turbo's
   default blue. Turbo still drives `width` via CSSOM, which CSP allows. */
.turbo-progress-bar {
  position: fixed;
  display: block;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  z-index: 2147483647;
  transition: width 300ms ease-out, opacity 150ms 150ms ease-in;
  transform: translate3d(0, 0, 0);
}

@media print {
  .nav__toggle { display: none !important; }
}

/* --- Flash bar -------------------------------------------------------------
   Sits directly under the nav so form feedback is visible wherever the form
   lives, without shifting the page it returns to. */
.flash-bar {
  display: flex;
  justify-content: center;
  padding: 16px var(--gutter) 0;
}
.flash-bar .flash { max-width: var(--maxw); }

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

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.search__icon { display: grid; place-items: center; color: var(--fg-faint); flex: none; }
.search input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
}
.search input::placeholder { color: var(--fg-faint); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__clear {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.search__clear:hover { color: var(--accent); }

.blog-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 var(--gutter) 28px;
}
.filter-bar--flush { padding: 0; border-bottom: 0; }

.results-summary {
  padding: 0 var(--gutter) 18px;
  color: var(--fg-faint);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
}

/* --- Pagination ------------------------------------------------------------ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 28px);
  flex-wrap: wrap;
  padding: 0 var(--gutter) clamp(56px, 9vw, 110px);
}
.pagination__step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.pagination__step:hover { color: var(--fg); border-color: var(--accent-line); }
.pagination__step.is-disabled { opacity: 0.35; pointer-events: none; }

.pagination__pages { display: flex; gap: 4px; align-items: center; }
.pagination__page {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-faint);
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.pagination__page:hover { color: var(--fg); background: var(--bg-2); }
.pagination__page.is-current { color: var(--accent-ink); background: var(--accent); }

@media (max-width: 620px) {
  .pagination { gap: 10px; }
  .pagination__pages { order: 3; width: 100%; justify-content: center; }
}

/* --- Newsletter ------------------------------------------------------------ */

.newsletter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.newsletter__copy h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 42px);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.newsletter__copy p {
  color: var(--fg-dim);
  font-size: 15px;
  line-height: 1.6;
  max-width: 46ch;
}
.newsletter__field {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.newsletter__field input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.newsletter__field input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.newsletter__field input[type="submit"] { flex: none; cursor: pointer; }

/* Inline variant sits under the closing CTA, centred with the rest of it. */
.newsletter--inline {
  grid-template-columns: 1fr;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  gap: 20px;
}
.newsletter--inline .newsletter__copy h2 { font-size: clamp(20px, 2vw, 26px); }
.newsletter--inline .newsletter__copy p { margin-inline: auto; font-size: 14px; }
.newsletter--inline .newsletter__field { justify-content: center; }

@media (max-width: 820px) { .newsletter { grid-template-columns: 1fr; } }
