/* =======================================================================
   LexisOS Help Center — shared stylesheet
   Brand tokens track LexisOS Brand & Design System v2.0 (Sapphire palette).
   ======================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Brand palette — Sapphire (matches landingpage tailwind + web app). */
  --brand-50:  #E8EEFC;
  --brand-100: #D2DEF9;
  --brand-200: #AFC5F5;
  --brand-300: #8AAAF0;
  --brand-400: #4A76F0;
  --brand-500: #1E4FD8;  /* Sapphire — primary */
  --brand-600: #1B49C7;
  --brand-700: #1841B2;
  --brand-800: #16389C;

  /* Honey — the single reserved accent (mark + wordmark dot). Legacy
     `--ember-*` names retained so any old class in help.js still resolves. */
  --honey-500: #E9A23B;
  --ember-50:  #FEF7EC;
  --ember-100: #FDEBCE;
  --ember-400: #EFAD44;
  --ember-500: #E9A23B;
  --ember-600: #C7811E;

  --magenta-500: #EC4899;

  /* Ink neutral scale — LexisOS v2.0 anchors. */
  --ink-900: #171A21;  /* ink */
  --ink-800: #2A2C36;
  --ink-700: #43464F;
  --ink-600: #5B5F6B;  /* slate */
  --ink-500: #7B7F8C;
  --ink-400: #9AA0AD;
  --ink-300: #C9CBD3;
  --ink-200: #E3E5EC;  /* line */
  --ink-100: #F1F2F6;  /* cloud */
  --ink-50:  #FAFAFC;  /* paper */

  --bg:      #FFFFFF;
  --bg-soft: #FAFAFC;

  /* v2.0 gradient: 135°, Sapphire bright → deep. */
  --gradient-brand: linear-gradient(135deg, #2A62E8 0%, #16389C 100%);

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(23, 26, 33, 0.04);
  --shadow:    0 4px 16px rgba(23, 26, 33, 0.06);
  --shadow-lg: 0 20px 60px rgba(30, 79, 216, 0.12);

  --content-max: 70ch;
  --header-h:    64px;
}

/* ----- reset & base ----- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-900);
  background: var(--bg);
}

@supports (font-variation-settings: normal) {
  html { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse 1200px 800px at top right, rgba(245, 243, 255, 0.45) 0%, transparent 50%),
    radial-gradient(ellipse 1000px 700px at bottom left, rgba(255, 247, 237, 0.4) 0%, transparent 50%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}

::selection { background: var(--brand-600); color: white; }

/* ----- header bar ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ink-100);
}

.site-header__inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.wordmark__leading { color: var(--ink-900); }
.wordmark__accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.wordmark__suffix {
  margin-left: 8px;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-500);
  letter-spacing: 0;
}

.site-header__nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.site-header__nav a {
  font-size: 14px;
  color: var(--ink-600);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.site-header__nav a:hover { color: var(--brand-700); }

.site-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--gradient-brand);
  color: white !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.site-header__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.25);
}

/* ----- layout containers ----- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.container--narrow {
  max-width: 880px;
}

/* ----- hub (index) ----- */
.hub-hero {
  text-align: center;
  padding: 80px 24px 56px;
  max-width: 880px;
  margin: 0 auto;
}

.hub-hero__eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hub-hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  color: var(--ink-900);
}

.hub-hero h1 .accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hub-hero p {
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-600);
  max-width: 620px;
  margin: 0 auto;
}

.hub-search {
  max-width: 560px;
  margin: 36px auto 0;
  position: relative;
}

.hub-search input {
  width: 100%;
  padding: 18px 24px 18px 56px;
  font-size: 17px;
  font-family: inherit;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: white;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  color: var(--ink-900);
}
.hub-search input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12), var(--shadow);
}

.hub-search__icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--ink-400);
  pointer-events: none;
}

.hub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 64px auto 0;
}

.hub-card {
  display: flex;
  flex-direction: column;
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  background: white;
  border: 1px solid var(--ink-100);
  text-decoration: none;
  color: var(--ink-900);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  position: relative;
  overflow: hidden;
}

.hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity 0.25s;
}

