/* ============================================================
   DESIGN FOR SIGNAL — site.css
   This site's own stylesheet. Load after tokens.css (vendored
   from the portfolio, now portal/site/tokens.css — re-copy, don't edit).
   Conventions follow bigpixel/home-v2.css: local type scale in
   :root, fluid clamp() tiers, 5px black rule, left-rule heads.
   Layout follows the portfolio's project pages (portal/site:
   home.css + project-page.css, 2026-11-08): 1000px column with an
   80ch measure, bleeding rule, H2 section headings, full-bleed
   mat for the demo, intro-grid pattern block, tinted About band.
   Prefix: ds-
   Nothing here may style inside a specimen's [data-theme].
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --ds-max:      1000px;   /* content column, = portfolio --hs-max */
  --ds-wide:     1000px;
  --ds-measure:  80ch;     /* reading measure, = .pp-prose */
  --ds-gutter:   40px;
  --ds-rule:     #141414;
  --ds-ink:      #141414;
  --ds-mat:       #D9D9D9; /* full-bleed demo mat, = portfolio --hs-mat */
  --ds-mat-light: #EDEDEA; /* About band, = portfolio --hs-mat-light */
  /* how far the page extends past the wrap on each side, for full-bleed */
  --ds-bleed: calc(var(--ds-gutter) + max(0px, (100vw - var(--ds-max)) / 2));

  /* Same scale as home-v2.css (--hv2-*), 400–1000px fluid range */
  --ds-type-label:   clamp(0.625rem,  0.5833rem + 0.1667vw, 0.6875rem); /* 10–11px */
  --ds-type-caption: clamp(0.75rem,   0.7083rem + 0.1667vw, 0.8125rem); /* 12–13px */
  --ds-type-body:    clamp(0.875rem,  0.8333rem + 0.1667vw, 0.9375rem); /* 14–15px */
  --ds-type-body-lg: clamp(1rem,      0.9583rem + 0.1667vw, 1.0625rem); /* 16–17px */
  --ds-type-h3:      clamp(1.125rem,  1.0417rem + 0.3333vw, 1.25rem);   /* 18–20px */
  --ds-type-h2:      clamp(1.25rem,   1.0833rem + 0.6667vw, 1.5rem);    /* 20–24px */
  --ds-type-display: clamp(1.875rem,  1.625rem + 1vw,       2.25rem);   /* 30–36px */

  --ds-lh-display: 1.1;
  --ds-lh-heading: 1.15;
  --ds-lh-body:    1.65;
  --ds-lh-small:   1.45;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--ds-type-body);
  line-height: var(--ds-lh-body);
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}

.ds-page { padding-bottom: 96px; overflow-x: clip; }

.ds-wrap {
  max-width: var(--ds-max);
  margin: 0 auto;
  padding: 0 var(--ds-gutter);
}

.ds-wrap--wide { max-width: var(--ds-wide); }

/* ── Links, focus, motion ──────────────────────────────────── */
a { color: var(--color-accent); text-underline-offset: 0.18em; transition: color 150ms ease; }
a:hover { color: var(--ds-ink); }

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  a { transition: none; }
}

.ds-skip {
  position: absolute;
  left: -9999px;
}
.ds-skip:focus { left: var(--ds-gutter); top: 8px; background: var(--color-bg); padding: 4px 8px; }

/* ── Masthead ──────────────────────────────────────────────── */
.ds-rule {
  height: 5px;
  background: var(--ds-rule);
  margin-top: 26px;
  margin-right: calc(-1 * var(--ds-bleed)); /* bleeds right, as .hs-rule */
}

