/* xshader.com: the public site's look, over app.css. An explorer's field guide: parchment
 * by day and indigo night by dark, void-violet ink, a vermilion X marking the spot, and a
 * book serif for headings and the guides' prose; tables keep the app's sans for figures.
 * System fonts only, so the page loads nothing from anywhere else. */

:root[data-site="xshader"] {
  color-scheme: light;
  --page: #f4eee2;
  --surface: #fbf8f1;
  --surface-2: #ece4d3;
  --ink: #1e1a16;
  --ink-2: #4b4237;
  --muted: #776c5d;
  --grid: #e2d8c5;
  --axis: #c8baa0;
  --border: rgba(70, 48, 16, 0.15);
  --accent: #5b3fa3;
  --accent-wash: rgba(91, 63, 163, 0.08);
  --brand: #c2410c;
  --pos: #2d6a1e;
  --neg: #b3261e;
  --s7: #5b3fa3;
  --shadow: 0 1px 2px rgba(60, 40, 10, 0.06), 0 6px 20px rgba(60, 40, 10, 0.08);
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --glow: radial-gradient(1100px 520px at 12% -8%, rgba(255, 252, 244, 0.9), transparent 62%),
          radial-gradient(900px 600px at 105% 0%, rgba(91, 63, 163, 0.06), transparent 60%);
}
@media (prefers-color-scheme: dark) {
  :root[data-site="xshader"]:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #14121b;
    --surface: #1c1a25;
    --surface-2: #252232;
    --ink: #efe9dc;
    --ink-2: #c9bfac;
    --muted: #9a907f;
    --grid: #2d2a3a;
    --axis: #3d394d;
    --border: rgba(239, 233, 220, 0.11);
    --accent: #b9a3ff;
    --accent-wash: rgba(185, 163, 255, 0.11);
    --brand: #ff8a4c;
    --pos: #79d470;
    --neg: #ff8b7e;
    --s7: #b9a3ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.45);
    --glow: radial-gradient(1100px 560px at 10% -10%, rgba(132, 98, 230, 0.16), transparent 62%),
            radial-gradient(800px 520px at 108% 4%, rgba(255, 138, 76, 0.06), transparent 60%);
  }
}
:root[data-site="xshader"][data-theme="dark"] {
  color-scheme: dark;
  --page: #14121b; --surface: #1c1a25; --surface-2: #252232; --ink: #efe9dc; --ink-2: #c9bfac; --muted: #9a907f;
  --grid: #2d2a3a; --axis: #3d394d; --border: rgba(239, 233, 220, 0.11); --accent: #b9a3ff;
  --accent-wash: rgba(185, 163, 255, 0.11); --brand: #ff8a4c; --pos: #79d470; --neg: #ff8b7e; --s7: #b9a3ff;
  --glow: radial-gradient(1100px 560px at 10% -10%, rgba(132, 98, 230, 0.16), transparent 62%);
}

[data-site="xshader"] body { background: var(--glow), var(--page); background-repeat: no-repeat; background-color: var(--page); }
[data-site="xshader"] ::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

/* Headings speak in the book's voice. */
[data-site="xshader"] h1, [data-site="xshader"] h2, [data-site="xshader"] h3 { font-family: var(--serif); font-weight: 600; letter-spacing: 0; }
[data-site="xshader"] h1 { font-size: 30px; line-height: 1.15; }
[data-site="xshader"] h2 { font-size: 21px; }
[data-site="xshader"] .lede { font-size: 15px; }

/* -- header ---------------------------------------------------------------- */
[data-site="xshader"] .top { background: color-mix(in srgb, var(--page) 86%, transparent); }
.xs-brand { gap: 9px; }
.xs-brand svg { width: 28px; height: 28px; }
.xs-brand .xs-ring { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 2.6 2.6; }
.xs-brand .xs-x { fill: none; stroke: var(--brand); stroke-width: 3.6; stroke-linecap: round; }
.xs-word { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink); }
.xs-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.xs-toggle input { accent-color: var(--accent); margin: 0; }
[data-site="xshader"] .freshness { margin-left: auto; }

/* -- sidebar ---------------------------------------------------------------- */
[data-site="xshader"] .side { scrollbar-width: thin; scrollbar-color: var(--axis) transparent; }
[data-site="xshader"] .nav-title { font-family: var(--serif); font-size: 13.5px; font-weight: 600; text-transform: none;
  font-variant: small-caps; letter-spacing: 0.06em; color: var(--muted); }
[data-site="xshader"] .side a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--brand); }

/* -- cards and tables ----------------------------------------------------------- */
[data-site="xshader"] .card, [data-site="xshader"] .tile { box-shadow: 0 1px 0 rgba(60, 40, 10, 0.03); }
[data-site="xshader"] .tile .value { font-family: var(--serif); font-size: 23px; }
[data-site="xshader"] a.tile-link .tile { border-color: var(--border); background: var(--surface); }
[data-site="xshader"] a.tile-link:hover .tile, [data-site="xshader"] a.tile-link:focus-visible .tile { border-color: var(--accent); border-width: 1px; padding: 12px 14px; box-shadow: var(--shadow); }

