/* ─────────────────────────────────────────────────────────────────────────
   Atlas AI — design tokens (launch pass)

   Shared CSS custom properties for every code component. Imported once per
   component so each bundle is self-contained in Webflow. Values mirror the
   `:root` blocks in the reference build (atlas-website/site/css/_shared.css
   and _system.css) — keep them in sync, and keep the Site Settings head block
   (site-settings/head.html) in sync with this file. Do not add new colors to
   the palette (see CLAUDE.md § "Things NOT to do").

   ───────────────────────────────────────────────────────────────────────── */
:host,
:host {
  /* Paper (backgrounds) */
  --paper:      #F4EFE5;
  --paper-alt:  #EBE4D4;
  --paper-deep: #DDD3BC;
  --paper-86:   rgba(245, 239, 229, 0.86);
  --paper-74:   rgba(245, 239, 229, 0.74);
  --paper-55:   rgba(245, 239, 229, 0.55);
  --paper-22:   rgba(245, 239, 229, 0.22);
  --paper-10:   rgba(245, 239, 229, 0.10);

  /* Ink (text) */
  --ink:    #1A1612;
  --ink-85: rgba(26, 22, 18, 0.86);
  --ink-70: rgba(26, 22, 18, 0.72);
  --ink-64: rgba(26, 22, 18, 0.64); /* small text: 5.1:1 on paper, 4.6:1 on paper-deep */
  --ink-55: rgba(26, 22, 18, 0.55); /* form-field borders: 3.5:1 */
  --ink-50: rgba(26, 22, 18, 0.5);
  --ink-30: rgba(26, 22, 18, 0.3);
  --ink-20: rgba(26, 22, 18, 0.18);
  --ink-14: rgba(26, 22, 18, 0.14);
  --ink-08: rgba(26, 22, 18, 0.08);

  /* Ochre (accent) */
  --ochre:       #8C6A3D;
  --ochre-text:  #73572F; /* ochre text under 24px: 5.9:1 on paper */
  --ochre-light: #D9B98A;
  --ochre-soft:  rgba(140, 106, 61, 0.14);
  --gold:        #B89968;

  /* Status */
  --error: #7A2E1E; /* form errors only */

  /* Type */
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans:  "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --wrap-max:        1312px;
  --wrap-wide-max:   1440px;
  --wrap-narrow-max: 920px;
  --pad-x:           64px;
  --header-h:        76px; /* the sticky Nav; anchors scroll clear of it */
}

@media (max-width: 991px) {
  :host,
  :host {
    --pad-x: 24px;
    --header-h: 64px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Accessibility base (MIGRATION-PLAN.md §1.4)

   Imported with the tokens by each component. Document styles don't cross
   shadow roots, so every component carries its own copy of these rules.
   Ported from the reference build's _system.css §2 and its mobile pass.
   ───────────────────────────────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--wf-focus, var(--ochre));
  outline-offset: 3px;
}

/* Visually hidden, still read by screen readers. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 991px) {
  .wf-tap {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-block: calc(-1 * var(--wf-tap-pull, 11px));
  }

  .wf-tap-box {
    min-height: 44px;
  }
}

/* Reduced motion: everything lands in its final state at once. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* PaperItem. Full ports the papers page's `.paper` (page-papers.css:18-36, 44-48); Compact ports the publication
   record `.pub` (_v2.css:91-96, with _system.css's ink-64, ochre-text and the underlined title link). It renders in its
   own shadow root, so the page base the reference record relied on is set here too: the body font, zero margins,
   text-wrap on the title and paragraphs.

   The class names are the reference's, so a page that renders the compact record itself (Company) keeps its own
   `.pub` overrides. No font or colour on :host: inside a page component, :host would be that page's host. The dark
   section variants (`.sec.dark .pub`) stay with the page CSS. The 760 px step is the reference's own. */

:host {
  display: block;
}

.paper,
.pub {
  box-sizing: border-box;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.paper *,
.pub * {
  box-sizing: border-box;
}

/* ─── Full ────────────────────────────────────────────────────── */
.paper {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 36px;
  padding: 28px 0 26px;
  border-bottom: 1px solid var(--ink-14);
  color: var(--ink);
}

.paper .when { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.paper .yr { font: 400 30px/1 var(--serif); color: var(--ink); }
.paper .venue { font: 500 11px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ochre-text); }
.paper .chip { font: 500 10.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
               border: 1px solid var(--ochre); padding: 5px 7px; margin-top: 4px; }
.paper h3 { font: 400 22px/1.3 var(--serif); margin: 0; max-width: 46ch; text-wrap: balance; }
.paper h3 a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px;
              text-decoration-color: var(--ink-30); }
.paper h3 a:hover { text-decoration-color: var(--ochre); }
.paper p { margin: 0; text-wrap: pretty; }
.paper .by { margin: 10px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-85); }
.paper .cite { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-64); }
.paper .note, .paper .use { margin: 12px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink-70); max-width: 70ch; }
.paper .use span { display: inline-block; margin-right: 10px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.1em;
                   text-transform: uppercase; color: var(--ochre-text); }
.paper .data { margin: 8px 0 0; font-size: 14px; color: var(--ink-64); }

/* The founding paper leads its group */
.paper.is-feature .yr { font-size: 44px; }
.paper.is-feature h3 { font-size: clamp(26px, 2.6vw, 32px); }

@media (max-width: 760px) {
  .paper { grid-template-columns: 1fr; gap: 12px; padding: 22px 0; }
  .paper .when { flex-direction: row; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .paper .yr { font-size: 24px; }
  .paper.is-feature .yr { font-size: 30px; }
  .paper h3 { font-size: 20px; }
}

/* ─── Compact ─────────────────────────────────────────────────── */
.pub { display: grid; grid-template-columns: 13ch 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--ink-08); }
.pub .venue { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--ochre-text); padding-top: 4px; }
.pub .t { font-family: var(--serif); font-size: 17px; line-height: 1.34; }
.pub .t a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.pub .a { font-size: 13.5px; color: var(--ink-64); margin-top: 5px; }

