*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #111;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

/* --- hero (landing) --- */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #0a0a0a;
}

.hero video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.25rem;
  color: #fff;
}

.hero h1 {
  font-size: clamp(2rem, 9vw, 4.5rem);
  font-weight: 300;
  letter-spacing: 0.25em;
  padding-left: 0.25em;
  text-transform: lowercase;
  margin-bottom: 0.6rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
  line-height: 1.15;
}

.hero .subtitle {
  font-size: clamp(0.8rem, 2.4vw, 0.95rem);
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: lowercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 2.5rem;
  text-shadow: 0 1px 10px rgba(0,0,0,0.4);
}

.hero-link {
  display: inline-block;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: clamp(0.9rem, 2.2vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  padding: 0.15em 0 0.15em 0.15em;
  text-transform: lowercase;
  border-bottom: 1px solid rgba(255,255,255,0.35);
  margin-bottom: 3rem;
  transition: color 0.2s, border-color 0.2s;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

.hero-link:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.8);
}

.hero-sections {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  color: #fff;
  margin-top: 0.5rem;
}

.hero-sections li {
  font-size: clamp(0.82rem, 2.2vw, 0.95rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  opacity: 0.75;
  text-shadow: 0 1px 10px rgba(0,0,0,0.4);
}

/* --- docs layout: sidebar + article --- */
.docs {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 3rem 2rem 3rem 2rem;
  border-right: 1px solid #eee;
}

.sidebar .brand {
  display: inline-block;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  padding-left: 0.25em;
  text-transform: lowercase;
  color: #111;
  text-decoration: none;
  margin-bottom: 2.5rem;
}

.sidebar .brand .tag {
  display: inline-block;
  margin-left: 0.4em;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  color: #888;
}

.sidebar h4 {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #888;
  margin: 1.75rem 0 0.6rem;
}

.sidebar h4:first-of-type {
  margin-top: 0;
}

.sidebar ul {
  list-style: none;
}

.sidebar ul li {
  margin-bottom: 0.35rem;
}

.sidebar ul li a {
  display: block;
  font-size: 0.92rem;
  color: #555;
  text-decoration: none;
  padding: 0.2rem 0;
  transition: color 0.15s;
}

.sidebar ul li a:hover {
  color: #111;
}

.sidebar ul li a.active {
  color: #111;
  font-weight: 500;
}

.article {
  max-width: 680px;
  margin: 0;
  padding: 5rem 3rem 6rem;
}

.article .back {
  display: none;
}

.article h2 {
  font-size: clamp(1.5rem, 4.5vw, 1.75rem);
  font-weight: 600;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.article .meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 2.5rem;
}

.article p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.7;
}

.article h3 {
  font-size: clamp(1.05rem, 3vw, 1.15rem);
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
}

.article ul,
.article ol {
  margin: 0 0 1.25rem 1.5rem;
  font-size: 1rem;
  line-height: 1.7;
}

.article ul li,
.article ol li {
  margin-bottom: 0.5rem;
}

.article code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: #f4f4f4;
  padding: 0.15em 0.35em;
  border-radius: 3px;
  word-break: break-word;
}

.article pre {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.88rem;
  line-height: 1.6;
}

.article pre code {
  background: transparent;
  padding: 0;
  word-break: normal;
  white-space: pre;
}

.article a {
  color: #111;
  border-bottom: 1px solid #111;
  text-decoration: none;
}

.article a:hover {
  border-color: #888;
}

.callout {
  background: #fafafa;
  border-left: 2px solid #111;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.callout p {
  margin-bottom: 0.5rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

.next-prev {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.next-prev a {
  color: #555;
  text-decoration: none;
  border: none;
}

.next-prev a:hover {
  color: #111;
}

.next-prev .label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 0.25rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.5rem;
  font-size: 0.92rem;
}

table th,
table td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #eee;
}

table th {
  font-weight: 600;
  color: #111;
}

table td {
  color: #333;
}

/* --- drawer scaffolding (hidden by default) --- */
.nav-toggle,
.nav-open-btn,
.nav-backdrop {
  display: none;
}

/* --- responsive: drawer below 900px --- */
@media (max-width: 900px) {
  .docs {
    display: block;
    max-width: none;
  }

  .nav-open-btn {
    display: flex;
    position: fixed;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 20;
    width: 42px;
    height: 42px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  }

  .nav-open-btn span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: #111;
    border-radius: 1px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(85vw, 320px);
    height: 100vh;
    height: 100svh;
    background: #fff;
    z-index: 15;
    transition: left 0.22s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2rem 1.75rem 3rem;
    border-right: 1px solid #eee;
    box-shadow: 0 0 20px rgba(0,0,0,0);
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100svh;
    background: rgba(0,0,0,0);
    z-index: 10;
    pointer-events: none;
    transition: background 0.22s ease;
  }

  .nav-toggle:checked ~ .sidebar {
    left: 0;
    box-shadow: 0 0 30px rgba(0,0,0,0.15);
  }

  .nav-toggle:checked ~ .nav-backdrop {
    background: rgba(0,0,0,0.35);
    pointer-events: auto;
  }

  .sidebar ul li a {
    font-size: 1rem;
    padding: 0.5rem 0;
  }

  .sidebar h4 {
    font-size: 0.72rem;
  }

  .article {
    max-width: none;
    padding: 4.5rem 1.5rem 4rem;
  }

  .article h2 {
    margin-top: 0;
  }

  /* horizontally scrollable tables */
  .article table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .article {
    padding: 4rem 1.15rem 3rem;
  }

  .article pre {
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
  }

  .callout {
    padding: 0.85rem 1rem;
  }
}
