:root {
  --ink: #0e0e0e;
  --ink-soft: #2c2c2c;
  --muted: #696969;
  --faint: #8b8d9f;

  --brand-navy: #021b42;
  --brand-blue: #004ffc;
  --brand-indigo: #1c0d90;
  --brand-purple: #7a5cf0;
  --brand-cyan: #2fb8d6;

  --paper: #f5f7ff;
  --surface: #ffffff;
  --line: #e9edf8;
  --line-soft: #f1f4fb;

  --code-bg: #f0f1fa;

  --serif: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --content-w: 42rem;
  --sidebar-w: 272px;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
textarea,
select {
  font-family: var(--sans);
}

a { color: inherit; }

img { max-width: 100%; display: block; }

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

/* ---------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 64px;
  padding: 0 20px;
  background: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-navy) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 24px rgba(2, 27, 66, 0.18);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.topbar__brand img {
  height: 26px;
  width: auto;
  /* filter: brightness(0) invert(1); */
}

.topbar__tag {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  padding-left: 15px;
  margin-left: 1px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  white-space: nowrap;
}

.topbar__spacer { flex: 1; }

.topbar__search {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.topbar__search input {
  width: 100%;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  padding: 0 12px 0 34px;
  font-size: 0.9rem;
  color: #ffffff;
}

.topbar__search input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.topbar__search input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.topbar__search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.topbar__home-link {
  font-size: 0.85rem;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
  padding: 7px 14px;
  border-radius: 999px;
}
.topbar__home-link:hover {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.topbar__menu-btn {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-radius: 7px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topbar__menu-btn svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------------
   Shell / layout
   --------------------------------------------------------------------- */

.shell {
  display: flex;
  align-items: flex-start;
  max-width: 1240px;
  margin: 0 auto;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 28px 14px 60px 20px;
  /* border-right: 1px solid var(--line); */
}

.sidebar__group { margin-bottom: 4px; }

.sidebar__cat {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 9px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}
.sidebar__cat:hover {
  color: var(--brand-navy);
  background: #e5edff;
  /* box-shadow: inset 3px 0 0 var(--brand-blue); */
}
.sidebar__cat.is-active { color: var(--brand-blue); background: #eaf1ff; }
.sidebar__cat.is-active:hover { background: #dce8ff; }

.sidebar__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--cat-color, var(--brand-blue));
}

.sidebar__cat-label { flex: 1; }

.sidebar__chevron {
  width: 13px;
  height: 13px;
  color: var(--faint);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.sidebar__group.is-open .sidebar__chevron { transform: rotate(90deg); }

.sidebar__items {
  list-style: none;
  margin: 2px 0 10px 0;
  padding: 2px 0 2px 25px;
  border-left: 1px solid var(--line);
  margin-left: 12px;
  display: none;
}
.sidebar__group.is-open .sidebar__items { display: block; }

.sidebar__items li { margin: 0; }

.sidebar__items a {
  display: block;
  text-decoration: none;
  font-size: 0.83rem;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 6px;
  line-height: 1.35;
  transition: color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}
.sidebar__items a:hover { color: var(--brand-navy); background: #e5edff; }
.sidebar__items a.is-current {
  color: var(--brand-blue);
  font-weight: 600;
  background: #eaf1ff;
  /* box-shadow: inset 2px 0 0 var(--brand-blue); */
}

.sidebar__empty {
  font-size: 0.82rem;
  color: var(--faint);
  padding: 10px 8px;
}

/* ---------------------------------------------------------------------
   Main content
   --------------------------------------------------------------------- */

.main { flex: 1; min-width: 0; padding: 0 24px; }

.content {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 44px 0 100px;
}

.crumbs {
  font-size: 0.82rem;
  color: var(--faint);
  margin-bottom: 18px;
}
.crumbs a { text-decoration: none; color: var(--faint); }
.crumbs a:hover { color: var(--indigo-dark); }

.page-kicker {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--violet);
  margin: 0 0 6px;
}

.page-title {
  font-family: var(--serif);
  font-size: 2.3rem;
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--brand-navy);
}

.page-intro {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 8px;
  max-width: 38rem;
}

.page-meta {
  font-size: 0.8rem;
  color: var(--faint);
  margin: 18px 0 0;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.section { margin-top: 52px; scroll-margin-top: 78px; }
.section:first-of-type { margin-top: 40px; }

.section h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
  color: var(--brand-navy);
  margin: 0 0 6px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.section:first-of-type h2 { border-top: none; padding-top: 0; }

.subsection { margin-top: 34px; scroll-margin-top: 78px; }
.subsection h3 {
  font-family: var(--serif);
  font-size: 1.24rem;
  color: var(--ink);
  margin: 0 0 10px;
}

.subsubsection { margin-top: 24px; scroll-margin-top: 78px; }
.subsubsection h4 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink-soft);
  margin: 0 0 8px;
}

.content p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.content ul, .content ol {
  margin: 0 0 16px;
  padding-left: 1.3em;
  color: var(--ink-soft);
  line-height: 1.7;
}
.content li { margin-bottom: 6px; }
.content li:last-child { margin-bottom: 0; }

.content ol { padding-left: 1.4em; }

.content strong { color: var(--ink); font-weight: 650; }

.section-lede {
  font-size: 1.02rem;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 4px;
}

/* Boxed callouts ------------------------------------------------------ */

.box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 18px 0;
  background: var(--surface);
}

.box__label {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: var(--indigo-dark);
  margin: 0 0 8px;
}

.box--used-for { border-left: 3px solid var(--cyan); }
.box--used-for .box__label { color: #1c8fa6; }

.box--cases { border-left: 3px solid var(--violet); }
.box--cases .box__label { color: var(--violet); }

.box--note {
  border-left: 3px solid var(--indigo);
  background: #f4f5ff;
  padding: 13px 16px;
}
.box--note p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.box--note .box__label { margin: 0 0 3px; }

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

/* Screenshot placeholders --------------------------------------------- */

figure.shot {
  margin: 22px 0;
}

.shot__frame {
  width: 100%;
  max-width: 620px;
  aspect-ratio: var(--ar, 16 / 9);
  border-radius: 10px;
  border: 1.5px dashed #c3c7e6;
  background:
    linear-gradient(135deg, #fafaff 0%, #f2f3fc 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 20px;
  position: relative;
}

.shot__frame::before, .shot__frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1.5px solid #c3c7e6;
}
.shot__frame::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.shot__frame::after { bottom: 8px; right: 8px; border-left: none; border-top: none; }

.shot__icon {
  width: 30px;
  height: 30px;
  color: #a9adce;
}

.shot__tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #9498b3;
}

.shot__dims {
  font-size: 0.7rem;
  color: #b3b6d1;
  font-family: var(--sans);
}

figure.shot figcaption {
  margin-top: 9px;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 620px;
  line-height: 1.5;
}
figure.shot figcaption strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* Page navigation footer ---------------------------------------------- */

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.page-nav a {
  flex: 1;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  display: block;
  max-width: 48%;
}
.page-nav a:hover { border-color: var(--violet); }
.page-nav__dir {
  font-size: 0.74rem;
  color: var(--faint);
  margin-bottom: 3px;
}
.page-nav__title {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
}
.page-nav a.next { text-align: right; margin-left: auto; }

.helpful {
  margin-top: 40px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.helpful p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }
.helpful__btns { display: flex; gap: 8px; }
.helpful__btns button {
  font-family: var(--sans);
  font-size: 0.85rem;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 7px;
  padding: 7px 14px;
  cursor: pointer;
  color: var(--ink-soft);
}
.helpful__btns button:hover { border-color: var(--violet); color: var(--indigo-dark); }
.helpful__btns button.is-picked {
  border-color: var(--indigo);
  color: var(--indigo-dark);
  background: #edeeff;
}

/* ---------------------------------------------------------------------
   Home / hub page
   --------------------------------------------------------------------- */

.hero {
  padding: 40px 24px 40px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background:
    radial-gradient(760px 320px at 50% -80px, rgba(179, 201, 255, 0.35) 0%, rgba(179, 201, 255, 0) 62%),
    linear-gradient(180deg, var(--brand-blue) 0%, var(--brand-navy) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero img.hero__logo { height: 40px; margin: 0 auto 22px; /* filter: brightness(0) invert(1); */ }

.hero h1 {
  font-family: var(--serif);
  font-size: 2.6rem;
  margin: 0 0 12px;
  color: #ffffff;
}

.hero p {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.82);
  max-width: 34rem;
  margin: 0 auto 26px;
  line-height: 1.6;
}

.hero__search {
  max-width: 460px;
  margin: 0 auto;
  position: relative;
}
.hero__search input {
  width: 100%;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0 16px 0 42px;
  font-size: 0.98rem;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.hero__search input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}
.hero__search input:focus {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.hero__search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.85);
}

.hub {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 90px;
}

.hub__title {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin: 0 0 20px;
  color: var(--brand-navy);
}

.hub__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 44px;
}