/* Periodical line: DESIGN FOR SIGNAL · No. 01 · September 2026 */
.ds-periodical {
  display: block;
  margin: 12px 0 0;
  font-size: var(--ds-type-label);
  font-weight: 500;
  letter-spacing: 0.09em;
  line-height: var(--ds-lh-small);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.ds-periodical a { color: inherit; text-decoration: none; }
.ds-periodical a:hover { color: var(--color-accent); }

.ds-title {
  margin: 10px 0 0;
  font-size: var(--ds-type-display);
  font-weight: 600;
  line-height: var(--ds-lh-display);
  letter-spacing: -0.02em;
  color: var(--ds-ink);
}

.ds-thesis {
  margin: 20px 0 0;
  max-width: var(--ds-measure);
  font-size: var(--ds-type-body-lg);
  line-height: var(--ds-lh-body);
  color: var(--color-text);
}

/* Top bar above the rule, as the portfolio's .hs-nav: links on the
   right, separated by a light rule character. */
.ds-nav {
  padding-top: 18px;
  font-size: var(--ds-type-caption);
  font-weight: 500;
  line-height: var(--ds-lh-small);
  color: var(--color-text-secondary);
}

.ds-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 0; }
.ds-nav li + li::before { content: '|'; padding: 0 4px; color: var(--color-border); }
/* ::before widens the tap area to ~44px without moving anything, as .hs-nav__links a */
.ds-nav a { position: relative; color: inherit; text-decoration: none; }
.ds-nav a::before { content: ''; position: absolute; inset: -14px -6px; }
.ds-nav a:hover { color: var(--color-accent); }

/* ── Sections (§ I, § II, § III) ───────────────────────────── */
.ds-section { margin-top: 88px; }

.ds-section__head {
  border-left: 5px solid var(--ds-rule);
  padding-left: 14px;
}
#experiments .ds-section__head { border-left: 0; padding-left: 0; }

.ds-section__title {
  margin: 0;
  font-size: var(--ds-type-h2);
  font-weight: 600;
  line-height: var(--ds-lh-heading);
  letter-spacing: -0.02em;
  color: var(--ds-ink);
}

.ds-section__num { font-weight: 400; margin-right: 0.35em; }

.ds-section__desc {
  margin: 6px 0 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

/* ── Entry block (full width, not a tile) ──────────────────── */
.ds-entry { margin-top: 74px; }

.ds-section__head + .ds-entry,
#experiments article:first-of-type .ds-entry { margin-top: 48px; }

/* Home experiments follow the portfolio's split-row treatment: argument left,
   proportional demo thumbnail right. */
.ds-entry-split {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 48px;
  align-items: start;
  margin-top: 74px;
}
#experiments article:first-of-type .ds-entry-split { margin-top: 48px; }
.ds-entry-split .ds-entry { margin-top: 0; }
#experiments article:first-of-type .ds-entry-split .ds-entry { margin-top: 0; }
.ds-entry-split .ds-thumb { margin-top: 0; }

.ds-entry > .ds-eyebrow,
.ds-entry > .ds-entry__title {
  position: relative;
  left: 1px;
  border-left: 5px solid var(--ds-rule);
  padding-left: 14px;
}
.ds-entry > .ds-eyebrow { padding-bottom: 7px; }

.ds-eyebrow {
  display: block;
  font-size: var(--ds-type-label);
  font-weight: 500;
  letter-spacing: 0.09em;
  line-height: var(--ds-lh-small);
  text-transform: uppercase;
  color: var(--color-accent);
}

.ds-entry__title {
  margin: 0;
  font-size: var(--ds-type-h2);
  letter-spacing: -0.02em;
  font-weight: 600;
  line-height: var(--ds-lh-heading);
  color: var(--ds-ink);
}

.ds-entry__title a { color: inherit; text-decoration: none; }
.ds-entry__title a:hover { color: var(--color-accent); }

.ds-entry__argument {
  margin: 18px 0 0;
  max-width: var(--ds-measure);
  font-size: var(--ds-type-body-lg);
  color: var(--color-text);
}

.ds-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 18px 0 0;
  font-size: var(--ds-type-caption);
  font-weight: 500;
}

.ds-links a { text-decoration: none; }
.ds-links a:hover { text-decoration: underline; }

/* ── Pattern list (§ III) ──────────────────────────────────── */
.ds-plist {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  border-top: 1px solid var(--color-border);
}

.ds-plist li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.ds-plist__id,
.ds-id {
  font-family: var(--font-mono);
  font-size: var(--ds-type-caption);
  letter-spacing: 0;
  color: var(--color-text-secondary);
}

