/* ═══════════════════════════════════════════
   shared.css — oulipo.xyz shared styles
   ═══════════════════════════════════════════ */

/* Design tokens (single source of truth for colors / type / spacing / motion) */
@import url("./tokens.css?v=3");

/* Persistent UI chrome — top signup bar + corner chips */
@import url("./chrome.css?v=17");

/* Command palette overlay (MACHINE mode) */
@import url("./palette.css?v=9");

/* Home surface (consumed by /index.html + chrome.js home-overlay) */
@import url("./home.css?v=14");

/* Whomp chat surface — top of the home content */
@import url("./whomp-chat.css?v=2");

/* Cargo Fonts */
@font-face {
  font-display: block;
  font-family: "Standard";
  src: url("https://type.cargo.site/files/Standard-Book.woff") format("woff");
  font-style: normal;
  font-weight: normal;
}
@font-face {
  font-display: block;
  font-family: "Standard";
  src: url("https://type.cargo.site/files/Standard-Bold.woff") format("woff");
  font-style: normal;
  font-weight: bold;
}
@font-face {
  font-display: block;
  font-family: "Terminal Grotesque";
  src: url("https://type.cargo.site/files/TerminalGrotesque.woff")
    format("woff");
  font-style: normal;
  font-weight: normal;
}
@font-face {
  font-display: block;
  font-family: "Diatype Variable";
  src: url("https://type.cargo.site/files/Cargo-DiatypePlusVariable.woff2")
    format("woff2-variations");
  font-style: normal;
  font-weight: 200 1000;
}
@font-face {
  font-display: block;
  font-family: "Diatype Mono Variable";
  src: url("https://type.cargo.site/files/Cargo-DiatypePlusVariable.woff2")
    format("woff2-variations");
  font-style: normal;
  font-weight: 200 1000;
}

/* Base */
html {
  font-size: 16px;
}

:root {
  --type-size-nav: 1.08rem;
  --type-size-base: 1.06rem;
  --type-size-caption: 0.98rem;
  --type-size-meta: 0.96rem;
}

body {
  margin: 0;
  padding: 0;
  background-color: #ffffff;
  color: rgba(0, 0, 0, 0.85);
  font-family: Standard, sans-serif;
  font-size: var(--type-size-base);
  line-height: 1.16;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

a {
  color: rgba(0, 0, 0, 0.85);
  text-decoration: underline;
}

a:hover {
  opacity: 0.7;
}

a:active {
  opacity: 0.7;
}

/* Typography */
h1 {
  font-family: "Terminal Grotesque", sans-serif;
  font-style: normal;
  font-weight: 400;
  margin: 0;
  font-size: 7rem;
  line-height: 0.9;
  color: rgba(0, 0, 0, 0.85);
  letter-spacing: 0;
}

h2 {
  font-family: "Diatype Variable", sans-serif;
  font-style: normal;
  margin: 0;
  color: #000000;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 700;
}

.caption {
  font-size: var(--type-size-caption);
  font-weight: 400;
  color: #000000;
  font-family: "Diatype Mono Variable", monospace;
  font-style: normal;
  line-height: 1.14;
  letter-spacing: 0em;
  font-variation-settings:
    "slnt" 0,
    "MONO" 1;
}

.caption a {
  color: #000000;
  text-decoration: underline;
}

hr {
  background: rgba(0, 0, 0, 0.75);
  border: 0;
  height: 1px;
  display: block;
  margin: 0.5rem 0;
}

/* Layout */
.page {
  padding: 4rem;
  max-width: 100%;
}

.page-content {
  max-width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   .button-8 — primary outlined CTA, large variant of the chip family
   ─────────────────────────────────────────────────────────────
   Halim 2026-05-15: harden the design system so old buttons (Send
   an Email, Vote Now, Reach Out, Contact Halim) read as the same
   family as the new corner chips (CONNECT, HUMAN/MACHINE). The
   Connect aesthetic wins: outlined, monospace, uppercase, 4px
   radius. Just bigger here because these are primary page CTAs,
   not corner micro-buttons.

   Family hierarchy:
   - .chip-name (chrome.css):           outlined micro-chip (corners)
   - .mode-toggle__option (chrome.css): outlined micro-chip with radio
   - .button-8 (here):                  outlined LARGE CTA — same family,
                                        bigger padding + type
   - .signup-bar__submit (chrome.css):  filled-ink variant of .chip-name
   - .section-pill (below):             color-coded decorative pill,
                                        kept distinct (content anchors)
   ═══════════════════════════════════════════════════════════ */
.button-8 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: "Diatype Mono Variable", monospace;
  font-variation-settings:
    "slnt" 0,
    "MONO" 1;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.85);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.85);
  border-radius: 4px;
  padding: 0.6rem 1.1rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;
}
.button-8:hover {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.85);
  opacity: 1;
}
.button-8:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.85);
  outline-offset: 2px;
}
/* Filled variant for primary CTAs (e.g. a single "Subscribe now"
   where attention matters most). Mirrors .signup-bar__submit. */
