/* The guides at docs.warde.app: warde.app's palette and type, set for long reading.
   Dark follows warde.app; light is offered for people who read with their system in light. */
:root {
  --bg:        #0A0A0A;
  --surface:   #101114;
  --surface-2: #16171B;
  --line:      rgba(242,242,243,.09);
  --line-2:    rgba(242,242,243,.16);
  --text:      #F2F2F3;
  --text-2:    rgba(242,242,243,.70);
  --text-3:    #8F9095;
  --teal:      #2FBFAE;
  --teal-soft: rgba(47,191,174,.12);
  --teal-line: rgba(47,191,174,.32);
  --ochre:     #E0B252;
  --ochre-bg:  rgba(224,178,82,.10);
  --code-bg:   #15161A;
  --topbar:    rgba(10,10,10,.80);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #FBFBFA;
    --surface:   #FFFFFF;
    --surface-2: #F3F4F3;
    --line:      rgba(10,10,10,.09);
    --line-2:    rgba(10,10,10,.16);
    --text:      #15161A;
    --text-2:    rgba(21,22,26,.74);
    --text-3:    #5F6166;
    --teal:      #0B7A6E;
    --teal-soft: rgba(11,122,110,.08);
    --teal-line: rgba(11,122,110,.30);
    --ochre:     #8A5A00;
    --ochre-bg:  rgba(224,178,82,.14);
    --code-bg:   #F1F2F1;
    --topbar:    rgba(251,251,250,.86);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #FBFBFA; --surface: #FFFFFF; --surface-2: #F3F4F3; --line: rgba(10,10,10,.09);
  --line-2: rgba(10,10,10,.16); --text: #15161A; --text-2: rgba(21,22,26,.74); --text-3: #5F6166;
  --teal: #0B7A6E; --teal-soft: rgba(11,122,110,.08); --teal-line: rgba(11,122,110,.30);
  --ochre: #8A5A00; --ochre-bg: rgba(224,178,82,.14); --code-bg: #F1F2F1; --topbar: rgba(251,251,250,.86);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 16.5px; font-weight: 400; line-height: 1.7; -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 4px; }
code { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: .86em; background: var(--code-bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; line-height: 1.55; }
pre code { background: none; border: 0; padding: 0; font-size: .84rem; overflow-wrap: normal; }

.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 12px; }

.topbar { position: sticky; top: 0; z-index: 40; background: var(--topbar); backdrop-filter: saturate(150%) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 24px; height: 60px; max-width: 1440px; margin: 0 auto; padding: 0 24px; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.mark-tiles { display: grid; grid-template-columns: repeat(3, 6px); grid-auto-rows: 6px; gap: 2px; }
.mark-tiles i { display: block; background: var(--line-2); border-radius: 1px; }
.mark-tiles i.on { background: var(--teal); }
.mark-name { font-size: 1.1rem; font-weight: 500; letter-spacing: -0.02em; }
.mark-sub { font-family: "IBM Plex Mono", monospace; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; }
.toplink { font-size: .88rem; color: var(--text-2); text-decoration: none; }
.toplink:hover { color: var(--text); }
.toplink-out::after { content: " \2197"; }
.menu-btn { display: none; font: inherit; font-size: .88rem; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 12px; cursor: pointer; }

.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr) 220px; gap: 48px; max-width: 1440px; margin: 0 auto; padding: 0 24px; }
.sidebar, .toc { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; padding: 28px 0 40px; }
.nav-sec { margin-bottom: 22px; }
.nav-title { font-family: "IBM Plex Mono", monospace; font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .11em; color: var(--text-3); margin: 0 0 8px; }
.sidebar ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.sidebar a, .toc a { display: block; padding: 4px 10px; margin-left: -10px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: .9rem; line-height: 1.45; }
.sidebar a:hover, .toc a:hover { color: var(--text); background: var(--surface-2); }
.sidebar a[aria-current="page"] { color: var(--teal); background: var(--teal-soft); font-weight: 500; }
.toc a { font-size: .84rem; }

.content { padding: 36px 0 64px; max-width: 76ch; min-width: 0; }
.crumb { font-family: "IBM Plex Mono", monospace; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--teal); margin: 0 0 10px; }
.content h1 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); line-height: 1.15; font-weight: 500; letter-spacing: -0.022em; margin: 0 0 14px; text-wrap: balance; }
.lede { font-size: 1.14rem; color: var(--text-2); margin: 0 0 30px; line-height: 1.6; }
.content h2 { font-size: 1.45rem; font-weight: 500; letter-spacing: -0.015em; margin: 48px 0 12px; padding-top: 20px; border-top: 1px solid var(--line); line-height: 1.3; position: relative; }
.content h3 { font-size: 1.1rem; font-weight: 600; margin: 32px 0 8px; position: relative; }
.content h4 { font-size: 1rem; font-weight: 600; margin: 24px 0 6px; position: relative; }
.anchor { position: absolute; left: -1.1em; color: var(--text-3); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }
.content p { margin: 0 0 14px; }
.content ul, .content ol { margin: 0 0 16px; padding-left: 1.4em; }
.content li { margin: 4px 0; }
.content li > ul, .content li > ol { margin: 4px 0; }
.content strong { font-weight: 600; }

.table-wrap { overflow-x: auto; margin: 6px 0 20px; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-weight: 600; font-size: .82rem; color: var(--text-2); }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.table-wrap td { min-width: 11ch; }

.shot { margin: 10px 0 24px; }
.shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.shot figcaption { margin-top: 8px; font-size: .84rem; color: var(--text-3); }

.callout { margin: 8px 0 20px; padding: 12px 16px; border: 1px solid var(--line-2); border-left: 3px solid var(--text-3); border-radius: 8px; background: var(--surface); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout-label { font-family: "IBM Plex Mono", monospace; font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 4px !important; }
.callout-note, .callout-tip { border-left-color: var(--teal); background: var(--teal-soft); }
.callout-note .callout-label, .callout-tip .callout-label { color: var(--teal); }
.callout-warning { border-left-color: var(--ochre); background: var(--ochre-bg); }
.callout-warning .callout-label { color: var(--ochre); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 56px 0 0; }
.pager a { display: block; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 10px; text-decoration: none; color: var(--text); font-weight: 500; }
.pager a:hover { border-color: var(--teal-line); background: var(--teal-soft); }
.pager span { display: block; font-size: .76rem; font-weight: 400; color: var(--text-3); }
.pager-next { text-align: right; }

.foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--text-3); }
.foot p { margin: 0 0 8px; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; }
  .toc { display: none; }
}
@media (max-width: 820px) {
  .topbar-in { padding: 0 16px; gap: 12px; }
  .toplink { display: none; }
  .menu-btn { display: inline-block; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .sidebar { display: none; position: static; max-height: none; padding: 16px 0 0; border-bottom: 1px solid var(--line); }
  .sidebar.open { display: block; }
  .content { padding-top: 24px; }
  .anchor { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
}
