/* ===== ProTools wiki - light, minimal, 11ty-style ====================== */
:root {
  --brand: #0a97c9;
  --brand-strong: #0782ad;

  --bg: #ffffff;
  --bg-soft: #f6f8fa;
  --bg-mute: #eef1f4;
  --card: #ffffff;
  --border: #e4e8ec;
  --border-soft: #eef1f4;
  --fg: #1f2328;
  --fg-soft: #59636e;
  --fg-faint: #818b96;
  --code-bg: #f6f8fa;
  --topbar-bg: rgba(255, 255, 255, 0.9);
  --shadow: 0 1px 2px rgba(31, 35, 40, 0.06);
  --shadow-lg: 0 12px 40px rgba(31, 35, 40, 0.18);

  --sidebar-w: 248px;
  --toc-w: 210px;
  --topbar-h: 56px;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
}
html.dark {
  --brand: #38b6e6;
  --brand-strong: #5cc4ea;
  --bg: #16181d;
  --bg-soft: #1c1f26;
  --bg-mute: #232730;
  --card: #1b1e25;
  --border: #2b313b;
  --border-soft: #23272f;
  --fg: #e6e9ee;
  --fg-soft: #9aa4b0;
  --fg-faint: #7b8592;
  --code-bg: #12141a;
  --topbar-bg: rgba(22, 24, 29, 0.9);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
kbd {
  font-family: var(--font); font-size: 0.72em; line-height: 1;
  padding: 3px 5px; border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; background: var(--bg-soft); color: var(--fg-soft);
}

/* ===== Topbar =========================================================== */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: var(--topbar-bg); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar__brand { display: flex; align-items: center; gap: 9px; color: var(--fg); font-weight: 650; }
.topbar__brand:hover { text-decoration: none; }
.topbar__name { font-size: 1.02rem; letter-spacing: -0.01em; }
.topbar__spacer { flex: 1; }
.topbar__search {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-soft);
  color: var(--fg-soft); cursor: pointer; font-size: 0.85rem; min-width: 200px;
}
.topbar__search:hover { border-color: var(--brand); }
.topbar__search span { flex: 1; text-align: left; }
.topbar__search kbd { pointer-events: none; }
.topbar__icon, .topbar__theme {
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 8px; color: var(--fg-soft); background: transparent; border: 1px solid transparent; cursor: pointer;
}
.topbar__icon:hover, .topbar__theme:hover { background: var(--bg-soft); color: var(--fg); }
.topbar__theme { font-size: 1rem; border-color: var(--border); }
.topbar__theme-light { display: none; }
html.dark .topbar__theme-dark { display: none; }
html.dark .topbar__theme-light { display: inline; }
.topbar__menu { display: none; flex-direction: column; gap: 4px; background: transparent; border: 0; cursor: pointer; padding: 6px; }
.topbar__menu span { width: 22px; height: 2px; background: var(--fg); border-radius: 2px; }

/* ===== Shell / layout =================================================== */
.shell { display: flex; max-width: 1320px; margin: 0 auto; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  position: sticky; top: var(--topbar-h); align-self: flex-start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 24px 12px 40px; border-right: 1px solid var(--border);
}
.sidebar__group { margin-bottom: 22px; }
.sidebar__title {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--fg-faint); margin: 0 0 6px 10px; font-weight: 700;
}
.sidebar__list { list-style: none; margin: 0; padding: 0; }
.sidebar__link {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  border-radius: 7px; color: var(--fg-soft); font-size: 0.9rem; line-height: 1.4;
}
.sidebar__link:hover { background: var(--bg-soft); color: var(--fg); text-decoration: none; }
.sidebar__link.is-active {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand-strong); font-weight: 600;
}
.sidebar__icon { width: 1.2em; text-align: center; }

.content { flex: 1 1 auto; min-width: 0; padding: 34px 44px 90px; }
.doc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) var(--toc-w); gap: 44px; align-items: start; }
.doc { min-width: 0; max-width: 760px; }
.doc--home { max-width: 820px; margin: 0 auto; }

