:root {
  --bg: #ffffff;
  --sidebar: #f7f7f5;
  --text: #37352f;
  --text-2: #5f5e5a;
  --text-3: #787774;
  --border: rgba(55, 53, 47, 0.09);
  --border-strong: rgba(55, 53, 47, 0.16);
  --hover: rgba(55, 53, 47, 0.06);
  --hover-strong: rgba(55, 53, 47, 0.1);
  --blue: #2383e2;
  --callout: #f1f1ef;
  --tag: #e3e2e0;
  --tag-text: #32302c;
  --code: rgba(135, 131, 120, 0.15);
  --inline-code: #eb5757;
  --card-shadow: 0 0 0 1px rgba(15, 15, 15, 0.1), 0 3px 8px rgba(15, 15, 15, 0.06);
  --green: #448361;
  --sidebar-w: 240px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #191919;
  --sidebar: #202020;
  --text: rgba(255, 255, 255, 0.9);
  --text-2: rgba(255, 255, 255, 0.64);
  --text-3: rgba(255, 255, 255, 0.5);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.14);
  --hover: rgba(255, 255, 255, 0.055);
  --hover-strong: rgba(255, 255, 255, 0.09);
  --blue: #529cca;
  --callout: rgba(255, 255, 255, 0.055);
  --tag: #454441;
  --tag-text: #e8e8e6;
  --code: rgba(255, 255, 255, 0.08);
  --inline-code: #ff7369;
  --card-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 3px 10px rgba(0, 0, 0, 0.45);
  --green: #4dab7a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
button, input { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: inherit; }

::selection { background: rgba(35, 131, 226, 0.28); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--blue);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  z-index: 80;
}

