/* Attelium — site styles */
:root {
  --bg:      #0a0b10;
  --bg2:     #10121a;
  --panel:   #141722;
  --border:  #242938;
  --border2: #333a50;
  --text:    #e8eaf1;
  --muted:   #98a0b5;
  --faint:   #5d6580;
  --mint:    #7cf0d4;
  --mint-d:  #4fd1b3;
  --peri:    #8ea2ff;
  --add:     #5fd38d;
  --add-bg:  rgba(95,211,141,.10);
  --del:     #ff7b7b;
  --del-bg:  rgba(255,123,123,.10);
  --amber:   #f6c76a;
  --radius:  12px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --head: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(900px 420px at 80% -80px, rgba(124,240,212,.10), transparent 70%),
                    radial-gradient(700px 360px at 0% 0%, rgba(142,162,255,.08), transparent 70%);
  background-repeat: no-repeat;
}
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(34px, 5.4vw, 58px); font-weight: 700; }
h2 { font-size: clamp(25px, 3.2vw, 34px); font-weight: 700; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--mint); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
code, pre, kbd { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; background: var(--mint); color: #04130f; padding: 10px 16px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 780px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(10,11,16,.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 20px var(--head); color: var(--text); letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 26px; font-size: 14.5px; font-weight: 500; }
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border2); color: var(--text); border-radius: 8px; padding: 6px 8px; cursor: pointer; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 10px; font: 600 15px var(--sans); border: 1px solid var(--border2); color: var(--text); background: var(--panel); cursor: pointer; transition: border-color .15s, transform .15s, background .15s; }
.btn:hover { border-color: var(--mint); text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--mint); color: #04130f; border-color: var(--mint); }
.btn-primary:hover { background: #a2f6e1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-sm { padding: 7px 14px; font-size: 14px; }

/* Hero */
.hero { padding: 84px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-block; font: 600 12.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mint); border: 1px solid rgba(124,240,212,.35); background: rgba(124,240,212,.07); padding: 4px 12px; border-radius: 999px; margin-bottom: 20px; }
.hero h1 .grad { background: linear-gradient(100deg, var(--mint), var(--peri)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 19px; color: var(--muted); max-width: 58ch; margin: 22px 0 28px; }
.fine { font-size: 13.5px; color: var(--faint); margin-top: 16px; }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 36px; }
.section-head p { color: var(--muted); font-size: 17px; margin: 12px 0 0; }
.grid { display: grid; gap: 20px; }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); margin: 0; font-size: 15.5px; }
.card .num { font: 600 13px var(--mono); color: var(--mint); margin-bottom: 10px; display: block; }