/* ===== On-this-page (TOC) ============================================== */
.toc { position: sticky; top: calc(var(--topbar-h) + 24px); align-self: start; font-size: 0.85rem; }
.toc__title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--fg-faint); font-weight: 700; margin: 0 0 8px; }
.toc__list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc__list li a {
  display: block; padding: 3px 0 3px 14px; margin-left: -1px;
  color: var(--fg-soft); border-left: 2px solid transparent; line-height: 1.4;
}
.toc__list li a:hover { color: var(--fg); text-decoration: none; }
.toc__list li a.is-active { color: var(--brand-strong); border-left-color: var(--brand); font-weight: 600; }
.toc__list li.toc--h3 a { padding-left: 26px; font-size: 0.82rem; }
.toc:empty, .toc[hidden] { display: none; }

/* ===== Hero ============================================================= */
.hero {
  --hero-accent: var(--brand);
  display: flex; gap: 16px; align-items: center; padding: 20px 22px; margin-bottom: 26px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft);
}
.hero__icon {
  flex: 0 0 auto; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.7rem; background: color-mix(in srgb, var(--hero-accent) 16%, transparent);
}
.hero__eyebrow { margin: 0 0 2px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--hero-accent); font-weight: 700; }
.hero__title { margin: 0; font-size: 1.65rem; line-height: 1.2; letter-spacing: -0.02em; }
.hero__desc { margin: 5px 0 0; color: var(--fg-soft); }

/* ===== Prose =========================================================== */
.prose h1 { font-size: 1.9rem; margin: 1.4em 0 0.5em; letter-spacing: -0.02em; }
.prose h2 { font-size: 1.35rem; margin: 2em 0 0.6em; padding-bottom: 0.3em; border-bottom: 1px solid var(--border); letter-spacing: -0.01em; }
.prose h3 { font-size: 1.12rem; margin: 1.5em 0 0.4em; }
.prose h1 a, .prose h2 a, .prose h3 a, .prose h4 a { color: inherit; }
.prose h1 a.header-anchor, .prose h2 a.header-anchor, .prose h3 a.header-anchor { text-decoration: none; }
.prose :is(h1,h2,h3,h4) { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin: 0.25em 0; }
.prose code { background: var(--code-bg); padding: 0.15em 0.4em; border-radius: 5px; font-size: 0.85em; font-family: var(--mono); border: 1px solid var(--border-soft); }
.prose pre { position: relative; background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 15px 17px; overflow-x: auto; margin: 1.1em 0; }
.prose pre code { background: none; border: 0; padding: 0; font-size: 0.85rem; }
.prose blockquote { margin: 1.1em 0; padding: 0.5em 1em; border-left: 3px solid var(--brand); background: var(--bg-soft); border-radius: 0 8px 8px 0; color: var(--fg-soft); }
.prose img { border-radius: 10px; border: 1px solid var(--border); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.1em 0; font-size: 0.92rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border: 1px solid var(--border); }
.prose th { background: var(--bg-soft); font-weight: 600; }
.prose tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-soft) 50%, transparent); }

