/* ==========================================================================
   KIT: the shared look (claudia.gallery). Loaded LAST by _includes/head.html,
   after main.css, merch.css, cart.css, sponsor.css, newsletter.css and core.css,
   so one definition covers every component without editing each file.

   Rules of the look
   - Square corners, 1px hairlines, no glow shadows, no gradient fills.
   - Mono uppercase labels (letter-spacing .14em), condensed uppercase titles.
   - Clay (#d97757) is the one accent. Text on clay is near black.
   - Cards sit on --bg2, hairline --line2, hover brightens the border only.
   Tokens (--bg, --ink, --clay ...) are declared in main.css.
   ========================================================================== */

/* ---- Buttons -------------------------------------------------------------- */
.btn,
.btn-primary,
.btn-secondary,
.btn-access,
.btn-copy,
.post-cta-btn,
.buy-now-btn,
.info-btn,
.checkout-btn,
.freq-btn,
.sponsor-submit-btn,
.newsletter-btn,
.github-stats-action,
.merch-strip a.merch-strip-all,
.researcher-cta a,
.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 0;
  box-shadow: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line2);
  opacity: 1;
  transform: none;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.btn:hover,
.btn-secondary:hover,
.btn-access:hover,
.btn-copy:hover,
.post-cta-btn:hover,
.info-btn:hover,
.freq-btn:hover,
.github-stats-action:hover,
.merch-strip a.merch-strip-all:hover,
.researcher-cta a:hover,
.filter-btn:hover {
  border-color: var(--ink);
  background: rgba(128, 128, 128, 0.1);
  color: var(--ink);
  transform: none;
}

/* Clay: the one primary action on a block */
.btn-primary,
.post-cta-primary,
.buy-now-btn,
.checkout-btn,
.sponsor-submit-btn,
.newsletter-btn,
.freq-btn.is-active,
.freq-btn.active,
.freq-btn[aria-pressed="true"],
.filter-btn.is-active,
.filter-btn.active {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--on-clay) !important;
}
.btn-primary:hover,
.post-cta-primary:hover,
.buy-now-btn:hover,
.checkout-btn:hover,
.sponsor-submit-btn:hover,
.newsletter-btn:hover {
  background: var(--clay2);
  border-color: var(--clay2);
  color: var(--on-clay) !important;
}
.btn:focus-visible,
.post-cta-btn:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

/* ---- Panels --------------------------------------------------------------- */
.post-cta,
.newsletter-box,
.newsletter-card,
.sponsor-card,
.sponsor-tier,
.researcher-card,
.merch-card,
.merch-detail,
.merch-safety,
.gpsr-block,
.trader-block,
.cart-drawer,
.modal-content,
.search-modal-box {
  background: var(--bg2);
  background-image: none;
  border: 1px solid var(--line2);
  border-radius: 0;
  box-shadow: none;
}
.merch-card:hover,
.researcher-card:hover,
.sponsor-tier:hover {
  border-color: var(--ink2);
  box-shadow: none;
  transform: none;
}

/* ---- Labels, kickers, badges --------------------------------------------- */
.post-cta-eyebrow,
.newsletter-eyebrow,
.merch-offer-kicker,
.post-card-label,
.researcher-verdict-label,
.layer-badge,
.fab-cart-badge,
.position-pill,
.github-stat-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 0;
}
.post-cta-eyebrow,
.merch-offer-kicker {
  color: var(--clay);
}

/* ---- Titles inside components -------------------------------------------- */
.post-cta-title,
.newsletter-title,
.pillar-card h3,
.merch-card h2,
.merch-card h3,
.researcher-name {
  font-family: var(--cond) !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.004em;
  line-height: 1.02;
  color: var(--heading-color) !important;
}
.post-cta-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

/* ---- Secondary text: lighter, easier to read on dark -------------------- */
.post-cta-text,
.post-cta-alt,
.post-cta-alt a,
.newsletter-text,
.github-stats-quote {
  color: var(--ink2);
  font-weight: 300;
}
.github-stats-quote {
  font-style: normal;
  font-size: 1.05rem;
  opacity: 1;
}

/* ---- Inputs --------------------------------------------------------------- */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="number"],
select,
textarea {
  border-radius: 0;
  font-family: var(--sans);
  background: var(--bg2);
  color: var(--ink);
  border: 1px solid var(--line2);
  box-shadow: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--clay);
  outline: none;
}

