/* carry: VXMZ studio system with carry's accent (Clay, earthy, never neon). Light only.
   Layout: sticky left sidebar (nav + "on this page") and one reading column, docs-style. */
:root {
  --ink: #11120f;
  --bg: #fbfaf7;
  --soft: #f1efe8;
  --soft-2: #e8e5dc;
  --deep: #2a1a14;
  --deep-2: #37231b;
  --accent: #c2674b;
  --accent-ink: #8f3d27;
  --muted: #60635b;
  --line: rgba(17, 18, 15, .11);

  --display: 'Boska', 'Bodoni Moda', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.19, 1, .22, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
::selection { background: var(--accent); color: #fff; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
img, svg { display: block; }
code, pre, kbd { font-family: var(--mono); }
:not(pre) > code { font-size: .86em; background: var(--soft); padding: 2px 6px; border-radius: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hide { display: none !important; }

/* ---------- curtain (VXMZ signature) ---------- */
.curtain { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; align-content: center; gap: 18px;
  background: var(--ink); color: var(--soft); cursor: pointer;
  transition: opacity .7s var(--ease), transform .9s var(--ease), visibility 0s .9s; }
.curtain.gone { opacity: 0; transform: translateY(-3%); visibility: hidden; pointer-events: none; }
.curtain p { margin: 0; font-size: 13px; letter-spacing: .32em; text-transform: uppercase; }
.curtain p strong { font-weight: 900; }
.curtain h2 { margin: 0; font: 500 clamp(56px, 12vw, 120px)/1 var(--display); letter-spacing: -.03em; }
.curtain h2 span { color: var(--accent); }
.curtain small { position: absolute; bottom: 28px; font-size: 11px; letter-spacing: .2em; opacity: .45; text-transform: uppercase; }
.curtain .bar { width: 120px; height: 2px; background: rgba(241, 239, 232, .15); overflow: hidden; }
.curtain .bar i { display: block; height: 100%; background: var(--accent); animation: fill 1.3s var(--ease) forwards; transform-origin: left; transform: scaleX(0); }
@keyframes fill { to { transform: scaleX(1); } }
.no-curtain .curtain { display: none; }

/* ---------- shell: sidebar + column ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); max-width: 1160px; margin: 0 auto; }
.side { position: sticky; top: 0; height: 100vh; padding: 40px 28px 28px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { width: 26px; height: auto; }
.brand b { font: 600 24px/1 var(--display); letter-spacing: -.02em; }
.side nav { display: grid; gap: 2px; margin-top: 40px; flex-shrink: 0; }
.side nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; padding: 5px 0 5px 14px; position: relative; }
.side nav a:hover, .side nav a[aria-current="page"] { color: var(--ink); }
.side nav a[aria-current="page"]::before { content: ''; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--accent); }
.side nav .ext::after { content: ' ↗'; font-size: 12px; }
/* brand + nav stay put; only "on this page" scrolls when it is too long */
.toc { flex: 0 1 auto; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); min-height: 0; display: flex; flex-direction: column; }
.toc-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.toc:empty { display: none; }
.toc .label { margin-bottom: 10px; flex-shrink: 0; }
.toc a { display: flex; align-items: center; gap: 10px; color: var(--muted); text-decoration: none; font-size: 13.5px; padding: 4px 0; }
.toc a::before { content: ''; width: 12px; height: 1px; background: var(--line); transition: width .25s var(--ease), background .25s; }
.toc a.on { color: var(--ink); }
.toc a.on::before { width: 20px; background: var(--accent); }
.toc a.sub { padding-left: 14px; font-size: 13px; }
.menu-btn { display: none; }

.page { padding: 40px 56px 0; min-width: 0; }
.col { max-width: 680px; }

/* ---------- type ---------- */
.label { font: 500 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
h1 { font: 400 clamp(32px, 4.4vw, 42px)/1.14 var(--body); letter-spacing: -.035em; margin: 0 0 18px; }
h1 em, h2 em { font: italic 500 1.06em/1 var(--display); color: var(--accent-ink); letter-spacing: -.01em; }
h2 { font: 400 clamp(24px, 3vw, 30px)/1.2 var(--body); letter-spacing: -.025em; margin: 0 0 14px; }
h3 { font: 600 16px/1.35 var(--body); letter-spacing: -.01em; margin: 0 0 6px; }
.lede { font-size: 17.5px; color: var(--muted); margin: 0 0 28px; max-width: 54ch; }
.muted, .note { color: var(--muted); }
.note { font-size: 14px; margin: 12px 0 0; }
p { margin: 0 0 14px; }

/* ---------- announcement pill ---------- */
.pill { display: inline-flex; align-items: stretch; border: 1px solid var(--line); font: 500 12px/1 var(--mono); margin-bottom: 28px; background: #fff; }
.pill span { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--muted); }
.pill span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pill a { display: flex; align-items: center; white-space: nowrap; padding: 8px 12px; border-left: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pill a:hover { background: var(--soft); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 40px; padding: 0 16px;
  font: 500 12px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 2px; transition: background .2s, border-color .2s, transform .15s; color: var(--ink); background: var(--soft); }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fffaf5; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-secondary:hover { background: var(--soft-2); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 11px; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; }

/* copy setup prompt: split button + menu */
.prompt { position: relative; display: inline-flex; margin-top: 8px; }
.prompt .btn { background: var(--soft); }
.prompt .btn:first-child { min-width: 248px; justify-content: space-between; }
.prompt .more { width: 40px; padding: 0; border-left: 1px solid var(--line); }
.prompt .more svg { transition: transform .2s; }
.prompt.open .more svg { transform: rotate(180deg); }
.prompt-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 100%; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(17, 18, 15, .1); padding: 6px; display: none; }
.prompt.open .prompt-menu { display: grid; }
.prompt-menu p { margin: 4px 8px 6px; font-size: 12.5px; color: var(--muted); }
.prompt-menu a { padding: 8px; font-size: 14px; color: var(--ink); text-decoration: none; }
.prompt-menu a:hover { background: var(--soft); }

.works { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 26px; }
.works img { width: 22px; height: 22px; }
.works .label { margin-right: 4px; }

/* ---------- figure: animated terminals ---------- */
figure { margin: 48px 0 0; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 14px; }
figcaption b { color: var(--ink); font-weight: 600; }
.stage { background: var(--soft); border: 1px solid var(--line); padding: 36px 32px 32px; }
.term { background: var(--deep); color: #f2e6de; border-radius: 10px; overflow: hidden; box-shadow: 0 24px 48px rgba(17, 18, 15, .18); font: 400 13px/1.7 var(--mono); }
.term-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; background: var(--deep-2); font-size: 11px; color: #b39a8f; letter-spacing: .06em; }
.term-head i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-head i:nth-child(2) { background: #febc2e; }
.term-head i:nth-child(3) { background: #28c840; }
.term-head span { margin-left: auto; }
.term pre { margin: 0; padding: 16px 18px 20px; white-space: pre-wrap; word-break: break-word; }
.term .p { color: #cf7a5e; }
.term .c { color: #a3887c; }
.term .ok { color: #e8a58c; }
.term + .term { margin-top: 14px; }
.stack.live { position: relative; height: 312px; }
.stack.live .term { position: absolute; left: 0; right: 0; top: 30px; margin: 0; transition: transform .9s var(--ease), opacity .9s var(--ease), filter .9s var(--ease); }
.stack.live .term pre { height: 228px; overflow: hidden; }
.stack.live .term.front { z-index: 2; transform: none; opacity: 1; }
.stack.live .term.back { z-index: 1; transform: translate(22px, -30px) scale(.94); opacity: .45; filter: saturate(.6); }
.caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -.2em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- sections ---------- */
section { padding: 72px 0 0; }
section > .label { margin-bottom: 14px; display: block; }
.items { display: grid; gap: 0; margin-top: 28px; border-top: 1px solid var(--line); }
.items > div { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.items > div > .label { padding-top: 3px; color: var(--accent-ink); }
.items p { margin: 0; color: var(--muted); font-size: 15px; }

/* numbered writing list */
.writing { margin-top: 20px; border-top: 1px solid var(--line); }
.writing a { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.writing a:hover .t { color: var(--accent-ink); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tags i { font: 500 12px/1 var(--body); font-style: normal; color: var(--accent-ink); background: rgba(194, 103, 75, .1); padding: 5px 9px; border-radius: 999px; }
.blog-tools { display: grid; gap: 12px; margin-top: 8px; }
.blog-search { max-width: 360px; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-filter button { font: 500 13px/1 var(--body); color: var(--muted); background: none; border: 1px solid var(--line); padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.tag-filter button.on, .tag-filter button:hover { color: var(--ink); border-color: var(--ink); }
.posts .none { padding: 16px 0; margin: 0; }
.writing .d { font-size: 13px; line-height: 1.8; color: var(--muted); white-space: nowrap; }
.more-link { display: inline-block; margin-top: 18px; font: 500 12px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.more-link:hover { color: var(--accent-ink); }

/* faq */
.faq { margin-top: 20px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 500; font-size: 16px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--accent-ink); font: 400 20px/1 var(--body); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

/* feedback */
form { display: grid; gap: 14px; margin-top: 20px; }
label { font: 500 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
select, input, textarea { width: 100%; font: 400 15px/1.5 var(--body); color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 10px 12px; }
textarea { min-height: 120px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row > div, form > div { display: grid; gap: 6px; }
form .btn { justify-self: start; }

/* ---------- docs ---------- */
.doc h2 { margin-top: 64px; padding-top: 4px; }
.doc h3 { margin-top: 32px; }
.doc p, .doc li { color: #3b3d37; }
.doc ul, .doc ol { padding-left: 20px; margin: 0 0 14px; }
.doc li { margin-bottom: 6px; }
.tabs { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); margin: 6px 8px 12px 0; background: #fff; }
.tab { border: 0; background: none; color: var(--muted); font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 10px 14px; cursor: pointer; }
.tab + .tab { border-left: 1px solid var(--line); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.codebox { position: relative; margin: 10px 0 16px; }
.code { background: var(--deep); color: #f2e6de; border-radius: 4px; padding: 16px 18px; font: 400 13px/1.75 var(--mono); overflow-x: auto; white-space: pre; }
.code .p { color: #cf7a5e; user-select: none; }
.code .c { color: #a3887c; }
.copy { position: absolute; top: 10px; right: 10px; z-index: 1; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  background: rgba(241, 239, 232, .1); color: #f2e6de; border: 1px solid rgba(241, 239, 232, .18); padding: 7px 9px; border-radius: 2px; cursor: pointer; }
table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0 20px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
th { font: 500 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
td code { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.callout { border-left: 2px solid var(--accent); background: var(--soft); padding: 14px 16px; margin: 16px 0; font-size: 15px; }
.callout p:last-child { margin: 0; }

/* blog + legal articles */
.post-meta { font: 400 12px/1.6 var(--mono); color: var(--muted); margin-bottom: 28px; }
.prose p, .prose li { color: #3b3d37; font-size: 16.5px; }
.prose h2 { margin-top: 44px; }
.prose ul { padding-left: 20px; }
.legal h1 { margin-bottom: 8px; }
.legal h2 { font-size: 20px; margin-top: 36px; }
.legal p, .legal li { color: #3b3d37; }

/* ---------- footer ---------- */
footer { margin-top: 96px; padding: 40px 0 36px; border-top: 1px solid var(--line); }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.foot-cols div { display: grid; gap: 8px; align-content: start; }
.foot-cols .label { margin-bottom: 4px; font: 600 13px/1.3 var(--body); letter-spacing: 0; text-transform: none; color: var(--ink); }
.foot-cols a { color: var(--muted); text-decoration: none; font-size: 14px; }
.foot-cols a:hover { color: var(--ink); }
.sig { margin-top: 40px; font: 400 13px/1.4 var(--body); letter-spacing: .01em; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; }
.sig a { color: inherit; text-decoration: none; }
.sig strong { color: var(--ink); font-weight: 800; }
.product { margin-top: 10px; font: 500 11px/1.4 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.product strong { color: var(--ink); font-weight: 800; }

/* ---------- small screens: sidebar becomes a top bar ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 50; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); background: rgba(251, 250, 247, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow: visible; }
  .side nav, .toc { display: none; }
  .menu-btn { display: block; background: none; border: 0; padding: 6px; color: var(--ink); cursor: pointer; }
  .side.open nav { display: grid; width: 100%; margin-top: 12px; padding-bottom: 4px; }
  .page { padding: 28px 16px 0; }
  .prompt .btn:first-child { min-width: 0; }
  .stage { padding: 24px 14px 18px; }
  .term { font-size: 11.5px; }
  .stack.live { height: 290px; }
  .stack.live .term pre { height: 212px; }
  .stack.live .term.back { transform: translate(12px, -24px) scale(.95); }
  .row, .foot-cols { grid-template-columns: 1fr 1fr; }
  .items > div { grid-template-columns: 1fr; gap: 6px; }
  .code { padding-top: 46px; }
}
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