/* -- the guides ------------------------------------------------------------------ */
[data-site="xshader"] .prose { max-width: 760px; }
[data-site="xshader"] .prose p, [data-site="xshader"] .prose li { font-family: var(--serif); font-size: 16.5px; line-height: 1.65; }
[data-site="xshader"] .prose h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 6px; }
[data-site="xshader"] .prose h2 { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--border); }
[data-site="xshader"] .prose .byline { font-family: var(--serif); font-style: italic; font-size: 14.5px; }
[data-site="xshader"] .prose table, [data-site="xshader"] .prose td, [data-site="xshader"] .prose th { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
[data-site="xshader"] .prose td, [data-site="xshader"] .prose th { font-size: 13px; line-height: 1.45; }
[data-site="xshader"] .prose .callout, [data-site="xshader"] .prose .judgment { font-size: 16px; }
.xs-live-note { font-size: 13px !important; font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important; color: var(--muted);
  border-left: 3px solid var(--brand); padding: 4px 0 4px 10px; margin: 10px 0 18px; }
[data-site="xshader"] .app-only { display: none !important; }
[data-site="xshader"] .site-only { display: inline; }

/* -- the front page ------------------------------------------------------------ */
.xs-hero { position: relative; padding: 28px 0 18px; max-width: 900px; }
.xs-eyebrow { font-family: var(--serif); font-variant: small-caps; letter-spacing: 0.08em; color: var(--muted); font-size: 15px; margin: 0 0 6px; }
.xs-title { font-size: clamp(32px, 5.6vw, 58px) !important; line-height: 1.04 !important; max-width: 17ch; margin: 0; }
.xs-title em { font-style: italic; color: var(--brand); text-decoration: line-through; text-decoration-thickness: 0.06em;
  text-decoration-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.xs-lede { font-family: var(--serif); font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 60ch; margin: 16px 0 18px; }
.xs-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.xs-cta .btn { font-size: 14px; padding: 7px 16px; border-radius: 8px; }
.xs-trail { display: block; width: min(100%, 420px); height: auto; margin: 22px 0 0; overflow: visible; }
.xs-trail-path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 7; stroke-linecap: round; opacity: 0.7; }
.xs-trail-start { fill: var(--accent); opacity: 0.8; }
.xs-trail-x { fill: none; stroke: var(--brand); stroke-width: 5; stroke-linecap: round; }
/* The trail walks in once, then stays put. */
@media (prefers-reduced-motion: no-preference) {
  .xs-trail-path { animation: xs-walk 1.6s ease-out both; }
  .xs-trail-x { animation: xs-mark 0.5s 1.3s ease-out both; }
  @keyframes xs-walk { from { stroke-dashoffset: 120; opacity: 0; } to { stroke-dashoffset: 0; opacity: 0.7; } }
  @keyframes xs-mark { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
  .xs-trail-x { transform-box: fill-box; transform-origin: center; }
}

.xs-section { display: flex; align-items: center; gap: 14px; margin: 40px 0 14px !important; }
.xs-section::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--axis), transparent); }

.xs-chapters { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.xs-chapters a { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); text-decoration: none; height: 100%; }
.xs-chapters a:hover, .xs-chapters a:focus-visible { border-color: var(--accent); box-shadow: var(--shadow); }
.xs-numeral { flex: 0 0 2.2em; font-family: var(--serif); font-size: 26px; line-height: 1; color: var(--brand); text-align: center; padding-top: 2px; }
.xs-chapter { display: flex; flex-direction: column; gap: 3px; }
.xs-chapter strong { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.xs-chapter span { color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }

.xs-live { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)) !important; }
.xs-tools { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.xs-tools a.card { display: block; text-decoration: none; color: var(--ink); padding: 13px 15px; }
.xs-tools a.card:hover, .xs-tools a.card:focus-visible { border-color: var(--accent); box-shadow: var(--shadow); }
.xs-tools .chart-title { font-family: var(--serif); font-size: 16px; }
.xs-tools .chart-sub { margin: 2px 0 0; }
.xs-method { max-width: 760px; }
.xs-method p { font-family: var(--serif); font-size: 16px; line-height: 1.6; color: var(--ink-2); }

/* -- footer ---------------------------------------------------------------------- */
.xs-foot { text-align: center; padding-top: 22px; }
.xs-foot p { max-width: 82ch; margin: 6px auto; }
.xs-foot strong { font-family: var(--serif); font-size: 15px; color: var(--ink); }
.xs-aside { font-family: var(--serif); font-style: italic; color: var(--muted); }

@media (max-width: 960px) {
  [data-site="xshader"] .side { background: var(--page); }
}
@media (max-width: 640px) {
  /* A phone keeps the page for reading: the header scrolls away, its controls one row under the name. */
  [data-site="xshader"] .top { position: static; }
  [data-site="xshader"] .top-row { gap: 8px 10px; padding: 8px 12px; }
  [data-site="xshader"] .controls { flex-basis: 100%; order: 2; gap: 8px; }
  [data-site="xshader"] .global-search { order: 3; }
  [data-site="xshader"] .seg button { padding: 3px 8px; font-size: 12.5px; white-space: nowrap; }
  .xs-word { font-size: 19px; }
  .xs-hero { padding-top: 10px; }
  .xs-lede { font-size: 16.5px; }
  [data-site="xshader"] .prose p, [data-site="xshader"] .prose li { font-size: 16px; }
  .xs-toggle { order: 2; }
}