.ds-plist a { color: var(--ds-ink); text-decoration: none; font-weight: 500; }
.ds-plist a:hover { color: var(--color-accent); text-decoration: underline; }
.ds-plist > li > a { grid-column: 1 / -1; }
.ds-plist__category {
  grid-column: 1 / -1;
  font-size: var(--ds-type-label);
  font-weight: 600;
  line-height: var(--ds-lh-small);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.ds-plist__from {
  font-size: var(--ds-type-caption);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.ds-plist__from a { color: inherit; font-weight: 400; }

.ds-plist__what { grid-column: 1 / -1; max-width: var(--ds-measure); }

.ds-quiet {
  margin: 16px 0 0;
  font-size: var(--ds-type-caption);
  font-style: italic;
  color: var(--color-text-secondary);
}

/* ── About: tinted band, as .hs-about ──────────────────────── */
.ds-section.ds-about { margin-top: 96px; padding: 80px 0; background: var(--ds-mat-light); }
.ds-about p { margin: 16px 0 0; max-width: 640px; }
.ds-about .ds-section__head + p { margin-top: 24px; }

/* ── Article (entry / pattern pages) ───────────────────────── */
.ds-article__title {
  margin: 10px 0 0;
  font-size: var(--ds-type-display);
  font-weight: 600;
  line-height: var(--ds-lh-display);
  letter-spacing: -0.02em;
  color: var(--ds-ink);
}

.ds-article__lede {
  margin: 24px 0 0;
  max-width: var(--ds-measure);
  font-size: var(--ds-type-body-lg);
}

.ds-part { margin-top: 96px; }

.ds-part__title {
  margin: 0;
  font-size: var(--ds-type-h2);
  font-weight: 600;
  line-height: var(--ds-lh-heading);
  letter-spacing: -0.02em;
  color: var(--ds-ink);
}

.ds-prose { margin-top: 20px; max-width: var(--ds-measure); }
.ds-prose p,
.ds-prose ul,
.ds-prose ol { margin: 0 0 16px; font-size: var(--ds-type-body-lg); }
.ds-prose ul,
.ds-prose ol { padding-left: 1.2em; }
.ds-prose li + li { margin-top: 6px; }
.ds-prose > :last-child { margin-bottom: 0; }

.ds-prose code,
.ds-table code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  letter-spacing: 0;
  background: var(--color-surface);
  padding: 1px 4px;
  border-radius: 2px;
}

/* The pattern block: problem / pattern / when not to use it */
/* The pattern block: problem / pattern / when not to use it.
   Three columns, as the portfolio's intro grid (.pp-intro-grid). */
.ds-block {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin: 28px 0 0;
}

.ds-block > div {
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
}

.ds-block dt {
  margin: 0 0 8px;
  font-size: var(--ds-type-caption);
  font-weight: 700;
  line-height: var(--ds-lh-small);
  color: var(--ds-ink);
}

.ds-block dd {
  margin: 0;
  font-size: var(--ds-type-body);
  line-height: var(--ds-lh-body);
  color: var(--color-text-secondary);
}

.ds-table-wrap { overflow-x: auto; margin-top: 16px; }
.ds-table-wrap + .ds-prose { margin-top: 20px; }

.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--ds-type-body);
}

.ds-table th,
.ds-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.ds-table th {
  font-size: var(--ds-type-label);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  border-bottom-color: var(--color-border);
}

/* ── Entry page parts (E02 on, 2026-11-15) ───────────────────
   Back link above the rule, the demo section, and screenshots
   beside or above their text. Were inline styles on each page. */
.ds-backlink { margin: 18px 0 28px; font-size: var(--ds-type-caption); line-height: var(--ds-lh-small); }
.ds-backlink a { color: var(--color-text-secondary); text-decoration: none; font-weight: 500; }
.ds-backlink a:hover { color: var(--color-accent); }

/* Place the demo controls between the introduction and the grey mat. */
.ds-part.ds-demo { margin-top: 48px; }
.ds-demo .ds-specimen { margin-top: 16px; }
.ds-demo .ds-screen { background: transparent; border: 0; box-shadow: none; }
.ds-demo-switch { margin-top: 16px; }

/* A smaller heading inside a part, e.g. one per example in "Seen in" */
.ds-part h3.ds-example-title { margin: 48px 0 0; font-size: var(--ds-type-h3); font-weight: 600; line-height: var(--ds-lh-heading); letter-spacing: -0.02em; }