.button-8--filled {
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  border-color: rgba(0, 0, 0, 0.85);
}
.button-8--filled:hover {
  background: rgba(0, 0, 0, 1);
  color: #ffffff;
  opacity: 0.92;
}

/* Cargo layout splits — asymmetric grids */
.split-5-7 {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 2rem;
  align-items: start;
}

.split-3-8 {
  display: grid;
  grid-template-columns: 3fr 8fr;
  gap: 2rem;
  align-items: start;
}

.split-8-4 {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 2rem;
  align-items: start;
}

/* Footer social icons */
.site-footer-icons {
  border-top: 1px solid rgba(0, 0, 0, 0.75);
  padding-top: 2rem;
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}

.site-footer-icons a {
  font-family: Standard, sans-serif;
  font-size: 1rem;
  color: rgba(55, 55, 55, 0.85);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.site-footer-icons a:hover {
  opacity: 0.7;
}

/* White Header Bar */
.header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5rem;
  background: #ffffff;
  z-index: 150;
}

/* Site Header */
.site-header {
  position: fixed;
  top: 1.5rem;
  left: 4rem;
  z-index: 200;
  font-family: Standard, sans-serif;
  font-size: var(--type-size-nav);
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.site-header a {
  text-decoration: none;
  color: rgba(0, 0, 0, 0.85);
}

.site-header a:hover {
  opacity: 0.7;
}

.site-header.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Menu Toggle Button */
.menu-toggle {
  position: fixed;
  top: 1.5rem;
  right: 4rem;
  z-index: 200;
  background: none;
  border: none;
  cursor: pointer;
  width: 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

/* Invisible 44px touch target */
.menu-toggle::before {
  content: "";
  position: absolute;
  top: -12px;
  right: -12px;
  bottom: -12px;
  left: -12px;
}

.menu-toggle.hidden {
  opacity: 0;
  visibility: hidden;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 1.5px;
  background-color: rgba(0, 0, 0, 0.85);
  transition:
    transform 0.3s,
    opacity 0.3s;
}

.menu-toggle:hover {
  opacity: 0.7;
}

/* Side Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.25);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Side Menu Drawer */
.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  height: 100%;
  background-color: #ffffff;
  z-index: 999;
  padding: 2rem 4rem;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.side-menu.active {
  transform: translateX(0);
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.85);
}

.menu-home {
  font-family: Standard, sans-serif;
  font-size: var(--type-size-nav);
  text-decoration: none;
  color: rgba(0, 0, 0, 0.85);
}

.menu-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: rgba(0, 0, 0, 0.85);
}

.menu-close:hover {
  opacity: 0.7;
}

.menu-section {
  margin-bottom: 0;
}

.menu-section a {
  display: block;
  font-family: Standard, sans-serif;
  font-size: var(--type-size-nav);
  text-decoration: none;
  color: rgba(0, 0, 0, 0.85);
  line-height: 1.15;
}

.menu-section a:hover {
  opacity: 0.7;
}

.menu-divider {
  border: 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.85);
  margin: 0.75rem 0;
}

.external-arrow {
  font-family: "Diatype Mono Variable", monospace;
  font-variation-settings:
    "slnt" 0,
    "MONO" 1;
}

/* Responsive grid collapse */
@media (max-width: 900px) {
  .split-5-7,
  .split-3-8,
  .split-8-4 {
    grid-template-columns: 1fr;
  }
}

/* Shared Responsive */
@media (max-width: 768px) {
  .side-menu {
    width: 100%;
    padding: 2rem;
  }

  .menu-toggle {
    right: 2rem;
  }
}