/* ---- Chips and tags ------------------------------------------------------- */
.tag-cloud-item,
.sig-tag,
.tags a,
.post-tags a {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 0;
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--ink2);
  text-decoration: none;
}
.tag-cloud-item:hover,
.tags a:hover,
.post-tags a:hover {
  border-color: var(--clay);
  color: var(--ink);
}

/* ---- Tables, quotes ------------------------------------------------------- */
table,
th,
td {
  border-color: var(--line2);
}
th {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink2);
}
blockquote {
  border-left: 2px solid var(--clay);
  color: var(--ink2);
  font-style: normal;
}

/* ---- Sidebar, breadcrumbs, pagination (Lanyon leftovers used PT Sans) ---- */
.sidebar,
.sidebar-item,
.sidebar-item p {
  font-family: var(--sans);
}
.sidebar-item p {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--ink2);
}
.breadcrumbs,
.breadcrumbs a,
.breadcrumbs .separator,
.pagination,
.pagination-item,
.pagination-page-indicator {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink2);
  border-radius: 0;
}
.breadcrumbs a:hover,
.pagination a:hover {
  color: var(--ink);
}
.pagination-item {
  border: 1px solid var(--line2);
  background: transparent;
}
.pagination-item.disabled {
  opacity: 0.4;
}

/* ---- Flat fills: no gradients on blocks ---------------------------------- */
.merch-hero,
.sponsor-hero {
  background: var(--bg2);
  background-image: none;
  border: 1px solid var(--line2);
  border-radius: 0;
}
.post-card-band {
  background: var(--clay);
  background-image: none;
}
.tcai-diagram-facade {
  background-image: none;
}
select,
.substrate-banner {
  border-radius: 0;
}

/* ---- Compact header ------------------------------------------------------- */
.masthead {
  padding-top: 0.4rem;
}
.masthead-nav {
  margin: 0.4rem auto 0.2rem;
  gap: 0.2rem 1.15rem;
  font-size: 0.6rem;
}
.masthead-nav a {
  padding: 0.2rem 0;
}
.masthead-nav a.sponsor-nav-btn,
.masthead-nav a.contact-nav-btn {
  height: 26px;
  padding: 0 10px;
}
.merch-nav-badge {
  font-size: 0.52rem;
  padding: 0.22rem 0.4rem;
}
.github-stats-banner-wrapper {
  padding: 0.35rem 0 0.5rem;
}
.github-stats-banner-content,
.github-stats-info {
  gap: 0.5rem;
}
.github-stats-quote {
  font-size: 0.9rem;
  color: var(--ink2);
}
.github-stats-metrics,
.github-stats-actions-row {
  gap: 0.5rem;
}
.github-stat-item {
  padding: 0.3rem 0.8rem;
  gap: 0.45rem;
  background: transparent;
  border: 1px solid var(--line);
  transform: none;
}
.github-stat-value {
  font-family: var(--mono) !important;
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
.github-stat-label {
  font-size: 0.58rem;
  opacity: 1;
  color: var(--ink2);
}
.github-stats-action {
  min-height: 30px;
  padding: 0 12px;
  font-size: 0.6rem;
}
/* ---- Quieter buttons: size and weight ------------------------------------ */
.btn,
.btn-primary,
.btn-secondary,
.btn-access,
.btn-copy,
.post-cta-btn,
.buy-now-btn,
.info-btn,
.checkout-btn,
.freq-btn,
.sponsor-submit-btn,
.newsletter-btn,
.github-stats-action,
.filter-btn {
  min-height: 36px;
  padding: 0 14px;
  font-size: 10.5px;
}

/* ---- Masthead logos: two round badges, same look in dark and light -------- */
.masthead .masthead-logos {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 6px;
  text-align: center;
  margin-bottom: 0.4rem;
}
.masthead .masthead-logos a {
  display: inline-flex;
  width: auto;
  line-height: 0;
  border: 0;
}
.masthead .masthead-logo {
  height: 64px;
  width: 64px;
  border-radius: 50%;
  display: block;
}
/* The circle mark is white line art. A solid black disc behind it keeps it
   legible on the ivory page in light mode and matches the Kardashev badge. */
.masthead .masthead-logo-circle {
  background: #0a0b0d;
}

/* ---- Theme toggle: lives in the masthead nav, so the fixed console rail can
   never cover it. Square track, ink knob, mono caption (DARK or LIGHT). ------ */
.masthead-nav .theme-toggle-wrapper {
  position: relative;
  top: auto;
  right: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.masthead-nav .theme-toggle-wrapper::after {
  content: "LIGHT";
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: var(--ink2);
}
body.dark-mode .masthead-nav .theme-toggle-wrapper::after {
  content: "DARK";
}
.masthead-nav .theme-toggle-label {
  box-sizing: border-box;
  width: 38px;
  height: 20px;
  padding: 0;
  background: var(--bg3);
  border: 1px solid var(--line2);
  border-radius: 0;
}
.masthead-nav .theme-toggle-label:hover {
  border-color: var(--ink2);
}
.masthead-nav .theme-toggle-ball {
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  background: var(--ink);
  border-radius: 0;
}
body.dark-mode .masthead-nav .theme-toggle-ball {
  transform: translateX(18px);
  background: var(--clay);
}
body.dark-mode .masthead-nav .theme-toggle-label {
  background: var(--bg3);
}
.theme-toggle:focus-visible + .theme-toggle-label {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}

/* ---- Shop and sponsor banner: left aligned, flat, hairline head ------------ */
.merch-hero,
.sponsor-hero {
  text-align: left;
  background: none;
  background-image: none;
  border: 0;
  border-top: 1px solid var(--line2);
  padding: 14px 0 0;
  margin-bottom: 2.2rem;
}
body.dark-mode .merch-hero,
body.dark-mode .sponsor-hero {
  background: none;
}
.merch-hero::before,
.sponsor-hero::before {
  content: "Shop / printed to order";
  display: block;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay-text);
}
.sponsor-hero::before {
  content: "Sponsor / fund the research";
}
.merch-hero h1,
.sponsor-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 0.95;
}
.merch-hero .tagline,
.sponsor-hero .tagline,
.merch-hero p {
  max-width: 36em;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--ink2);
}
.merch-offer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 18px;
  width: fit-content;
  max-width: 100%;
  margin: 24px 0 0;
  padding: 12px 18px;
  text-align: left;
  background: var(--bg2);
  color: var(--ink);
  border: 1px solid var(--line2);
  border-left: 2px solid var(--clay);
  border-radius: 0;
}
.merch-offer .merch-offer-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay-text);
}
.merch-offer .merch-offer-text {
  margin: 0;
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink);
}
.merch-offer .merch-offer-text strong {
  font-weight: 500;
  color: var(--clay-text);
}
.merch-offer .merch-offer-note {
  display: inline;
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 1;
  color: var(--ink3);
}
.merch-hero-product h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
}