/* Screenshot beside its text; stacks below 700px. Set --ds-figure-w on the
   element to change the image column (default 480px). */
.ds-figure-pair { display: grid; grid-template-columns: minmax(0, var(--ds-figure-w, 480px)) minmax(0, 1fr); gap: 24px; margin-top: 16px; align-items: start; }
.ds-figure-pair + .ds-figure-pair { margin-top: 48px; }
.ds-figure-pair .ds-prose { margin-top: 0; }
@media (max-width: 700px) { .ds-figure-pair { grid-template-columns: 1fr; } }

/* Screenshots above their text, for wide images that are unreadable in a column */
.ds-figure-stack { margin-top: 16px; }
.ds-figure-stack .ds-figure { max-width: 820px; }
.ds-figure-stack .ds-prose { margin-top: 24px; }

.ds-figure { margin: 0; }
.ds-figure + .ds-figure { margin-top: 16px; }
.ds-figure figcaption { margin-top: 8px; font-size: var(--ds-type-caption); }
.ds-screenshot { display: block; width: 100%; height: auto; }
.ds-screenshot--framed { border: 1px solid var(--color-border-light); }

.ds-back { margin-top: 96px; font-size: var(--ds-type-caption); font-weight: 500; }
.ds-back a { text-decoration: none; }

/* ── Specimen frame ────────────────────────────────────────────
   Documentation around the design: toggle, scripted label, caption.
   The design itself sits inside .ds-screen, in its product's theme. */
.ds-specimen { margin-top: 20px; }

.ds-specimen__bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 10px;
  font-size: var(--ds-type-caption);
  color: var(--color-text-secondary);
}

.ds-toggle { display: inline-flex; border: 1px solid var(--ds-ink); border-radius: var(--radius-control); overflow: hidden; }

.ds-toggle button {
  font: inherit;
  font-size: var(--ds-type-caption);
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 6px 12px;
  min-height: 32px;
  border: 0;
  background: var(--color-bg);
  color: var(--ds-ink);
  cursor: pointer;
}

.ds-toggle button + button { border-left: 1px solid var(--ds-ink); }
.ds-toggle button:hover { background: var(--color-surface); }
.ds-toggle button[aria-pressed="true"] { background: var(--ds-ink); color: var(--color-bg); }
.ds-toggle button[aria-pressed="true"]::before { content: '✓ '; }
.ds-toggle button:focus-visible { outline-offset: -4px; outline-color: var(--color-accent); }

.ds-demo-playback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
  font-size: var(--ds-type-caption);
}
.ds-demo-playback .ds-toggle button {
  background: var(--ds-ink);
  color: var(--color-bg);
  font-weight: 600;
}
.ds-demo-playback .ds-toggle button:hover { background: var(--color-surface-mid); }
.ds-demo-playback .ds-toggle button:focus-visible { outline-color: var(--color-bg); }
.ds-demo-playback .ds-specimen__bar {
  justify-self: end;
  justify-content: flex-end;
  margin: 0;
}
.ds-demo-view-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ds-ink);
  font: inherit;
  text-align: right;
  text-decoration: underline;
  cursor: pointer;
}
.ds-demo-view-toggle:hover { color: var(--color-accent); }
@media (max-width: 540px) {
  .ds-demo-playback { grid-template-columns: auto minmax(0, 1fr); }
  .ds-demo-playback [role="status"] { grid-column: 1 / -1; grid-row: 2; }
  .ds-demo-playback [role="status"]:empty { display: none; }
}

.ds-demo-click-target { position: relative; }
.ds-demo-click-target::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: 100%;
  top: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgb(23 53 197 / 30%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ds-demo-click 220ms cubic-bezier(0.22, 1, 0.36, 1), ds-demo-click-hide 450ms steps(1, end) forwards;
}
.cwc-ask__field.ds-demo-click-target::after { left: 0; }
[data-theme="titanic-xai"] .ds-demo-click-target::after { background: rgb(157 214 255 / 30%); }
@keyframes ds-demo-click {
  from { transform: translate(0, -75%); }
  to { transform: translate(-50%, -50%); }
}
@keyframes ds-demo-click-hide {
  from { opacity: 1; }
  to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ds-demo-click-target::after { animation: ds-demo-click-hide 450ms steps(1, end) forwards; }
}