@media (max-width: 600px) {
  :root {
    --type-size-nav: 1.05rem;
    --type-size-base: 1.03rem;
    --type-size-caption: 0.97rem;
    --type-size-meta: 0.95rem;
  }

  .page {
    padding: 2rem;
  }

  h1 {
    font-size: 4.5rem;
  }

  .header-bar {
    height: 2.8rem;
  }

  .site-header {
    left: 1.5rem;
    top: 1rem;
  }

  .menu-toggle {
    top: 1rem;
    right: 1.5rem;
  }
}

/* Detail page shared styles */
.back-link {
  display: none;
}

.detail-header {
  margin-bottom: 1.5rem;
}

.detail-header h1 {
  font-family: "Diatype Variable", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.detail-meta {
  font-family: Standard, sans-serif;
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.85);
  line-height: 1.6;
}

.detail-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.detail-links a {
  font-family: Standard, sans-serif;
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.85);
  text-decoration: underline;
  transition: opacity 0.3s ease;
}

.detail-links a:hover {
  opacity: 0.7;
}

.detail-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.detail-gallery img {
  width: 100%;
  height: auto;
  display: block;
}

.detail-gallery.two-col {
  grid-template-columns: 1fr 1fr;
}

.detail-gallery.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.detail-body {
  max-width: 800px;
  margin-bottom: 2rem;
}

.detail-body p {
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

/* ─────────────────────────────────────────────
   Individual work page — alternating text/image flow
   (reinforcement.exe-style spread, per Halim's 2026-05-05 walkthrough).
   The detail-flow container is wider than the body's reading column
   so full-width images can carry their own weight while paragraphs
   stay readable inside .detail-text.
   ───────────────────────────────────────────── */

/* Halim 2026-05-22: detail pages now use a single 780px reading column.
   Hero, body text, single inline photos, and 3-up image strips all snap
   to the same column edges so there is no visual mismatch between a
   full-bleed image and a narrower text block. The strip stays a 3-col
   grid but inside the unified column. */
.detail-page {
  max-width: 780px;
  margin: 0 auto;
}

.detail-hero {
  margin: 1.5rem 0 2rem;
}
.detail-hero img,
.detail-image img,
.detail-image-strip img {
  width: 100%;
  height: auto;
  display: block;
}

.detail-flow {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.detail-text {
  max-width: none;
  margin-left: 0;
}
.detail-text p {
  line-height: 1.55;
  margin: 0 0 1.25rem;
  font-size: 1.06rem;
}
.detail-text p:last-child {
  margin-bottom: 0;
}

.detail-image {
  margin: 0;
}
.detail-image figcaption {
  font-family: "Diatype Mono Variable", monospace;
  font-variation-settings:
    "slnt" 0,
    "MONO" 1;
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

/* Self-justifying gallery grid. Halim 2026-06-01: a fixed 3-col grid left
   ragged gaps when a strip had 1 or 2 images (1/3-width orphan tiles, an
   empty third column). auto-fit + minmax makes any count fill the row:
   3 cols on desktop, 2 on tablet, 1 on mobile, no orphan columns. */
.detail-image-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 0.5rem;
  margin: 0;
}
/* Uniform aspect ratio so multi-photo strips line up, regardless of the
   underlying image dimensions. */
.detail-image-strip figure {
  margin: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--ink-08);
}
.detail-image-strip figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* A strip of one keeps its natural aspect and spans the full width, rather
   than rendering as a single cropped 1/3-width tile. */
.detail-image-strip figure:only-child {
  aspect-ratio: auto;
}
.detail-image-strip figure:only-child img {
  height: auto;
}

/* Prev / next nav at the bottom of an individual work page. */
.work-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 4rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}
.work-nav__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: rgba(0, 0, 0, 0.85);
  padding: 0.5rem;
}
.work-nav__link:hover {
  opacity: 0.7;
}
.work-nav__link--prev {
  justify-self: start;
}
.work-nav__link--next {
  justify-self: end;
  grid-column: 2;
  flex-direction: row-reverse;
  text-align: right;
}
.work-nav__thumb {
  width: 4rem;
  height: 3rem;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.work-nav__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.5s ease;
}
.work-nav__link:hover .work-nav__thumb img {
  filter: grayscale(0%);
}
.work-nav__arrow {
  font-family: "Diatype Mono Variable", monospace;
  font-size: 1.1rem;
  color: rgba(0, 0, 0, 0.85);
}
.work-nav__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.work-nav__label {
  font-family: "Diatype Mono Variable", monospace;
  font-variation-settings:
    "slnt" 0,
    "MONO" 1;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.5);
}
.work-nav__title {
  font-family: Standard, sans-serif;
  font-size: 1.06rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 600px) {
  .work-nav {
    grid-template-columns: 1fr;
  }
  .work-nav__link--next {
    grid-column: 1;
    justify-self: start;
    flex-direction: row;
    text-align: left;
  }
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin-bottom: 2rem;
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 900px) {
  .detail-gallery.two-col {
    grid-template-columns: 1fr;
  }

  .detail-gallery.three-col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .detail-gallery.three-col {
    grid-template-columns: 1fr;
  }
}