/* Code */
pre { margin: 0; background: #07080c; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; overflow-x: auto; font-size: 13.5px; line-height: 1.65; color: #d7dbe8; }
code { font-size: .92em; }
p code, li code, td code { background: rgba(142,162,255,.12); color: #c9d2ff; padding: 1px 6px; border-radius: 5px; }
.codeblock { position: relative; margin: 18px 0; }
.codeblock .label { font: 600 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.copy-btn { position: absolute; top: 28px; right: 10px; font: 600 12px var(--sans); background: var(--panel); border: 1px solid var(--border2); color: var(--muted); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.codeblock:not(:has(.label)) .copy-btn { top: 10px; }
.copy-btn:hover { color: var(--text); border-color: var(--mint); }
.t-prompt { color: var(--mint); } .t-dim { color: var(--faint); } .t-key { color: var(--peri); } .t-str { color: var(--amber); }
.k-node { color: #b8a4f8; } .k-rel { color: #f8a080; } .k-link { color: #80e8b0; } .k-prop { color: #80b8f8; } .k-tag { color: #a0d880; } .k-cmt { color: #586058; }

/* Diff */
.diff { font: 13.5px/1.65 var(--mono); background: #07080c; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.diff-file { background: var(--panel); padding: 8px 16px; color: var(--muted); border-bottom: 1px solid var(--border); font-size: 12.5px; }
.diff-file b { color: var(--text); font-weight: 600; }
.diff-body { padding: 8px 0; overflow-x: auto; }
.diff .l { display: block; padding: 0 16px; white-space: pre; min-width: max-content; }
.diff .add { background: var(--add-bg); color: var(--add); }
.diff .del { background: var(--del-bg); color: var(--del); }
.diff .ctx { color: var(--faint); }
.diff .hunk { color: var(--peri); padding-top: 4px; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--panel); font: 600 12.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; white-space: nowrap; }
.yes { color: var(--add); } .no { color: var(--del); } .meh { color: var(--amber); }
.pill { display: inline-block; font: 600 11.5px var(--mono); padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border2); color: var(--muted); }
.pill.core { color: var(--mint); border-color: rgba(124,240,212,.45); }
.pill.soon { color: var(--amber); border-color: rgba(246,199,106,.45); }

/* Docs layout */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding: 48px 0 80px; }
.side { position: sticky; top: 92px; align-self: start; font-size: 14.5px; }
.side h4 { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }
.side a { display: block; padding: 6px 12px; border-left: 2px solid var(--border); color: var(--muted); }
.side a:hover { color: var(--text); text-decoration: none; }
.side a[aria-current] { color: var(--mint); border-color: var(--mint); }
.prose h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 14px; }
.prose h2 { margin: 44px 0 14px; font-size: 26px; }
.prose h3 { margin: 28px 0 8px; }
.prose p, .prose li { color: #cbd0de; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin-bottom: 6px; }
.prose .lead { margin-top: 0; }
.callout { border: 1px solid var(--border2); border-left: 3px solid var(--mint); background: var(--panel); border-radius: 8px; padding: 14px 18px; margin: 20px 0; color: var(--muted); font-size: 15.5px; }
.callout.warn { border-left-color: var(--amber); }
.callout strong { color: var(--text); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 48px 0 28px; margin-top: 40px; background: var(--bg2); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h4 { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.foot-grid a { display: block; color: var(--muted); padding: 3px 0; font-size: 14.5px; }
.foot-grid p { color: var(--muted); font-size: 14.5px; max-width: 34ch; }
.foot-bottom { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--faint); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

@media (max-width: 880px) {
  .hero-grid, .docs, .foot-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .side { position: static; display: flex; flex-wrap: wrap; gap: 4px 10px; }
  .side h4 { width: 100%; } .side a { border-left: 0; border-bottom: 2px solid var(--border); padding: 4px 6px; }
  .nav-toggle { display: inline-block; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 14px; background: var(--bg); border-bottom: 1px solid var(--border); padding: 18px 24px; }
  .nav-links.open { display: flex; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } html { scroll-behavior: auto; } }

/* Grid children must be allowed to shrink below their content's width, or wide <pre> blocks blow the layout out on phones. */
.hero-grid > *, .docs > *, .grid > *, .foot-grid > * { min-width: 0; }
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: #04130f; }

/* ===== v2 polish: hairlines, glow, icons, window-chrome code blocks, entrance motion ===== */
h1, h2 { text-wrap: balance; }
.nav-links a:not(.btn) { position: relative; padding: 6px 0; }
.nav-links a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, var(--mint), var(--peri)); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.22, 1, .36, 1); }
.nav-links a:not(.btn):hover::after, .nav-links a[aria-current]::after { transform: scaleX(1); }
.site-header { background: rgba(10, 11, 16, .78); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); }

.btn { border-radius: 11px; box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 1px 2px rgba(0, 0, 0, .3); }
.btn-primary { background: linear-gradient(180deg, #98f5df, var(--mint)); box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 8px 24px -8px rgba(124, 240, 212, .55); }
.btn-primary:hover { background: linear-gradient(180deg, #b4f9e9, #8ff2da); }

/* Hero artwork: a quiet knowledge graph */
.hero { position: relative; overflow: hidden; }
.hero-graph { position: absolute; right: -60px; top: -20px; width: min(760px, 80vw); height: auto; opacity: .55; pointer-events: none; z-index: 0; }
.hero-graph line { stroke: rgba(124, 240, 212, .22); stroke-width: 1; }
.hero-graph circle { fill: #0a0b10; stroke: rgba(124, 240, 212, .6); stroke-width: 1.4; }
.hero-graph circle.hub { stroke: var(--peri); fill: rgba(142, 162, 255, .18); }
.hero-graph circle.pulse { animation: pulse 3.6s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pulse { 0%, 100% { opacity: .5; transform: scale(1); } 50% { opacity: 1; transform: scale(1.5); } }
.hero-grid { position: relative; z-index: 1; }

/* Cards */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 60%), var(--panel); border-color: var(--border); transition: transform .35s cubic-bezier(.22, 1, .36, 1), border-color .25s, box-shadow .35s; }
.card:hover { transform: translateY(-3px); border-color: rgba(124, 240, 212, .4); box-shadow: 0 24px 50px -28px rgba(124, 240, 212, .45); }
.card .ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; margin-bottom: 14px; color: var(--mint); background: rgba(124, 240, 212, .09); border: 1px solid rgba(124, 240, 212, .22); }
.card .ico svg { width: 22px; height: 22px; }
.card .num { margin-bottom: 6px; }

/* Code blocks: window chrome */
pre { position: relative; padding-top: 40px; background: linear-gradient(180deg, #0a0c12, #07080c); box-shadow: 0 20px 40px -28px rgba(0, 0, 0, .8); }
pre::before { content: ""; position: absolute; left: 16px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; box-shadow: 17px 0 #febc2e, 34px 0 #28c840; opacity: .85; }
.diff { box-shadow: 0 20px 40px -28px rgba(0, 0, 0, .8); }
.copy-btn { top: 28px; border-radius: 8px; }
.codeblock:not(:has(.label)) .copy-btn { top: 9px; }
.codeblock .label { padding-left: 2px; }

/* Tables */
.table-wrap { box-shadow: 0 20px 40px -30px rgba(0, 0, 0, .8); }
tbody tr:hover td { background: rgba(255, 255, 255, .02); }

/* Docs */
.side a { border-radius: 0 8px 8px 0; transition: background .2s, color .2s; }
.side a:hover { background: rgba(255, 255, 255, .04); }
.side a[aria-current] { background: rgba(124, 240, 212, .07); }
.callout { box-shadow: 0 12px 30px -22px rgba(0, 0, 0, .8); }

/* Footer */
.site-footer { position: relative; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--mint), var(--peri), transparent); opacity: .7; }

/* Entrance motion (only when JS is present, so content never stays hidden) */
.js .rv { opacity: 0; transform: translateY(16px); transition: opacity .7s cubic-bezier(.22, 1, .36, 1), transform .7s cubic-bezier(.22, 1, .36, 1); }
.js .rv.in { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero .eyebrow, .hero h1, .hero .lead, .hero .btn-row, .hero .fine, .hero-grid > div:last-child { animation: rise .8s cubic-bezier(.22, 1, .36, 1) both; }
.hero h1 { animation-delay: .06s; } .hero .lead { animation-delay: .12s; } .hero .btn-row { animation-delay: .18s; } .hero-grid > div:last-child { animation-delay: .24s; }
@media (max-width: 880px) { .hero-graph { opacity: .25; right: -200px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } .js .rv { opacity: 1; transform: none; transition: none; } .hero-graph circle.pulse { animation: none; } .card { transition: none; } }
@media print { .js .rv { opacity: 1 !important; transform: none !important; } }
