/* ---------------------------------------------------------------
   pages.css - the shell shared by Docs, Blog and single posts.
   Same tokens as the landing page, so the theme toggle behaves
   identically across all four pages.
   --------------------------------------------------------------- */
:root {
  --ink: #111214;
  --red: #b81e26;
  --red-deep: #7e141a;
  --red-pale: #d9555c;
  --bone: #dad3c9;
  --nav-h: 64px;

  --bg: #f6f3ee;
  --surface: #fdfbf8;
  --surface-2: #ffffff;
  --text: #17181a;
  --text-2: #4a4c4b;
  --muted: #75736d;
  --line: rgba(23, 24, 26, 0.1);
  --line-hi: rgba(23, 24, 26, 0.2);
  --accent: #a81c24;
  --chrome: #efebe5;
  --band: #141517;
  --band-2: #1e2023;
  --on-band: #dad3c9;
  --band-dim: #918d86;
  --nav-shadow: 0 4px 20px rgba(23, 24, 26, 0.07);
  --shadow-md: 0 28px 70px rgba(23, 24, 26, 0.13);
}
:root[data-theme="dark"] {
  --bg: #23262b;
  --surface: #2b2f35;
  --surface-2: #33383f;
  --text: #dad3c9;
  --text-2: #b3aea5;
  --muted: #8e8b84;
  --line: rgba(218, 211, 201, 0.14);
  --line-hi: rgba(218, 211, 201, 0.26);
  --accent: #d9555c;
  --chrome: #3a3f47;
  --nav-shadow: 0 6px 26px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 28px 70px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: "Space Grotesk", sans-serif; margin: 0; }

/* ---------------- nav (same pill as the landing page) ---------------- */
.nav {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1280px, calc(100% - 32px));
  height: var(--nav-h);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 22px;
  background: var(--surface);
  border-radius: 999px;
  border: 1px solid var(--line);
  box-shadow: var(--nav-shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: "Space Grotesk";
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.16em;
}
.brand i {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #141517 url("images/logo/mini_logo.png") center / 88% no-repeat;
  display: inline-block;
  flex: none;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 15.5px;
  font-weight: 600;
}
.nav__links a,
.nav__links button {
  color: var(--text);
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: color 0.18s ease;
}
.nav__links a:hover,
.nav__links button:hover { color: var(--accent); }
.nav__links .has-menu::after {
  content: "";
  display: inline-block;
  margin-left: 7px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  transform: translateY(2px);
  transition: transform 0.22s ease;
}
.nav__links .has-menu[aria-expanded="true"]::after {
  transform: translateY(-1px) rotate(180deg);
}
.navmenu { position: relative; }
.navmenu__pop {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  min-width: 168px;
  transform: translate(-50%, -6px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--nav-shadow);
  padding: 7px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.3, 0.8, 0.3, 1);
  z-index: 90;
}
.navmenu__pop.on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.navmenu__pop a {
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 500;
  transition: background-color 0.16s ease;
}
.navmenu__pop a:hover { background: var(--chrome); }
.nav__right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.theme-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: none;
  cursor: pointer;
  color: var(--text);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.theme-btn svg {
  position: absolute;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  transition: transform 0.42s cubic-bezier(0.3, 0.8, 0.3, 1), opacity 0.26s ease;
}
.theme-btn .moon { transform: translateY(125%); opacity: 0; }
[data-theme="dark"] .theme-btn .sun { transform: translateY(-125%); opacity: 0; }
[data-theme="dark"] .theme-btn .moon { transform: none; opacity: 1; }
.pill-btn {
  color: #f2ece4;
  background: var(--red);
  border: 0;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: filter 0.2s ease;
}
.pill-btn:hover { filter: brightness(1.1); }
.icon-btn { background: none; border: 0; font-size: 16px; cursor: pointer; }

/* ---------------- burger + drawer ---------------- */
.burger {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 8px 7px;
  flex-direction: column;
  justify-content: space-between;
  flex: none;
}
.burger span { display: block; height: 2px; border-radius: 2px; background: var(--text); }
.drawer { position: fixed; inset: 0; z-index: 200; }
.drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(12, 15, 23, 0.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.32s ease;
}
.drawer.on .drawer__scrim { opacity: 1; }
.drawer__panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(88%, 380px);
  background: var(--surface);
  padding: 78px 26px 34px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.3, 0.85, 0.25, 1);
  box-shadow: -18px 0 50px rgba(12, 15, 23, 0.22);
}
.drawer.on .drawer__panel { transform: none; }
.drawer__x {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text);
}
.drawer__x svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.drawer__links { display: flex; flex-direction: column; gap: 2px; }
.drawer__links a {
  font-family: "Space Grotesk";
  font-size: 30px;
  font-weight: 600;
  padding: 11px 0;
}
.drawer__label {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 0 4px;
}
.drawer__links a.drawer__sub { font-size: 21px; font-weight: 500; color: var(--text-2); padding: 7px 0; }
.drawer__cta {
  margin-top: auto;
  text-align: center;
  padding: 15px;
  font-size: 15px;
  font-weight: 600;
  background: var(--red);
  color: #f2ece4;
  border-radius: 999px;
}

/* ---------------- shared page furniture ---------------- */
.page { padding-top: calc(var(--nav-h) + 44px); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.page-title {
  font-size: clamp(30px, 4.4vw, 44px);
  letter-spacing: -0.02em;
  margin: 26px 0 26px;
}
.foot {
  margin-top: 90px;
  border-top: 1px solid var(--line);
  padding: 30px 0 44px;
  color: var(--muted);
  font-size: 13px;
}
.foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.foot a:hover { color: var(--accent); }
.foot .sp { margin-left: auto; }

@media (max-width: 860px) {
  .burger { display: flex; }
  .nav__links { display: none; }
  .nav { gap: 10px; padding: 0 8px 0 14px; width: calc(100% - 20px); height: 56px; }
  .brand { font-size: 13px; letter-spacing: 0.1em; gap: 7px; }
  .brand i { width: 38px; height: 38px; }
  .nav__right { gap: 8px; }
  .pill-btn { white-space: nowrap; padding: 9px 14px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01ms !important; }
}
