/* Ease docs — shared stylesheet.
   Single source of truth for palette, typography, layout, and a11y
   baselines. Every page in docs/site/ links this file via
   <link rel="stylesheet" href="/styles.css"> (or relative).
   Do not introduce new colours, fonts, or external dependencies. */

:root {
  /* Palette — Aesop/Anthropic register, matches Thariq's
     html-effectiveness examples. Warm off-white background, near-
     black text, clay accent, sage success, rust warning. */
  --ivory:    #FAF9F5;
  --slate:    #141413;
  --clay:     #D97757;
  --oat:      #E3DACC;
  --olive:    #788C5D;
  --rust:     #B04A3F;
  --gray-150: #F0EEE6;
  --gray-300: #D1CFC5;
  --gray-500: #87867F;
  --gray-700: #3D3D3A;
  --white:    #FFFFFF;

  /* Font stacks — system fonts only. No Google Fonts, no CDN. */
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ivory);
  color: var(--gray-700);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  padding: 48px 24px 96px;
  -webkit-font-smoothing: antialiased;
}

/* Skip link — keyboard users land on it first, jumps past the
   header to the main article. */
.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  position: static;
  display: inline-block;
  padding: 8px 12px;
  background: var(--slate);
  color: var(--ivory);
  text-decoration: none;
  border-radius: 4px;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  align-items: start;
}

@media (max-width: 960px) {
  .page { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Site mark (logo at the top-left of every page) ---------- */

.site-mark {
  grid-column: 1 / -1;
  justify-self: start;
  margin-bottom: 28px;
  border-bottom: none;
}
.site-mark svg {
  display: block;
  height: 16px;
  width: auto;
  color: var(--slate);
}

/* ---------- Header (eyebrow + title + lead) ---------- */

.page-head {
  grid-column: 1 / -1;
  margin-bottom: 32px;
  max-width: 820px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.eyebrow a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--gray-300);
}
.eyebrow a:hover { color: var(--slate); border-bottom-color: var(--gray-500); }

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--slate);
  margin-bottom: 18px;
}

.lead {
  font-size: 17px;
  line-height: 1.55;
  color: var(--gray-700);
  max-width: 680px;
}

/* ---------- Body ---------- */

main { min-width: 0; }

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.25;
  color: var(--slate);
  margin: 48px 0 16px;
}

h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--slate);
  margin: 32px 0 10px;
  letter-spacing: -0.005em;
}

p { margin-bottom: 14px; max-width: 720px; }

ul, ol { margin: 0 0 14px 22px; max-width: 720px; }
li { margin-bottom: 6px; }

strong { color: var(--slate); font-weight: 600; }

code {
  font-family: var(--mono);
  font-size: 13.5px;
  background: var(--gray-150);
  padding: 1px 5px;
  border-radius: 3px;
}

pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 14px 0;
  max-width: 720px;
}
pre code { background: transparent; padding: 0; }

a {
  color: var(--clay);
  text-decoration: none;
  border-bottom: 1px solid rgba(217,119,87,0.4);
  transition: border-color 120ms ease;
}
a:hover { border-bottom-color: var(--clay); }
a:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Sections ---------- */

section { margin-bottom: 8px; }

/* ---------- Drill-down cards (used on landing pages) ---------- */

.drilldown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 20px 0 8px;
  max-width: none;
}