.skip:focus { top: 12px; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  background: var(--sidebar);
  padding: 10px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.workspace {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 2px 8px;
  margin-bottom: 8px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.workspace:hover { background: var(--hover); }

.workspace-mark {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #37352f;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.03em;
  flex: none;
}

[data-theme="dark"] .workspace-mark { background: #e8e8e6; color: #191919; }

.nav-label {
  margin: 14px 8px 4px;
  font-size: 12px;
  color: var(--text-3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  color: var(--text);
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.nav-item span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item:hover { background: var(--hover); }
.nav-item.is-active { background: var(--hover-strong); }
.nav-child { padding-left: 32px; }
.nav-emoji { width: 18px; flex: none; text-align: center; font-size: 15px; }

.sidebar-foot { margin-top: auto; padding-top: 12px; }

.page { flex: 1; min-width: 0; background: var(--bg); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 45px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  color: var(--text-3);
}

.crumbs a {
  color: var(--text-3);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
}

.crumbs a:hover { background: var(--hover); color: var(--text); }

.crumbs .here {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }

.brand-link,
.top-links a {
  font-size: 14px;
  text-decoration: none;
  color: var(--text-2);
  padding: 4px 8px;
  border-radius: 4px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-weight: 600;
}
.brand-mark { display: block; flex: none; }
.brand-dot { fill: var(--blue); }
.top-links { display: flex; align-items: center; }
.brand-link:hover,
.top-links a:hover { background: var(--hover); color: var(--text); }

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: grid; }
[data-theme="dark"] .theme-toggle .icon-sun { display: grid; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.announce {
  display: block;
  position: relative;
  overflow: hidden;
  margin: 18px 0 8px;
  background: #000;
  border: 1px solid #262626;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  isolation: isolate;
}

.announce:hover,
.announce:focus-visible { border-color: #404040; }

.announce-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding: 2rem 1.75rem;
  background: radial-gradient(120% 140% at 100% 50%, #1a1a1a 0%, #000 60%);
}

.announce-logo {
  flex-shrink: 0;
  width: 210px;
  height: auto;
  opacity: 0.9;
  transition: opacity 0.3s, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.announce:hover .announce-logo,
.announce:focus-visible .announce-logo {
  opacity: 1;
  transform: translateX(-4px);
}

.announce-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a3a3a3;
}

.announce-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.announce-title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}

.announce-sub {
  margin: 0;
  max-width: 34ch;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #a3a3a3;
}

.announce-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.announce:hover .announce-drawer,
.announce:focus-visible .announce-drawer { grid-template-rows: 1fr; }

.announce-drawer-inner { overflow: hidden; }

.announce-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.75rem;
  border-top: 1px solid #262626;
  background: #0a0a0a;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.announce-cta svg { transition: transform 0.3s; }
.announce:hover .announce-cta svg { transform: translate(2px, -2px); }

@media (max-width: 600px) {
  .announce-body { flex-direction: column-reverse; align-items: flex-start; }
  .announce-logo { width: 160px; }
}

@media (hover: none) {
  .announce-drawer { grid-template-rows: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .announce-logo,
  .announce-drawer,
  .announce-cta svg,
  .dot-emoji,
  .plot-pop { transition: none; }
}

.icon-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-2);
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}

.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { display: block; }

.scrim { display: none; }

.doc {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 36px 48px 96px;
}

.page-icon { font-size: 78px; line-height: 1; margin: 8px 0 8px; }

.page-title {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-sub {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 16px;
}

.props { margin: 18px 0 8px; }

.prop {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 8px;
  min-height: 32px;
  align-items: center;
  font-size: 14px;
}

.prop-key { color: var(--text-2); }

.prop-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.45;
}

.status { display: inline-flex; align-items: center; gap: 8px; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 3px;
  background: var(--tag);
  color: var(--tag-text);
  font-size: 12px;
  line-height: 1;
}

.block-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 1.6em 0 6px;
  scroll-margin-top: 60px;
}

.lede {
  color: var(--text-2);
  font-size: 15px;
  max-width: 62ch;
  margin-bottom: 14px;
}

.doc > p + p { margin-top: 10px; }

.entry {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.entry:last-child { border-bottom: 1px solid var(--border); }

.entry h3 { font-size: 16px; font-weight: 600; }
.entry-meta { display: block; margin-top: 2px; color: var(--text-3); font-size: 13px; }
.entry p { margin-top: 8px; font-size: 15px; line-height: 1.6; }
.entry .tags { margin-top: 10px; }

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 8px 0;
  padding: 16px;
  background: var(--callout);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
}

a.callout:hover { background: var(--hover-strong); }

.callout-icon { font-size: 22px; line-height: 1.3; flex: none; }
.callout p { font-size: 15px; line-height: 1.55; }
.callout p + p { margin-top: 4px; }
.callout-go { color: var(--blue); font-size: 14px; }

.callout-logo {
  width: 148px;
  height: auto;
  flex: none;
  align-self: center;
  background: #111;
  border-radius: 3px;
  padding: 7px 8px;
  object-fit: contain;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { background: var(--hover); }

.btn-blue {
  background: var(--blue);
  border-color: transparent;
  color: #fff;
}

.btn-blue:hover { filter: brightness(1.08); background: var(--blue); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.map {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(260px, 0.95fr);
  gap: 28px 36px;
  align-items: start;
  margin-top: 8px;
}

.plot-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    ". top ."
    "left plot right"
    ". bottom .";
  align-items: center;
  gap: 8px 10px;
}

.axis-label {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}

.axis-top { grid-area: top; justify-self: center; }
.axis-bottom { grid-area: bottom; justify-self: center; }
.axis-left { grid-area: left; }
.axis-right { grid-area: right; }

.plot {
  grid-area: plot;
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  overflow: visible;
}

.plot svg { width: 100%; height: 100%; display: block; }

.axis { stroke: var(--border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }

.dot {
  position: absolute;
  z-index: 1;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.dot:hover,
.dot:focus-visible,
.dot.is-active { z-index: 4; }

.dot-emoji {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 26px;
  line-height: 1;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dot:hover .dot-emoji,
.dot:focus-visible .dot-emoji,
.dot.is-active .dot-emoji { transform: scale(1.12); }

.plot-pop {
  --shift: 0px;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 5;
  width: max-content;
  max-width: 160px;
  padding: 6px 8px;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  pointer-events: none;
  transform-origin: center bottom;
  transform: translate(calc(-50% + var(--shift)), 8px) scale(0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1), visibility 180ms;
}

.plot-pop::after {
  content: "";
  position: absolute;
  left: calc(50% - var(--shift));
  bottom: -4px;
  width: 8px;
  height: 8px;
  background: var(--bg);
  transform: translateX(-50%) rotate(45deg);
}

.dot:hover .plot-pop,
.dot:focus-visible .plot-pop,
.dot.is-active .plot-pop {
  opacity: 1;
  visibility: visible;
  transform: translate(calc(-50% + var(--shift)), 0) scale(1);
}

.plot-pop strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.tree-emoji {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  margin-right: 4px;
}

.tree {
  list-style: none;
  margin: 6px 0 0;
  padding: 2px 0 2px 18px;
  border-left: 1px solid var(--border-strong);
}

.tree-item { position: relative; }

.tree-hit {
  display: block;
  padding: 7px 8px 8px;
  border-radius: 4px;
}

.tree-item[data-id] .tree-hit { cursor: pointer; }

.tree-hit:hover,
.tree-item.is-active .tree-hit { background: var(--hover); }

.tree-item::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 16px;
  width: 12px;
  height: 1px;
  background: var(--border-strong);
}

.tree-item::after {
  content: "";
  position: absolute;
  left: -22px;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1.5px var(--text);
}

.tree-item.is-active::after {
  background: var(--blue);
  box-shadow: 0 0 0 1.5px var(--blue);
}

.tree-name { display: block; font-size: 14px; font-weight: 600; }
.tree-desc { display: block; margin-top: 2px; color: var(--text-2); font-size: 13px; line-height: 1.4; }

.tree-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 12px;
}

.tree-meta a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

.colophon {
  margin-top: 48px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 16px;
  margin-top: 12px;
  align-items: start;
}

.shot-wide { grid-column: 1 / -1; }

.shot {
  display: block;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.shot:hover img { border-color: var(--border-strong); }

.shot img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--callout);
}

.shot h3 { margin: 8px 4px 0; font-size: 15px; font-weight: 600; }
.shot p { margin: 2px 4px 6px; color: var(--text-2); font-size: 13px; }

.steps { list-style: none; padding: 0; }
.steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 4px 8px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.steps li:last-child { border-bottom: 1px solid var(--border); }
.steps .num { color: var(--text-3); font-size: 15px; padding-top: 1px; }
.steps h3 { font-size: 16px; font-weight: 600; }
.steps p { margin-top: 4px; color: var(--text-2); font-size: 15px; }

.post-list { margin-top: 8px; }

.post-item {
  display: block;
  padding: 12px 8px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  border-radius: 4px;
}

.post-item:last-child { border-bottom: 1px solid var(--border); }
.post-item:hover { background: var(--hover); }
.post-item h2 { font-size: 16px; font-weight: 600; }
.post-item time { display: block; margin-top: 2px; color: var(--text-3); font-size: 13px; }
.post-item p { margin-top: 4px; color: var(--text-2); font-size: 14px; }

.notion-md { margin-top: 8px; font-size: 16px; line-height: 1.65; }
.notion-md h1 { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 8px; }
.notion-md h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 1.4em 0 4px; line-height: 1.3; }
.notion-md h3 { font-size: 18px; font-weight: 600; margin: 1.1em 0 4px; }
.notion-md p { margin: 2px 0; padding: 3px 0; }
.notion-md ul, .notion-md ol { margin: 4px 0 8px; padding-left: 1.4em; }
.notion-md li { padding: 2px 0; }
.notion-md a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.notion-md code {
  font-family: var(--mono);
  font-size: 85%;
  background: var(--code);
  color: var(--inline-code);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}
.notion-md pre {
  background: var(--code);
  padding: 14px 16px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 8px 0 12px;
}
.notion-md pre code { color: var(--text); background: none; padding: 0; font-size: 13px; }
.notion-md blockquote {
  margin: 8px 0;
  padding-left: 14px;
  border-left: 3px solid var(--text);
}

.oss { margin-top: 28px; }
.oss-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.oss-counts { margin-top: 10px; color: var(--text-2); font-size: 13px; }
.oss-issues {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.oss-issues li { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.oss-issues li:last-child { border-bottom: 0; }
.oss-issues a { color: var(--blue); }
.issue-meta { margin-top: 2px; color: var(--text-3); font-size: 12px; }

.muted { color: var(--text-2); }

@media (min-width: 861px) {
  html.sidebar-collapsed .sidebar {
    width: 0;
    flex-basis: 0;
    padding: 0;
    overflow: hidden;
    visibility: hidden;
  }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    z-index: 40;
    left: 0;
    top: 0;
    width: min(300px, 86vw);
    flex: none;
    transform: translateX(-105%);
    transition: transform 160ms ease;
  }

  .sidebar.is-open { transform: none; }

  .scrim.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 35;
  }

  .doc { padding: 20px 20px 72px; }
  .page-title, .notion-md h1 { font-size: 32px; }
  .page-icon { font-size: 64px; }
  .map, .gallery { grid-template-columns: 1fr; }
  .prop { grid-template-columns: 1fr; gap: 0; padding: 6px 0; align-items: start; }
  .callout { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sidebar { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar { background: var(--bg); backdrop-filter: none; }
}
