/* Everything Studio — documentation site (GitHub Pages). No external fonts, scripts or trackers. */
:root {
  --bg: #090b10;
  --bg-1: #0f1218;
  --bg-2: #141821;
  --bg-3: #1a1f2a;
  --line: #232a37;
  --line-2: #2f3848;
  --text: #e8ebf2;
  --dim: #a2abbd;
  --faint: #6b7487;
  --violet: #a78bfa;
  --violet-2: #8b5cf6;
  --cyan: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1180px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
code, kbd, pre { font-family: var(--mono); }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.grad {
  background: linear-gradient(100deg, var(--violet) 10%, var(--cyan) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.small { font-size: 0.875rem; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--violet-2); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 12px; }

/* ---- top navigation ---------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(9, 11, 16, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--faint); letter-spacing: 0.02em; margin-top: -3px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a { color: var(--dim); font-size: 0.925rem; font-weight: 550; padding: 7px 12px; border-radius: 8px; }
.nav-links a:hover { color: var(--text); background: var(--bg-3); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--text); background: rgba(167, 139, 250, 0.14); }
.nav-links .gh { border: 1px solid var(--line-2); margin-left: 6px; display: inline-flex; align-items: center; gap: 7px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 8px; padding: 7px 9px; cursor: pointer; }
.nav-toggle svg { width: 20px; height: 20px; display: block; }
.nav-links .gh svg { width: 14px; height: 14px; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 62px; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 20px 16px; background: var(--bg-1); border-bottom: 1px solid var(--line); margin: 0; }
  .nav-links.open { display: flex; }
  .nav-links .gh { margin: 6px 0 0; justify-content: center; }
}

/* ---- buttons ----------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font: 600 0.975rem/1 var(--sans);
  padding: 13px 20px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--bg-3); color: var(--text);
  cursor: pointer; transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.btn:hover { text-decoration: none; border-color: #46526a; transform: translateY(-1px); }
.btn.primary { background: linear-gradient(100deg, var(--violet-2), #6d5cf6 55%, #2bb8d6); border-color: transparent; color: #fff; box-shadow: 0 8px 30px -12px rgba(139, 92, 246, 0.8); }
.btn.sm { padding: 8px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn svg { width: 17px; height: 17px; flex: none; }

/* ---- hero -------------------------------------------------------------------------------- */
.hero { position: relative; padding: 76px 0 40px; text-align: center; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: -80px 0 auto; height: 720px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(620px 340px at 22% 18%, rgba(139, 92, 246, 0.26), transparent 70%),
    radial-gradient(560px 320px at 80% 8%, rgba(34, 211, 238, 0.17), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 44px 100%;
  -webkit-mask-image: linear-gradient(#000 30%, transparent 92%);
  mask-image: linear-gradient(#000 30%, transparent 92%);
  opacity: 0.75;
}
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(20, 24, 33, 0.8); color: var(--dim); font-size: 0.82rem; font-weight: 550; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.16); }
.hero h1 { font-size: clamp(2.2rem, 5.6vw, 4.1rem); font-weight: 800; letter-spacing: -0.035em; margin: 22px auto 18px; }
.hero h1 .grad { display: block; padding-bottom: 0.08em; }
.hero .lead { font-size: clamp(1.02rem, 1.5vw, 1.2rem); color: var(--dim); max-width: 64ch; margin: 0 auto 28px; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.hero-cmd { margin: 26px auto 0; display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 12px; padding: 10px 12px 10px 16px; border: 1px solid var(--line-2); background: var(--bg-1); border-radius: 12px; font: 0.9rem var(--mono); color: var(--dim); max-width: 100%; overflow-x: auto; }
.hero-cmd b { color: var(--cyan); font-weight: 500; }

/* ---- screenshots in a window frame --------------------------------------------------------- */
.frame { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--bg-1); box-shadow: 0 40px 120px -50px rgba(139, 92, 246, 0.55), 0 30px 60px -40px #000; }
.frame-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.frame-bar i { width: 11px; height: 11px; border-radius: 50%; background: #343c4c; }
.frame-bar span { margin-left: 10px; font: 0.78rem var(--mono); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frame img { width: 100%; }
.hero-shot { margin-top: 52px; }

/* ---- sections ---------------------------------------------------------------------------- */
section { padding: 78px 0; }
section.tight { padding: 52px 0; }
.band { background: linear-gradient(var(--bg-1), var(--bg)); border-block: 1px solid var(--line); }
.eyebrow { font: 600 0.78rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 14px; }
.sec-head { max-width: 760px; margin-bottom: 38px; }
.sec-head.center { text-align: center; margin-inline: auto; }
.sec-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.45rem); font-weight: 780; letter-spacing: -0.028em; margin-bottom: 14px; }
.sec-head p { color: var(--dim); font-size: 1.06rem; margin: 0; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1000px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4, .g5 { grid-template-columns: minmax(0, 1fr); } }

.card { position: relative; border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--radius); padding: 22px; overflow: hidden; }
.card h3 { font-size: 1.06rem; margin-bottom: 8px; }
.card p { color: var(--dim); font-size: 0.95rem; margin: 0; }
.card.link { transition: border-color 0.15s ease, transform 0.15s ease; color: inherit; display: block; }
.card.link:hover { border-color: var(--line-2); transform: translateY(-2px); text-decoration: none; }
.card .more { display: inline-block; margin-top: 12px; font-weight: 600; font-size: 0.9rem; color: var(--violet); }
.area { --c: var(--violet); }
.area::after { content: ""; position: absolute; right: -46px; bottom: -46px; width: 150px; height: 150px; border-radius: 50%; background: var(--c); opacity: 0.09; pointer-events: none; }
.chip { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px; color: var(--c, var(--violet)); background: color-mix(in srgb, var(--c, var(--violet)) 16%, transparent); }
.chip svg { width: 21px; height: 21px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tag { font: 0.76rem var(--mono); color: var(--dim); border: 1px solid var(--line-2); padding: 3px 8px; border-radius: 6px; background: var(--bg-1); }

.steps { counter-reset: step; }
.step { counter-increment: step; }
.step h3::before { content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 10px; border-radius: 50%; font-size: 0.85rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--violet-2), #2bb8d6); }

/* feature rows: text beside a screenshot */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 46px; align-items: center; padding: 34px 0; }
.feature.flip > :first-child { order: 2; }
.feature h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); letter-spacing: -0.02em; margin-bottom: 12px; }
.feature p { color: var(--dim); }
.feature ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.feature li { position: relative; padding-left: 26px; color: var(--dim); font-size: 0.96rem; }
.feature li::before { content: ""; position: absolute; left: 3px; top: 0.55em; width: 12px; height: 7px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.feature li b { color: var(--text); font-weight: 600; }
@media (max-width: 900px) { .feature { grid-template-columns: minmax(0, 1fr); gap: 22px; } .feature.flip > :first-child { order: 0; } }

.shot { margin: 0; cursor: zoom-in; }
.shot figcaption { margin-top: 10px; font-size: 0.86rem; color: var(--faint); text-align: center; }
.gallery .shot .frame { box-shadow: none; }
.gallery .shot:hover .frame { border-color: var(--violet); }

/* ---- code ---------------------------------------------------------------------------------- */
.code { position: relative; margin: 0 0 1.2em; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #0b0e14; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px 7px 14px; border-bottom: 1px solid var(--line); font: 0.74rem var(--mono); color: var(--faint); letter-spacing: 0.04em; text-transform: uppercase; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 0.86rem; line-height: 1.6; color: #d7dceb; tab-size: 2; }
.code .c { color: #6b7487; }
.copy { font: 600 0.74rem var(--sans); color: var(--dim); background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 9px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.copy:hover { color: var(--text); }
.copy.done { color: var(--ok); border-color: rgba(52, 211, 153, 0.5); }
:not(pre) > code { font-size: 0.875em; background: var(--bg-3); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; color: #d9defa; white-space: nowrap; }
@media (max-width: 700px) { :not(pre) > code { white-space: normal; overflow-wrap: anywhere; } }
.prose { overflow-wrap: break-word; }
kbd { font-size: 0.8em; background: var(--bg-3); border: 1px solid var(--line-2); border-bottom-width: 2px; padding: 1px 6px; border-radius: 5px; }

/* ---- documentation pages --------------------------------------------------------------------- */
.page-head { padding: 54px 0 30px; border-bottom: 1px solid var(--line); background: radial-gradient(700px 240px at 12% 0%, rgba(139, 92, 246, 0.16), transparent 70%), radial-gradient(600px 220px at 88% 0%, rgba(34, 211, 238, 0.1), transparent 70%); }
.page-head h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 12px; }
.page-head p { color: var(--dim); font-size: 1.08rem; max-width: 70ch; margin: 0; }
.doc { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 54px; padding: 40px 0 80px; align-items: start; }
.toc { position: sticky; top: 86px; max-height: calc(100vh - 110px); overflow: auto; padding-right: 6px; font-size: 0.9rem; }
.toc b { display: block; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.toc a { display: block; color: var(--dim); padding: 5px 0 5px 13px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.on { color: var(--text); border-left-color: var(--violet); }
.toc a.sub { padding-left: 26px; font-size: 0.86rem; }
@media (max-width: 900px) { .doc { grid-template-columns: minmax(0, 1fr); gap: 0; } .toc { display: none; } }

.prose { min-width: 0; max-width: 820px; }
.prose h2 { font-size: 1.62rem; font-weight: 760; letter-spacing: -0.022em; margin: 2.4em 0 0.7em; padding-top: 0.4em; border-top: 1px solid var(--line); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 1.16rem; font-weight: 680; margin: 1.9em 0 0.6em; }
.prose h4 { font-size: 0.98rem; font-weight: 650; margin: 1.5em 0 0.5em; color: var(--dim); }
.prose p, .prose li { color: #c6ccdb; }
.prose strong, .prose b { color: var(--text); font-weight: 620; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li { margin: 0.32em 0; }
.prose li::marker { color: var(--faint); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose .frame { margin: 1.4em 0 1.8em; box-shadow: none; }
.anchor { color: var(--faint); margin-left: 8px; font-weight: 400; opacity: 0; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }

.callout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; border: 1px solid var(--line-2); border-left: 3px solid var(--violet); background: var(--bg-2); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 1.2em; }
.callout p { margin: 0; color: #c6ccdb; font-size: 0.95rem; }
.callout p + p { margin-top: 0.6em; }
.callout svg { width: 19px; height: 19px; margin-top: 3px; color: var(--violet); }
.callout.warn { border-left-color: var(--warn); }
.callout.warn svg { color: var(--warn); }
.callout.ok { border-left-color: var(--ok); }
.callout.ok svg { color: var(--ok); }

.table-wrap { overflow-x: auto; margin: 0 0 1.3em; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); background: var(--bg-2); padding: 10px 14px; white-space: nowrap; }
td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; color: #c6ccdb; }
td:first-child code { white-space: nowrap; }
tbody tr:hover { background: rgba(255, 255, 255, 0.015); }

.next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 3em; }
.next a { border: 1px solid var(--line); background: var(--bg-2); border-radius: var(--radius-sm); padding: 14px 16px; color: var(--text); }
.next a:hover { border-color: var(--violet); text-decoration: none; }
.next small { display: block; color: var(--faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 3px; }
.next a:last-child { text-align: right; }
@media (max-width: 640px) { .next { grid-template-columns: minmax(0, 1fr); } .next a:last-child { text-align: left; } }

/* ---- footer ---------------------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); background: var(--bg-1); padding: 46px 0 34px; font-size: 0.92rem; }
.foot { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 34px; }
.foot h4 { font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot a { color: var(--dim); }
.foot a:hover { color: var(--text); }
.foot p { color: var(--faint); max-width: 46ch; margin: 12px 0 0; font-size: 0.86rem; }
.legal { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; color: var(--faint); font-size: 0.82rem; }
.legal a { color: var(--dim); }
@media (max-width: 820px) { .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot > :first-child { grid-column: 1 / -1; } }

/* ---- lightbox -------------------------------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 3vmin; background: rgba(4, 5, 8, 0.92); cursor: zoom-out; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 10px; border: 1px solid var(--line-2); box-shadow: 0 30px 90px #000; }
.lightbox p { margin: 14px 0 0; color: var(--dim); text-align: center; font-size: 0.92rem; }
.lightbox button { position: absolute; top: 16px; right: 18px; background: var(--bg-3); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 12px; cursor: pointer; font: 600 0.85rem var(--sans); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card.link { transition: none; }
}
@media print {
  .nav, .toc, .footer, .copy, .hero::before { display: none !important; }
  body { background: #fff; color: #000; }
  .prose p, .prose li, td { color: #000; }
}