.hub__card {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 20px 18px;
  background: var(--surface);
  /* border-left: 3px solid var(--card-color, var(--indigo)); */
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.hub__card:hover { transform: translateY(-2px); border-color: var(--brand-blue); }

.hub__card h3 {
  font-family: var(--serif);
  font-size: 1.12rem;
  margin: 0 0 6px;
  color: var(--brand-navy);
}
.hub__card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 12px;
}
.hub__card span.count {
  font-size: 0.76rem;
  color: var(--faint);
}

.hub__contact {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 26px 28px;
  background: linear-gradient(120deg, #f4f5ff 0%, #eefaff 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.hub__contact h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  margin: 0 0 5px;
  color: var(--brand-navy);
}
.hub__contact p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.hub__contact a.btn {
  text-decoration: none;
  background: var(--brand-blue);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  white-space: nowrap;
  box-shadow: 0 10px 18px rgba(0, 79, 252, 0.18);
}
.hub__contact a.btn:hover { background: var(--brand-navy); }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 24px 50px;
  text-align: center;
}
.site-footer p {
  font-size: 0.8rem;
  color: var(--faint);
  margin: 0;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--indigo-dark); }

/* ---------------------------------------------------------------------
   Search overlay (results dropdown)
   --------------------------------------------------------------------- */

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(23, 27, 51, 0.12);
  max-height: 360px;
  overflow-y: auto;
  display: none;
  z-index: 50;
}
.search-results.is-open { display: block; }