/* ---- Content width -------------------------------------------------------------
   The old .container capped every page at 42rem, which left wide empty side
   areas on large screens. The column is now wide. Plain prose (paragraphs,
   lists, quotes without a class) keeps the old 42rem line length, so reading
   comfort is unchanged; cards, grids, tables, banners and the clock use the
   full width. */
.container,
.content.container {
  max-width: min(1180px, 100%);
}
.content :is(p, ul, ol, blockquote, dl):not([class]) {
  max-width: 42rem;
}
.content table {
  max-width: 100%;
}

/* ---- Footer newsletter sits on the always-dark footer: no light panel ------- */
.footer-newsletter .newsletter-card {
  background: transparent;
  background-image: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ---- Gradient clip text on the core page: one flat accent ------------------- */
.gradient-text {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  color: var(--clay-text);
}

/* ---- Sponsor page: the form is no longer a narrow centred strip ---------------
   Left aligned with the banner, three tiers in a row, same line length as the
   text blocks below it. */
.sponsor-box,
.sponsor-about {
  max-width: 760px;
  margin-left: 0;
  margin-right: 0;
}
.sponsor-about {
  text-align: left;
}
.tier-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.tier-custom {
  grid-column: 1 / -1;
}
.sponsor-box .sponsor-fineprint,
.sponsor-box .sponsor-alt {
  text-align: left;
}
@media (max-width: 480px) {
  .tier-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- Phones and small tablets (menu button is shown below 48em) ---------------
   The toggle moves to the top right of the header, opposite the menu button, so
   it is not left alone on its own line. The header gets tighter. */
.masthead {
  position: relative;
}
@media (max-width: 48em) {
  .masthead-nav .theme-toggle-wrapper {
    position: absolute;
    top: 14px;
    right: 14px;
    gap: 6px;
  }
  .masthead-nav .theme-toggle-wrapper::after {
    display: none;
  }
  .masthead .masthead-logo {
    height: 56px;
    width: 56px;
  }
  .masthead-nav {
    gap: 0.1rem 0.9rem;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
  }
  .masthead-nav a.sponsor-nav-btn,
  .masthead-nav a.contact-nav-btn {
    height: 28px;
    padding: 0 10px;
  }
  .github-stat-item {
    padding: 0.25rem 0.6rem;
  }
}

/* ---- Wide tables scroll inside their own box instead of widening the page ---- */
.content table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- Phones: shorter header block ---------------------------------------------- */
@media (max-width: 48em) {
  .github-stats-quote {
    display: none;
  }
  .github-stats-banner-wrapper {
    padding-top: 0.5rem;
  }
  .github-stats-metrics,
  .github-stats-actions-row {
    gap: 0.4rem;
  }
  h1 {
    font-size: clamp(1.9rem, 8vw, 2.4rem);
  }
}

/* ---- Console rail button: smaller and tucked into the corner on phones ------ */
@media (max-width: 48em) {
  .crail-fab {
    bottom: 12px;
    right: 12px;
    height: 34px;
    padding: 0 12px;
    font-size: 10px;
  }
}

/* ---- Sponsor tiers: condensed amounts, lighter weight ----------------------- */
.tier-amount {
  font-family: var(--cond);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
}
.tier-custom .tier-amount {
  font-size: 1.1rem;
  text-transform: uppercase;
}
.tier-card {
  background: var(--bg2);
}
.tier-card.selected,
button.tier-card:hover {
  border-color: var(--clay);
}
.tier-card.selected::after {
  color: var(--clay);
}
.tier-blurb {
  font-weight: 300;
}

/* ---- Cart button: flat clay, and stacked above the console button on phones --- */
.fab-cart {
  background-color: var(--clay);
  color: var(--on-clay);
}
.fab-cart:hover {
  background-color: var(--clay2);
  transform: none;
}
.fab-cart-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  border-radius: 0;
}
@media (max-width: 48em) {
  .fab-cart {
    width: 48px;
    height: 48px;
    bottom: 58px;
    right: 12px;
  }
  .fab-cart svg {
    width: 22px;
    height: 22px;
  }
}

/* ---- Contrast fixes found by the audit --------------------------------------- */
small {
  color: var(--ink2);
}
.layer-badge {
  color: var(--ink3);
}
.pagination .pagination-item,
.pagination a.pagination-item {
  color: var(--ink2);
}
.pagination a.pagination-item:hover {
  color: var(--ink);
}

/* ---- Long tag names wrap instead of widening the page on small phones ------- */
.tag-cloud-item {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ---- Architecture diagram (core page): instrument plates, one accent ----------- */
.core-page .architecture-diagram-container {
  background: transparent;
  border: 1px solid var(--line);
  max-width: 44rem;
  gap: 0;
  padding: 2.2rem 1.5rem;
}
.core-page .arch-node {
  background: var(--bg2);
  border: 1px solid var(--line2);
  min-width: 170px;
  padding: 1.4rem 1rem 1.1rem;
  gap: 0.9rem;
}
.core-page .arch-node .node-icon {
  color: var(--ink);
  line-height: 0;
}
.core-page .arch-node .node-label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink2);
}
.core-page .arch-connection {
  width: 120px;
}
.core-page .arch-connection .connection-line {
  height: 1px;
  background: var(--line2);
}
.core-page .arch-connection .connection-line::after {
  top: -3px;
  width: 5px;
  height: 5px;
  border: 0;
  background: var(--clay);
}
.core-page .arch-connection .connection-line::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 5px;
  height: 5px;
  border: 0;
  background: var(--clay);
}
.core-page .arch-connection .connection-label {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink3);
}

/* ---- Console marks: square plate, same on rail cards and console headers ----- */
.crail-logo,
.tcai-console .con-logo {
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* ---- Small UI icons: technical line ends instead of rounded ones -------------- */
svg[stroke="currentColor"] {
  stroke-linecap: square;
  stroke-linejoin: miter;
}
svg.plate-icon {
  stroke-linecap: round;
  stroke-linejoin: round;
}
.search-trigger-icon,
.masthead-search-icon {
  stroke-width: 1.5;
}
.fab-cart svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
}
@media (max-width: 560px) {
  .core-page .architecture-diagram-container {
    flex-direction: column;
    align-items: center;
  }
  .core-page .arch-connection {
    margin: 1rem 0;
  }
}
