:root {
  color-scheme: dark;
  --bg: #0f1018;
  --panel: #171825;
  --ink: #f4f3fa;
  --muted: #bdbece;
  --accent: #d3c8ff;
  --line: #32334a;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  scroll-padding-top: 90px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; line-height: 1.55; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); }
a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #e6c3ff; outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.12; text-wrap: balance; }
h1 { letter-spacing: -.061em; }
h2 { font-size: clamp(1.68rem, 3vw, 2.3rem); letter-spacing: -.04em; }
h3 { letter-spacing: -.027em; }
.wrap { width: min(1430px, calc(100% - 56px)); margin-inline: auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; inset: 8px auto auto 8px; z-index: 10; transform: translateY(-155%); padding: .65rem 1rem; background: #271e35; border-radius: 8px; }
.skip:focus { transform: none; }

.site-header { position: sticky; z-index: 5; top: 0; background: #0f1018f7; border-bottom: 1px solid #2a2b3e; }
.header-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 22px; position: relative; }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); font-size: 1.25rem; font-weight: 790; letter-spacing: -.045em; text-decoration: none; white-space: nowrap; }
.brand-icon { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid #6657a0; border-radius: 12px; background: #2a2550; color: #e3daff; }
.brand-sub { margin-left: .38em; font-size: .75em; font-weight: 560; letter-spacing: -.026em; color: #c2b9ee; }
.header-action { display: flex; align-items: center; gap: 12px; }
.quick-search { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 8px 14px; font-size: .9rem; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; }
.quick-search:hover { color: var(--ink); background: #22233a; }
.quick-search svg { width: 18px; height: 18px; }
.menu nav > a:not(.button) { color: var(--muted); padding: 9px 10px; font-size: .9rem; border-radius: 9px; text-decoration: none; }
.menu nav a[aria-current] { background: #2b2843; color: #f6edff; }
.menu { display: none; }
.workspace { display: grid; grid-template-columns: 183px minmax(0, 1fr); gap: clamp(20px, 2.4vw, 36px); }
.workspace main { min-width: 0; }
.rail { position: sticky; top: 90px; align-self: start; padding: 23px 0; }
.rail nav { display: grid; gap: 5px; }
.rail nav a { display: flex; align-items: center; gap: 10px; min-height: 45px; padding: 8px 10px; border: 1px solid transparent; border-radius: 11px; color: var(--muted); font-size: .91rem; font-weight: 580; text-decoration: none; }
.rail nav a:hover, .rail nav a[aria-current] { border-color: #504375; background: #25213e; color: #f5efff; }
.rail nav svg { width: 20px; height: 20px; flex: 0 0 20px; color: #c1aff9; }
.rail-note { display: grid; gap: 9px; margin: 17px 9px 0; padding-top: 15px; border-top: 1px solid var(--line); }
.rail-note a { color: var(--muted); font-size: .87rem; text-decoration: none; }
.rail-note a:hover { text-decoration: underline; }

.button { min-height: 46px; padding: 10px 19px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 999px; font-size: .91rem; font-weight: 730; text-align: center; text-decoration: none; border: 1px solid transparent; transition: box-shadow .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease; }
.button.primary { background: linear-gradient(115deg, #d8caff, #afa4ff 85%); color: #19112f; box-shadow: 0 5px 28px #917dff38; }
.button.secondary { background: #18172be8; border-color: #625785; color: #f6ebff; }
.header-action .button { min-height: 40px; padding-inline: 14px; }
.button:hover { transform: translateY(-2px); box-shadow: 0 6px 24px #c18aff42; }
.button.secondary:hover { border-color: #d4aef1; background: #2c2037; }
.actions { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; margin-top: 25px; }

.hero { position: relative; isolation: isolate; display: grid; align-items: center; overflow: hidden; min-height: 424px; margin-top: 23px; border: 1px solid #484171; border-radius: 24px; background: #171527; }
.hero-art { position: absolute; inset: 0 0 0 auto; width: 70%; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #171527 0%, #171527ef 12%, #17152773 40%, transparent 68%), linear-gradient(0deg, #15132665, transparent 35%); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; width: min(58%, 595px); padding: 40px 10px 40px clamp(30px, 4vw, 58px); }
.kicker { display: flex; align-items: center; gap: 9px; color: #d9caff; font-size: .78rem; font-weight: 700; letter-spacing: .135em; text-transform: uppercase; margin-bottom: 14px; }
.kicker-line { width: 19px; height: 2px; border-radius: 999px; background: #b4a0ff; box-shadow: 0 0 13px #be9effa0; }
.hero h1 { max-width: 500px; font-size: clamp(2.65rem, 4.5vw, 4.45rem); line-height: 1; text-wrap: initial; }
.hero h1 span { display: block; color: #ccbdff; }
.hero-lead { max-width: 420px; margin-top: 17px; color: #dedbea; font-size: clamp(1rem, 1.5vw, 1.13rem); }

.feature-section { margin: 32px 0 32px; }
.library-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 13px; }
.library-search { display: flex; align-items: center; gap: 8px; min-width: 220px; padding: 0 13px; border: 1px solid #514b73; background: #181827; border-radius: 10px; }
.library-search:focus-within { outline: 2px solid #cdbdff; outline-offset: 2px; }
.library-search svg { width: 19px; height: 19px; flex: 0 0 19px; color: #c5b5f2; }
.library-search input { color: var(--ink); width: 100%; min-width: 0; min-height: 44px; padding: 5px 0; border: 0; background: transparent; outline: none; font: inherit; }
.library-search input::placeholder { color: #adaec3; }
.library-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filters button { min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px; background: #181827; color: var(--muted); font: inherit; font-size: .88rem; font-weight: 620; cursor: pointer; transition: background-color .2s ease, border-color .2s ease; }
.filters button:hover { background: #23213a; color: var(--ink); }
.filters button[aria-pressed="true"] { color: #f7f1ff; background: #322750; border-color: #755ba7; }
.guide-count { color: var(--muted); font-size: .88rem; }
.no-results { padding: 22px; border: 1px solid var(--line); border-radius: 14px; }
.no-results p { margin-bottom: 12px; }
.button:is(button) { font-family: inherit; cursor: pointer; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { position: relative; display: flex; flex-direction: column; overflow: hidden; isolation: isolate; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 15px; text-decoration: none; transition: border-color .24s ease, transform .24s ease, box-shadow .24s ease; }
.feature:hover, .feature:focus-visible { transform: translateY(-3px); border-color: #876bb4; box-shadow: 0 13px 34px #0b0b18; }
.feature-art { position: relative; overflow: hidden; height: clamp(135px, 15.5vw, 188px); background: #201b3b; }
.feature-art img, .guide-art img { width: 100%; height: 100%; object-fit: cover; }
.feature-art img { transition: transform .55s ease; }
.feature:hover img { transform: scale(1.055); }
.feature-art::after { content: ""; position: absolute; inset: auto 0 0; height: 55%; background: linear-gradient(transparent, #16131d9e); }
.feature-copy { position: relative; display: flex; align-items: flex-start; gap: 11px; padding: 16px; }
.feature-copy h3 { font-size: 1.18rem; }
.feature-copy p { color: var(--muted); margin-top: 5px; line-height: 1.45; }
.tile-icon { display: inline-grid; place-items: center; width: 37px; height: 37px; flex: 0 0 auto; background: #2a2447; color: #d7c3ff; border: 1px solid #645386; border-radius: 10px; }
.tile-icon svg { width: 21px; height: 21px; }

.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: center; padding: clamp(18px, 3vw, 32px); border: 1px solid #4e4270; border-radius: 17px; background: radial-gradient(ellipse at 0 0, #2d2348, transparent 72%), #19182a; }
.story-intro p { margin: 8px 0 13px; color: var(--muted); }
.story-intro a { display: inline-block; margin-top: 10px; text-underline-offset: .2em; }
.story-example { min-height: 147px; display: grid; align-items: center; padding: clamp(15px, 2.4vw, 24px); border-radius: 14px; background: #10101fd4; border: 1px solid #574979; }
.story-example blockquote { margin: 0; color: #f0eafa; font-size: 1.05rem; line-height: 1.62; }

.breadcrumbs { margin: 24px 0 13px; font-size: .88rem; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; list-style: none; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 9px; color: #9b88ac; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.guide-hero { --guide: #c69afb; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); gap: clamp(22px, 5vw, 66px); align-items: center; border-radius: 24px; padding: clamp(25px, 4.4vw, 56px); background: radial-gradient(ellipse at 92% -8%, #3a2450, transparent 56%), linear-gradient(130deg, #21172b, #16141a 70%); border: 1px solid #493857; }
.theme-image, .theme-spark { --guide: #bdc5ff; background: radial-gradient(ellipse at 92% -8%, #322951, transparent 61%), linear-gradient(135deg, #1d192e, #15151c 70%); }
.theme-shield, .theme-account { --guide: #c6d7ff; background: radial-gradient(ellipse at 96% 0%, #252d45, transparent 55%), linear-gradient(135deg, #1b2030, #15151c 72%); }
.theme-layers { --guide: #ffbfde; background: radial-gradient(ellipse at 96% 0%, #402236, transparent 60%), linear-gradient(135deg, #241a2d, #18151c 72%); }
.guide-copy .kicker { color: var(--guide); }
.guide-copy h1 { font-size: clamp(2.4rem, 4.8vw, 4.45rem); line-height: 1.02; }
.guide-copy .scope { color: var(--muted); font-size: .91rem; margin-top: 12px; }
.guide-side { isolation: isolate; position: relative; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.guide-art { height: 150px; border-radius: 16px 16px 0 0; overflow: hidden; border: 1px solid #554460; border-bottom: 0; }
.guide-art + .process { border-radius: 0 0 16px 16px; }
.process { background: #17131ee8; padding: 22px; border: 1px solid #5a4868; border-radius: 16px; }
.process .tile-icon { width: 35px; height: 35px; color: var(--guide); }
.process h2 { font-size: 1.22rem; margin-top: 10px; }
.process ol { position: relative; list-style: none; counter-reset: step; padding: 0; margin: 15px 0 0; display: grid; gap: 10px; }
.process ol::before { content: ""; position: absolute; left: 11px; top: 11px; bottom: 13px; width: 1px; background: #8b659d; }
.process li { counter-increment: step; display: flex; align-items: baseline; gap: 9px; color: #e0d5e9; font-size: .9rem; }
.process li::before { content: counter(step); position: relative; display: inline-grid; place-items: center; flex: 0 0 23px; height: 23px; border-radius: 50%; background: #37274a; border: 1px solid #725689; color: var(--guide); font-size: .75rem; font-weight: 750; }

.reading { display: grid; grid-template-columns: minmax(185px, 245px) minmax(0, 780px); gap: clamp(25px, 4.5vw, 64px); justify-content: center; align-items: start; margin: clamp(36px, 5vw, 64px) 0; }
.reading aside { position: sticky; top: 92px; }
.toc { background: #18161c; border: 1px solid #3b3143; border-radius: 14px; padding: 13px 13px 15px; max-height: calc(100vh - 118px); overflow: auto; }
.toc summary { cursor: pointer; font-size: .94rem; font-weight: 730; padding: 3px 5px; }
.toc ul { list-style: none; padding: 0; margin: 7px 0 0; }
.toc a { display: block; color: var(--muted); font-size: .85rem; line-height: 1.32; padding: 7px 6px; border-radius: 6px; text-decoration: none; }
.toc a:hover, .toc a:focus-visible { color: var(--ink); background: #2d2336; }
.article { font-size: 1.045rem; line-height: 1.72; color: #dfd8e4; overflow-wrap: break-word; }
.article h2, .article h3 { color: var(--ink); text-wrap: pretty; }
.article h2 { border-bottom: 1px solid #3a3042; padding-bottom: 13px; margin: 5px 0 15px; font-size: clamp(1.52rem, 3vw, 2.02rem); }
.article h3 { margin-top: 23px; margin-bottom: 8px; font-size: 1.23rem; }
.article p { margin-bottom: 13px; }
.article > p:first-of-type { color: var(--ink); font-size: 1.13rem; }
.article a { text-underline-offset: .2em; }
.article a:hover { color: #ffe4fa; }
.article ol, .article ul { padding-left: 1.4rem; margin-top: 9px; margin-bottom: 16px; }
.article li { padding-left: 3px; margin-bottom: 5px; }
.article li::marker { color: #d6aef6; }
.body-section { margin-top: clamp(31px, 4.6vw, 52px); }
.table-scroll { margin: 19px 0 25px; overflow-x: auto; border: 1px solid #473a53; border-radius: 12px; background: #18161d; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; line-height: 1.5; min-width: 470px; }
caption { text-align: left; padding: 12px 14px; color: var(--ink); font-weight: 730; background: #261e30; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-top: 1px solid #3d3245; }
th { color: #f3e9ff; background: #251d30; }
tr:nth-child(even) td { background: #1d1922; }
.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid #45384f; border-radius: 11px; background: #1b1720; }
.faq details[open] { border-color: #73528d; }
.faq summary { position: relative; cursor: pointer; list-style: none; color: #f3e8fa; padding: 12px 42px 12px 14px; font-weight: 660; }
.faq summary::-webkit-details-marker, .menu summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 15px; top: 50%; width: 12px; height: 12px; transform: translateY(-50%); background: linear-gradient(var(--accent), var(--accent)) center / 12px 1px no-repeat, linear-gradient(var(--accent), var(--accent)) center / 1px 12px no-repeat; }
.faq details[open] summary::after { background-size: 12px 1px, 0 0; }
.faq details p { padding: 0 14px; margin: 0 0 14px; }

.site-footer { border-top: 1px solid #33314a; background: #151522; }
.footer-grid { display: grid; grid-template-columns: minmax(160px, .81fr) 2.19fr; gap: 34px; padding: 35px 0 28px; }
.footer-about p { color: var(--muted); max-width: 270px; margin-top: 10px; }
.footer-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.footer-nav h2 { font-size: .95rem; letter-spacing: 0; line-height: 1.3; margin: 0 0 9px; }
.footer-nav ul { margin: 0; padding: 0; list-style: none; }
.footer-nav li { margin-bottom: 5px; }
.footer-nav a, .footer-base { color: var(--muted); font-size: .88rem; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #3a3241; padding: 14px 0 18px; }
.error-page { min-height: 85vh; display: grid; justify-items: start; align-content: center; gap: 15px; }
.error-page h1 { font-size: clamp(2.7rem, 8vw, 5rem); }

@media (max-width: 990px) {
  .wrap { width: calc(100% - 40px); }
  .workspace { display: block; }
  .rail, .header-action { display: none; }
  .menu { display: block; }
  .menu summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #5c4769; border-radius: 10px; color: var(--ink); font-size: .9rem; }
  .menu summary svg { width: 19px; height: 19px; }
  .menu nav { display: grid; gap: 4px; position: absolute; z-index: 2; top: calc(100% + 7px); right: 0; width: min(350px, 100%); padding: 10px; background: #221a29; border: 1px solid #6f5287; border-radius: 13px; box-shadow: 0 10px 32px #0d0911b3; }
  .menu nav .button { margin-top: 5px; }
  .hero { min-height: 385px; }
  .hero h1 { max-width: 480px; }
  .footer-grid { grid-template-columns: 1fr; gap: 21px; }
}

@media (max-width: 720px) {
  .header-inner { min-height: 60px; }
  .reading { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .reading aside { position: static; }
  .toc { max-height: none; }
  .toc ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-hero { grid-template-columns: minmax(0, 1fr); }
  .guide-side { display: grid; grid-template-columns: minmax(0, 1fr); }
  .story { grid-template-columns: minmax(0, 1fr); gap: 15px; }
}

@media (max-width: 650px) {
  :root { scroll-padding-top: 73px; }
  .wrap { width: calc(100% - 30px); }
  .hero { margin-top: 14px; min-height: 0; display: flex; flex-direction: column; align-items: stretch; border-radius: 19px; }
  .hero-art { position: relative; width: 100%; height: auto; aspect-ratio: 1.75; }
  .hero-art img { object-position: center 23%; }
  .hero-art::after { position: absolute; inset: auto 0 0; height: 52%; background: linear-gradient(0deg, #171527 2%, #1715278a 46%, transparent); }
  .hero-copy { width: 100%; margin-top: -25px; padding: 0 18px 22px; }
  .hero h1 { font-size: clamp(2.26rem, 9vw, 3.45rem); }
  .hero-lead { margin-top: 12px; }
  .actions { margin-top: 18px; }
  .button { min-height: 44px; padding-inline: 12px; font-size: .85rem; }
  .feature-section { margin-top: 25px; }
  .library-heading { align-items: stretch; flex-direction: column; }
  .library-search { min-width: 0; }
  .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .feature-illustrated { display: grid; grid-template-columns: minmax(98px, .82fr) minmax(0, 1.18fr); }
  .feature-art { height: 100%; min-height: 110px; }
  .feature-copy { padding: 13px 11px 13px 12px; }
  .feature-copy p { font-size: .92rem; }
  .feature-illustrated .tile-icon { display: none; }
  .feature-copy h3 { font-size: 1.13rem; }
  .toc ul { grid-template-columns: minmax(0, 1fr); }
  .guide-hero { border-radius: 17px; padding: 20px; }
  .guide-copy h1 { font-size: clamp(2.2rem, 8.9vw, 3.25rem); }
  .process { padding: 16px; }
  .article { font-size: 1rem; }
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .button:hover, .feature:hover, .feature:hover img { transform: none; }
}