.search-results a {
  display: block;
  text-decoration: none;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--paper); }
.search-results .sr-cat {
  font-size: 0.7rem;
  color: var(--violet);
  margin-bottom: 2px;
}
.search-results .sr-title { font-size: 0.88rem; color: var(--ink); }
.search-results .sr-empty {
  padding: 16px;
  font-size: 0.85rem;
  color: var(--faint);
  text-align: center;
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */

@media (max-width: 980px) {
  .hub__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .topbar__tag { display: none; }
  .topbar__menu-btn { display: flex; }
  .topbar__home-link { display: none; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    height: calc(100vh - 64px);
    width: 84vw;
    max-width: 320px;
    background: var(--surface);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 39;
    box-shadow: 12px 0 30px rgba(23,27,51,0.08);
  }
  .sidebar.is-open { transform: translateX(0); }

  .scrim {
    display: none;
    position: fixed;
    inset: 64px 0 0 0;
    background: rgba(23,27,51,0.25);
    z-index: 38;
  }
  .scrim.is-open { display: block; }

  .main { padding: 0 18px; }
  .page-title { font-size: 1.85rem; }
  .hero h1 { font-size: 2rem; }
  .hub__grid { grid-template-columns: 1fr; }
  .page-nav { flex-direction: column; }
  .page-nav a { max-width: 100%; }
}

@media (max-width: 520px) {
  .content { padding-top: 30px; }
  .hero { padding: 44px 18px 32px; }
}

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

@media print {
  .topbar, .sidebar, .scrim, .page-nav, .helpful { display: none; }
  .main { padding: 0; }
}