/* ───────────────────────────────────────────
   Section pill — the only place section colors land in the
   restrained palette (per Halim 2026-05-05): a small inline
   tag with a colored dot and a colored 1.2px border. Used in
   the Halim card paragraph, on each work card row, and on
   the per-section landing pages.
   Apply via: <a class="section-pill" data-section="machine">…</a>
   (data-section gets --section-color from tokens.css)
   ─────────────────────────────────────────── */
/* Halim 2026-06-01: section "pills" are no longer pills. The label sits
   as plain mono text with a colored line underneath in the section color
   (machine talk = magenta, algorithmic plays = blue, somatic semantics =
   violet, tools = green). The dot + rounded border are gone. */
.section-pill {
  display: inline-block;
  margin: 0 0.05em;
  padding-bottom: 2px;
  border: 0;
  border-bottom: 2px solid var(--section-color, var(--ink));
  border-radius: 0;
  background: none;
  font-family: var(--font-mono);
  font-variation-settings:
    "slnt" 0,
    "MONO" 1;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: var(--ink-85);
  text-decoration: none;
  white-space: nowrap;
  vertical-align: baseline;
  transition: color 0.2s ease;
}
.section-pill:hover,
.section-pill:focus-visible {
  color: var(--section-color, var(--ink));
}
.section-pill:focus-visible {
  outline: 2px solid var(--section-color, var(--ink));
  outline-offset: 2px;
}
/* Dot retired — the underline carries the color now. */
.section-pill__dot {
  display: none;
}
/* Smaller variant for work-card rows */
.section-pill--mini {
  font-size: 0.78rem;
  letter-spacing: 0;
}

/* ─── ★ glyph used by the works-page "featured" filter pseudo-section ── */
.works-filter-btn .star,
.works-chip .star {
  font-family: var(--font-mono);
  color: var(--ink-70);
  font-size: 0.8rem;
  line-height: 1;
  flex-shrink: 0;
}

/* ───────────────────────────────────────────
   Page CTA — outlined Connect button used at the end of
   About / Writing / individual work / Speaking pages.
   Routes to /connect/?intent=<...>; chrome.js pre-selects
   the matching door radio when the page renders.
   ─────────────────────────────────────────── */

.page-cta {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-cta .button-8 {
  text-decoration: none;
}

.page-cta__hint {
  font-family: "Diatype Mono Variable", monospace;
  font-variation-settings:
    "slnt" 0,
    "MONO" 1;
  font-size: var(--type-size-meta);
  color: rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ───────────────────────────────────────────
   Utilities
   ─────────────────────────────────────────── */

/* Hide visually but keep available to assistive technology */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* When the persistent signup bar is on, the existing fixed-position
   header bar / site-header / menu-toggle should slide down to clear it. */
body.has-signup-bar .header-bar {
  top: var(--signup-bar-h);
}
body.has-signup-bar .site-header {
  top: calc(var(--signup-bar-h) + 1.5rem);
}
body.has-signup-bar .menu-toggle {
  top: calc(var(--signup-bar-h) + 1.5rem);
}
@media (max-width: 600px) {
  body.has-signup-bar .header-bar {
    top: var(--signup-bar-h-mobile);
  }
  body.has-signup-bar .site-header {
    top: calc(var(--signup-bar-h-mobile) + 1.5rem);
  }
  body.has-signup-bar .menu-toggle {
    top: calc(var(--signup-bar-h-mobile) + 1.5rem);
  }
}