.drilldown a.card {
  display: block;
  padding: 18px 20px;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: 10px;
  color: var(--gray-700);
  border-bottom-width: 1.5px;
  transition: border-color 120ms ease, transform 120ms ease;
}
.drilldown a.card:hover {
  border-color: var(--clay);
  transform: translateY(-1px);
}
.drilldown a.card .title {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  color: var(--slate);
  margin-bottom: 6px;
}
.drilldown a.card .meta {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.drilldown a.card .summary {
  display: block;
  font-size: 14.5px;
  line-height: 1.55;
}

/* ---------- Tables ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  max-width: 820px;
  margin: 16px 0;
  font-size: 14.5px;
}
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-300);
  vertical-align: top;
}
th {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
  font-weight: 500;
  border-bottom-width: 1.5px;
}
caption {
  caption-side: top;
  text-align: left;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 10px;
}
td code { font-size: 12.5px; }

/* Cross-SDK parity matrix table (docs/site/sdks/cross-sdk-parity.html). */
.matrix {
  max-width: 640px;
  font-family: var(--mono);
}
.matrix th, .matrix td {
  text-align: center;
  padding: 8px 12px;
}
.matrix thead th {
  font-size: 12.5px;
}
.matrix tbody th {
  text-align: left;
  text-transform: none;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--gray-700);
}
.matrix .cell-pass { color: var(--green-600, #16a34a); font-weight: 600; }
.matrix .cell-pending { color: var(--gray-400); }
.matrix .cell-na { color: var(--gray-300); }

/* Status pills inside tables. */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill.shipped { background: rgba(120,140,93,0.18); color: var(--olive); }
.pill.planned { background: var(--oat); color: var(--gray-700); }
.pill.partial { background: rgba(217,119,87,0.18); color: var(--rust); }
.pill-good { background: rgba(120,140,93,0.18); color: var(--olive); }
.pill-warn { background: rgba(217,119,87,0.18); color: var(--rust); }
.pill-bad  { background: var(--gray-200); color: var(--gray-600); }

/* ---------- Aside / sidebar ---------- */

aside.toc {
  font-size: 13.5px;
  line-height: 1.5;
  position: sticky;
  top: 32px;
  padding: 16px 18px;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: 10px;
}
@media (max-width: 960px) {
  aside.toc { position: static; }
}

aside.toc .label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 10px;
}
aside.toc ul { list-style: none; margin: 0; padding: 0; }
aside.toc li { margin-bottom: 6px; }
aside.toc a {
  color: var(--gray-700);
  border-bottom: none;
}
aside.toc a:hover { color: var(--clay); }

/* ---------- Inline callout boxes ---------- */

.note {
  padding: 14px 18px;
  background: var(--gray-150);
  border-left: 3px solid var(--gray-500);
  border-radius: 0 6px 6px 0;
  margin: 16px 0;
  max-width: 720px;
  font-size: 14.5px;
}
.note.warn { border-left-color: var(--rust); background: rgba(176,74,63,0.08); }
.note.tip  { border-left-color: var(--olive); background: rgba(120,140,93,0.10); }

/* ---------- Parameter definition lists ---------- */
dl.params {
  margin: 16px 0;
  padding: 14px 18px;
  background: var(--gray-150);
  border-left: 3px solid var(--gray-300);
  border-radius: 0 6px 6px 0;
  max-width: 720px;
  font-size: 14.5px;
}
dl.params dt {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--gray-700);
  margin: 10px 0 4px 0;
}
dl.params dt:first-child { margin-top: 0; }
dl.params dd {
  margin: 0 0 4px 0;
  color: var(--gray-600);
}
.note .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 6px;
  display: block;
}

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

footer.page-foot {
  grid-column: 1 / -1;
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-300);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
footer.page-foot .foot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
footer.page-foot .foot-mark {
  height: 14px;
  width: auto;
  color: var(--slate);
}
footer.page-foot .foot-brand span {
  font-size: 13px;
  color: var(--gray-500);
}
footer.page-foot .foot-nav {
  display: flex;
  gap: 24px;
  font-size: 13px;
}
footer.page-foot .foot-nav a {
  color: var(--gray-500);
  border-bottom: none;
}
footer.page-foot .foot-nav a:hover { color: var(--slate); }

/* ---------- Changelog list ---------- */