.ds-scripted {
  font-family: var(--font-mono);
  font-size: var(--ds-type-label);
  letter-spacing: 0;
}

.ds-mat {
  background: var(--ds-mat);
  margin: 0 calc(-1 * var(--ds-bleed));
  padding: 36px var(--ds-bleed);
}

/* The boundary: only what is inside is the design */
.ds-screen {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.ds-specimen__caption {
  margin: 12px 0 0;
  font-size: var(--ds-type-caption);
  color: var(--color-text-secondary);
}

.ds-specimen__caption strong { color: var(--ds-ink); font-weight: 600; margin-right: 6px; }

/* Index thumbnails: the specimen drawn small and inert, as a picture of the
   demo. The whole thumbnail links to the entry for pointer users; keyboard
   and screen-reader users get the "Read the entry" link that follows it. */
.ds-thumb { position: relative; width: 520px; max-width: 100%; margin-top: 20px; margin-left: auto; }
.ds-thumb .ds-specimen { width: 1000px; zoom: 0.52; margin-top: 0; user-select: none; }
/* Home thumbnails show only the product card; the full-width demo mat belongs on entries. */
.ds-thumb .ds-mat { margin: 0; padding: 0; background: transparent; }
/* The toggle and caption are instructions for the live demo; a picture doesn't need them. */
.ds-thumb .ds-specimen__bar,
.ds-thumb .ds-specimen__caption { display: none; }
.ds-thumb__link {
  position: absolute;
  inset: 0;
  border: 1px solid var(--color-border-light);
  border-radius: 0;
  transition: border-color 150ms ease;
}
.ds-thumb__link:hover { border-color: var(--color-accent); }

/* ── Unfinished content — remove before launch ────────────────
   .ds-todo  : placeholder, text not written yet
   .ds-draft : Claude draft, not Juliana's words (= DRAFT marker in pattern.md) */
.ds-todo,
.ds-draft { position: relative; outline: 1px dashed var(--color-warning); outline-offset: 4px; }
.ds-todo { color: var(--color-text-secondary); font-style: italic; }
.ds-todo::before,
.ds-draft::before {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--ds-type-label);
  font-style: normal;
  letter-spacing: 0;
  color: var(--color-warning);
}
.ds-todo::before { content: 'TODO'; }
.ds-draft::before { content: 'DRAFT — Juliana to rewrite'; }
/* .ds-block cells are single blocks now, so the draft label sits at the top of its cell */

/* ── Footer / small print ──────────────────────────────────── */
.ds-footer {
  margin-top: 96px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border-light);
  font-size: var(--ds-type-caption);
  line-height: var(--ds-lh-small);
  color: var(--color-text-secondary);
}

/* ── Narrow ────────────────────────────────────────────────── */
@media (max-width: 760px) {
  :root { --ds-gutter: 20px; }
  .ds-section { margin-top: 64px; }
  .ds-mat { padding-top: 16px; padding-bottom: 16px; }
  .ds-part { margin-top: 64px; }
  .ds-block { grid-template-columns: 1fr; gap: 28px; }
  .ds-entry-split { grid-template-columns: 1fr; gap: 28px; margin-top: 64px; }
  #experiments article:first-of-type .ds-entry-split { margin-top: 48px; }
  .ds-section.ds-about { padding: 48px 0; }
  .ds-plist li { grid-template-columns: 1fr; }
  .ds-plist__from { grid-column: 1; }
  .ds-thumb { width: 100%; }
  .ds-thumb .ds-specimen { width: 100%; zoom: 1; }
}

/* Analytics preferences */
.ds-consent {
  position: fixed;
  z-index: 1000;
  inset: auto 20px 20px auto;
  width: min(440px, calc(100% - 40px));
  padding: 20px;
  background: #fff;
  color: #111;
  border: 1px solid #555;
  box-shadow: 0 4px 20px #0002;
}
.ds-consent[hidden] { display: none; }
.ds-consent p { margin: 0 0 16px; }
.ds-consent__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ds-consent__actions button { padding: 8px 12px; cursor: pointer; }
.ds-consent__settings { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