/* Copy button */
.copy-btn { position: absolute; top: 8px; right: 8px; background: var(--card); border: 1px solid var(--border); color: var(--fg-soft); font-size: 0.72rem; padding: 4px 9px; border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.copy-btn:hover { color: var(--brand); border-color: var(--brand); }

/* ===== Callout ========================================================= */
.callout { margin: 1.2em 0; border: 1px solid var(--border); border-left-width: 3px; border-radius: 9px; padding: 12px 15px; background: var(--bg-soft); }
.callout__head { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 2px; font-size: 0.92rem; }
.callout__body :is(p):first-child { margin-top: 0; }
.callout__body :is(p):last-child { margin-bottom: 0; }
.callout--info { border-left-color: var(--brand); } .callout--info .callout__icon { color: var(--brand); }
.callout--tip { border-left-color: #1a9d5a; } .callout--tip .callout__icon { color: #1a9d5a; }
.callout--warn { border-left-color: #c98a12; } .callout--warn .callout__icon { color: #c98a12; }
.callout--danger { border-left-color: #d1343b; } .callout--danger .callout__icon { color: #d1343b; }

/* ===== Steps =========================================================== */
.steps { margin: 1.4em 0; padding-left: 8px; }
.step { position: relative; padding: 0 0 8px 30px; border-left: 2px solid var(--border); }
.step:last-child { border-left-color: transparent; }
.step__marker { position: absolute; left: -8px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--brand); border: 3px solid var(--bg); }
.step__title { margin: 0 0 3px; font-size: 1.02rem; }
.step__content :is(p):first-child { margin-top: 0; }

/* ===== Cards =========================================================== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 13px; margin: 1.4em 0; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--fg); transition: border-color 0.15s, box-shadow 0.15s; }
a.card:hover { border-color: var(--brand); box-shadow: var(--shadow); text-decoration: none; }
.card__icon { font-size: 1.4rem; }
.card__title { font-weight: 650; }
.card__body { color: var(--fg-soft); font-size: 0.88rem; }
.card__body p { margin: 0; }

/* ===== File tree ======================================================= */
.filetree, .filetree ul { list-style: none; margin: 0; padding-left: 18px; }
.filetree { margin: 1.2em 0; padding: 13px 17px; border: 1px solid var(--border); border-radius: 10px; background: var(--code-bg); font-size: 0.9rem; }
.filetree__folder > .filetree__label { font-weight: 600; }
.filetree li { padding: 2px 0; }

/* ===== prev / next ===================================================== */
.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 50px; }
.prevnext__link { display: flex; flex-direction: column; gap: 3px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 10px; color: var(--fg); }
.prevnext__link:hover { border-color: var(--brand); text-decoration: none; background: var(--bg-soft); }
.prevnext__link--next { text-align: right; }
.prevnext__label { font-size: 0.76rem; color: var(--fg-faint); }
.prevnext__title { font-weight: 600; }

/* ===== Home ============================================================ */
.home-hero { text-align: center; padding: 24px 20px 8px; }
.home-hero img { max-width: 600px; width: 100%; border-radius: 14px; border: 1px solid var(--border); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.badge { font-size: 0.78rem; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--fg-soft); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 11px; margin: 1.3em 0; }
.tool-tile { display: flex; gap: 10px; align-items: flex-start; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--fg); transition: border-color 0.15s, box-shadow 0.15s; }
a.tool-tile:hover { text-decoration: none; border-color: var(--brand); box-shadow: var(--shadow); }
.tool-tile__icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 1.15rem; flex: 0 0 auto; }
.tool-tile__name { font-weight: 600; font-size: 0.94rem; }
.tool-tile__sum { color: var(--fg-soft); font-size: 0.81rem; }
.swatch { display: inline-block; width: 0.85em; height: 0.85em; border-radius: 3px; vertical-align: middle; border: 1px solid var(--border); }

/* ===== Footer ========================================================== */
.footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer__inner { max-width: 1320px; margin: 0 auto; padding: 22px 44px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer__brand { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.footer__note { color: var(--fg-soft); font-size: 0.86rem; margin: 0; flex: 1; }
.footer__top { font-size: 0.86rem; }

/* ===== Search modal ==================================================== */
.search[hidden] { display: none; }
.search { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding-top: 10vh; }
.search__backdrop { position: absolute; inset: 0; background: rgba(20, 24, 30, 0.45); backdrop-filter: blur(2px); }
.search__panel { position: relative; width: min(600px, 92vw); background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search__bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--fg-soft); }
.search__input { flex: 1; border: 0; background: transparent; color: var(--fg); font-size: 1rem; outline: none; font-family: var(--font); }
.search__esc { flex: 0 0 auto; }
.search__results { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.search__results li { margin: 0; }
.search__results li a { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border-radius: 8px; color: var(--fg); line-height: 1.35; }
.search__results li a:hover, .search__results li a.is-active { background: var(--bg-soft); text-decoration: none; }
.search__results li a.is-active { outline: 1px solid var(--brand); outline-offset: -1px; }
.search__r-title { display: block; font-weight: 600; font-size: 0.94rem; }
.search__r-sub { display: block; color: var(--fg-faint); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.search__r-title mark { background: color-mix(in srgb, var(--brand) 26%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search__empty { padding: 26px 16px; text-align: center; color: var(--fg-faint); font-size: 0.9rem; }
.search__hint { display: flex; gap: 16px; padding: 9px 14px; border-top: 1px solid var(--border); font-size: 0.72rem; color: var(--fg-faint); }
.search__hint kbd { margin-right: 3px; }

/* ===== Responsive ====================================================== */
@media (max-width: 1080px) {
  .doc-wrap { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .topbar__menu { display: flex; }
  .topbar__search { min-width: 0; }
  .topbar__search span, .topbar__search kbd { display: none; }
  .sidebar { position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 30; background: var(--bg); transform: translateX(-100%); transition: transform 0.2s; width: 82%; max-width: 320px; height: auto; }
  .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .content { padding: 26px 20px 70px; }
  .footer__inner { padding: 20px; }
  .prevnext { grid-template-columns: 1fr; }
}