.hub-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-200);
}
.hub-card:hover::before { opacity: 1; }

.hub-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-50);
  color: var(--brand-700);
  margin-bottom: 20px;
}

.hub-card h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink-900);
}

.hub-card p {
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-600);
  margin: 0 0 24px;
  flex: 1;
}

.hub-card__cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-700);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hub-card__cta::after {
  content: '→';
  transition: transform 0.18s;
}
.hub-card:hover .hub-card__cta::after { transform: translateX(4px); }

.hub-footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--ink-500);
  font-size: 14px;
}
.hub-footer a { color: var(--brand-700); text-decoration: none; }
.hub-footer a:hover { text-decoration: underline; }

/* ----- guide layout (sidebar + content) ----- */
.guide-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 96px;
}

.guide-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  padding-right: 8px;
}

.guide-sidebar__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin: 0 0 12px;
  padding-left: 12px;
}

.guide-sidebar ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}

.guide-sidebar li {
  counter-increment: toc;
}

.guide-sidebar a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--ink-600);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  margin-bottom: 2px;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
  line-height: 1.45;
}

.guide-sidebar a:hover {
  color: var(--brand-700);
  background: var(--brand-50);
}

.guide-sidebar a[data-active='true'] {
  color: var(--brand-700);
  background: var(--brand-50);
  border-left-color: var(--brand-600);
  font-weight: 600;
}

/* ----- prose styling ----- */
.prose {
  max-width: var(--content-max);
  color: var(--ink-800);
}

.prose h1 {
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 16px;
}

.prose > .lede {
  font-size: 19px;
  color: var(--ink-600);
  line-height: 1.6;
  margin: 0 0 32px;
  font-weight: 400;
}

.prose h2 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--ink-900);
  margin: 64px 0 16px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.prose h2::before {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--gradient-brand);
  border-radius: 999px;
  margin-bottom: 14px;
}

.prose h3 {
  font-size: 19px;
  line-height: 1.35;
  font-weight: 650;
  color: var(--ink-900);
  margin: 36px 0 12px;
  letter-spacing: -0.01em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.prose p {
  margin: 0 0 18px;
}

.prose ul, .prose ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 8px;
}

.prose li::marker { color: var(--brand-500); }

.prose a {
  color: var(--brand-700);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s;
}

.prose a:hover {
  border-bottom-color: var(--brand-500);
}

.prose code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--ink-50);
  color: var(--brand-700);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--ink-100);
}

.prose pre {
  background: var(--ink-900);
  color: var(--ink-100);
  padding: 18px 22px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0 0 22px;
  font-size: 14px;
}

.prose pre code {
  background: transparent;
  color: inherit;
  border: none;
  padding: 0;
  font-size: inherit;
}

.prose strong { font-weight: 650; color: var(--ink-900); }
.prose em { font-style: italic; }

.prose blockquote {
  margin: 0 0 22px;
  padding: 16px 22px;
  border-left: 3px solid var(--brand-500);
  background: var(--brand-50);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-700);
  font-style: normal;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose hr {
  border: 0;
  border-top: 1px solid var(--ink-100);
  margin: 56px 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 16px;
}
.prose th, .prose td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-100);
}
.prose th {
  font-weight: 600;
  color: var(--ink-900);
  background: var(--ink-50);
}

/* ----- helpful widget ----- */
.helpful {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 8px;
  padding: 14px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--ink-600);
}

.helpful__label { font-weight: 500; }

.helpful button {
  border: 1px solid var(--ink-200);
  background: white;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-700);
  transition: all 0.18s;
  font-family: inherit;
}
.helpful button:hover {
  border-color: var(--brand-400);
  color: var(--brand-700);
  background: var(--brand-50);
}
.helpful button[data-state='active'] {
  border-color: var(--brand-600);
  background: var(--brand-600);
  color: white;
}

.helpful__thanks {
  margin-left: auto;
  color: var(--brand-700);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s;
}
.helpful__thanks[data-visible='true'] { opacity: 1; }

/* ----- search & filter bar (how-to / faq) ----- */
.page-hero {
  text-align: center;
  padding: 56px 24px 32px;
  max-width: 880px;
  margin: 0 auto;
}