ul.changelog {
  list-style: none;
  margin: 0 0 24px 0;
  padding: 0;
  max-width: none;
}
ul.changelog li {
  display: block;
  padding: 12px 0 12px 16px;
  margin: 0 0 4px 0;
  border-left: 2px solid var(--gray-150);
  transition: border-color 120ms ease;
}
ul.changelog li:hover { border-left-color: var(--clay); }
ul.changelog .hash {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray-500);
  margin-right: 10px;
  min-width: 64px;
}
ul.changelog .hash a {
  color: inherit;
  border-bottom: 1px dotted var(--gray-300);
}
ul.changelog .hash a:hover { color: var(--slate); border-bottom-color: var(--gray-500); }
ul.changelog .subject {
  font-size: 14.5px;
  color: var(--slate);
}
ul.changelog details {
  margin-top: 8px;
  margin-left: 74px;
}
ul.changelog details summary {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
  cursor: pointer;
  list-style: none;
  display: inline-block;
}
ul.changelog details summary::-webkit-details-marker { display: none; }
ul.changelog details summary::after { content: " ▾"; }
ul.changelog details[open] summary::after { content: " ▴"; }
ul.changelog details summary:hover { color: var(--slate); }
ul.changelog details pre {
  margin-top: 8px;
  margin-bottom: 0;
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--gray-150);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- SVG diagrams (architecture/flow pages) ---------- */

.diagram {
  border: 1.5px solid var(--gray-300);
  border-radius: 12px;
  background: var(--white);
  padding: 24px;
  overflow-x: auto;
  margin: 16px 0 24px;
}
svg.flow { display: block; width: 100%; height: auto; max-width: 720px; margin: 0 auto; }

.flow text {
  font-family: var(--mono);
  font-size: 12px;
  fill: var(--slate);
}
.flow .sub { font-size: 10px; fill: var(--gray-500); }
.flow .box { fill: var(--white); stroke: var(--gray-300); stroke-width: 1.5; }
.flow .box.hot { fill: rgba(217,119,87,0.10); stroke: var(--clay); }
.flow .box.ext { fill: var(--gray-150); stroke: var(--gray-300); stroke-dasharray: 4 3; }
.flow .arrow { stroke: var(--gray-500); stroke-width: 1.5; fill: none; }
.flow .arrow.hot { stroke: var(--clay); }

/* ---------- Hero (editorial image with overlay) ----------
   Used on landing pages — engineering docs index and marketing-site
   index. Editorial photography in the Aesop register per
   docs/brand/branding.md § Marketing imagery. Two principles:
   metonymy (photograph the idea, not the product) and texture
   contrast (rough context, refined subject). */

.hero {
  /* Full-bleed: break out of body's 48px-top / 24px-side padding
     to extend the hero edge-to-edge across the viewport. */
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 480px;
  margin: -48px -24px 64px;
  background-color: var(--gray-150);
  background-image: url("images/hero-empty-room.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--ivory);
  overflow: hidden;
}

/* Bottom-up gradient overlay so text stays legible on the lower half. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(20, 20, 19, 0.68) 0%,
    rgba(20, 20, 19, 0.22) 45%,
    rgba(20, 20, 19, 0.00) 70%
  );
  pointer-events: none;
}

/* Inner constrains the overlay copy to the same 1080px column the
   rest of the page uses, so headlines align with the body grid. */
.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.hero .eyebrow {
  color: var(--ivory);
  opacity: 0.88;
  margin-bottom: 14px;
}

.hero h1 {
  color: var(--ivory);
  font-size: 44px;
  line-height: 1.12;
  margin-bottom: 16px;
  max-width: 680px;
}

.hero .lead {
  color: var(--ivory);
  opacity: 0.92;
  font-size: 16px;
  max-width: 560px;
  margin-bottom: 24px;
}

.hero .cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border: 1px solid var(--ivory);
  color: var(--ivory);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.01em;
  width: fit-content;
  transition: background 0.15s ease, color 0.15s ease;
}

.hero .cta:hover {
  background: var(--ivory);
  color: var(--slate);
}

@media (max-width: 720px) {
  .hero { height: 400px; }
  .hero-inner { padding: 0 16px 32px; }
  .hero h1 { font-size: 30px; }
  .hero .lead { font-size: 15px; }
}

@media (max-width: 480px) {
  .hero { height: 340px; }
  .hero h1 { font-size: 26px; }
}