.page-hero h1 {
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink-900);
}

.page-hero h1 .accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.page-hero p {
  font-size: 19px;
  color: var(--ink-600);
  line-height: 1.55;
  margin: 0 auto;
  max-width: 620px;
}

.search-input {
  position: relative;
  max-width: 600px;
  margin: 32px auto 24px;
}

.search-input input {
  width: 100%;
  padding: 16px 22px 16px 52px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--ink-200);
  border-radius: 999px;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
  color: var(--ink-900);
}
.search-input input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.search-input__icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-400);
  pointer-events: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 880px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.chip {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--ink-200);
  color: var(--ink-700);
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
}
.chip:hover {
  border-color: var(--brand-400);
  color: var(--brand-700);
}
.chip[data-active='true'] {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: white;
}

/* ----- collapsible cards (details) ----- */
.cards {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: white;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.card[open] {
  border-color: var(--brand-200);
  box-shadow: var(--shadow);
}

.card > summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink-900);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  line-height: 1.4;
}

.card > summary::-webkit-details-marker { display: none; }

.card > summary::after {
  content: '';
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%237c3aed' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.25s;
  margin-top: 2px;
}

.card[open] > summary::after { transform: rotate(180deg); }

.card__body {
  padding: 0 24px 22px;
  color: var(--ink-700);
  line-height: 1.65;
  font-size: 16px;
}

.card__body p { margin: 0 0 14px; }
.card__body p:last-child { margin-bottom: 0; }

.card__body ol, .card__body ul {
  margin: 0 0 14px;
  padding-left: 22px;
}
.card__body li { margin-bottom: 6px; }
.card__body li::marker { color: var(--brand-500); font-weight: 600; }

.card__body code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--ink-50);
  color: var(--brand-700);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--ink-100);
}

.card__body strong { font-weight: 650; color: var(--ink-900); }
.card__body a { color: var(--brand-700); text-decoration: none; border-bottom: 1px solid transparent; }
.card__body a:hover { border-bottom-color: var(--brand-500); }

.faq-section {
  max-width: 880px;
  margin: 0 auto 48px;
  padding: 0 24px;
}

.faq-section__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin: 56px 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink-100);
}

.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-500);
  font-size: 16px;
  display: none;
}
.no-results[data-visible='true'] { display: block; }

/* ----- mobile sidebar toggle ----- */
.sidebar-toggle {
  display: none;
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
  background: white;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 16px;
  align-items: center;
  justify-content: space-between;
}

.sidebar-toggle::after {
  content: '';
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.25s;
}

.sidebar-toggle[data-open='true']::after { transform: rotate(180deg); }

/* ----- responsive ----- */
@media (max-width: 1024px) {
  .guide-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 40px;
  }
}

@media (max-width: 768px) {
  html { font-size: 16px; }

  .container { padding: 32px 20px 64px; }

  .site-header__inner { padding: 0 16px; }
  .site-header__nav { gap: 14px; }
  .site-header__nav a:not(.site-header__cta) { display: none; }

  .hub-hero { padding: 48px 16px 32px; }
  .hub-cards { margin-top: 40px; gap: 16px; padding: 0 4px; }

  .guide-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 24px 16px 56px;
  }

  .sidebar-toggle { display: flex; }

  .guide-sidebar {
    position: static;
    max-height: none;
    overflow: hidden;
    padding: 0 0 16px;
    max-height: 0;
    transition: max-height 0.3s ease;
  }

  .guide-sidebar[data-open='true'] {
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 24px;
    padding: 8px 0 20px;
  }

  .guide-sidebar__title { padding-left: 8px; }

  .prose h2 { margin-top: 48px; font-size: 24px; }
  .prose h3 { font-size: 18px; }

  .page-hero { padding: 36px 16px 24px; }
  .chips { padding: 0 16px; }
  .cards { padding: 0 16px; }

  .card > summary { padding: 16px 18px; font-size: 16px; }
  .card__body { padding: 0 18px 18px; font-size: 15px; }
}

/* ----- reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ----- focus visible ----- */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 4px;
}
