/* ==========================================================================
   Display Glasses Simulator — Documentation pages
   Shared light-theme styles, matched to the simulator sidebar palette.
   ========================================================================== */

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

:root {
  --accent:       #0866ff;
  --accent-hover: #0756d6;
  --accent-light: #e7f3ff;
  --text-1:       #1c1e21;
  --text-2:       #454b54;
  --text-3:       #8a8d91;
  --border:       #dde1e7;
  --border-light: #eaecf0;
  --paper:        #ffffff;
  --body-bg:      #f0f2f5;
  --code-bg:      #f5f6f8;
  --radius:       12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', system-ui, sans-serif;
  background: var(--body-bg);
  color: var(--text-1);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

/* ── Top bar ───────────────────────────────────────────────────── */
.doc-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  height: 56px;
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border-light);
}
.doc-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
  letter-spacing: -0.2px;
  color: var(--text-1);
  text-decoration: none;
}
.doc-brand-eyebrow {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.doc-brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.3px;
}
.doc-brand-title em { font-style: normal; font-weight: 500; color: var(--text-3); }
.doc-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.12s;
}
.doc-back:hover { background: var(--accent-light); }
.doc-back svg { flex-shrink: 0; }

/* ── Layout ────────────────────────────────────────────────────── */
.doc-layout {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.doc-wrap {
  flex: 1;
  min-width: 0;
  max-width: 760px;
  padding: 56px 40px 96px;
  margin: 0 auto;
}

/* ── Side index ────────────────────────────────────────────────── */
.doc-index {
  position: sticky;
  top: 56px;
  flex-shrink: 0;
  width: 380px;
  min-width: 380px;
  align-self: flex-start;
  height: calc(100vh - 56px);
  overflow-y: auto;
  background: var(--paper);
  border-right: 1px solid var(--border);
  padding: 26px 0 40px;
}
.doc-index-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
  padding-left: 24px;
}
.doc-index > ul { padding: 0; }
.doc-index ul {
  list-style: none;
  counter-reset: idx;
  border-top: 1px solid var(--border-light);
}
.doc-index-page { border-bottom: 1px solid var(--border-light); }
.doc-index-page > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 22px 15px 24px;
  font-size: 15px;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.14s, background 0.14s, border-color 0.14s;
}
.doc-index-page > a::before { content: none; }
.doc-index-page > a::after {
  content: "→";
  margin-left: auto;
  font-size: 14px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.14s, transform 0.14s;
}
.doc-index-page > a:hover {
  color: var(--text-1);
  background: var(--code-bg);
}
.doc-index-page > a:hover::after { opacity: 1; transform: none; }
.doc-index-page.current > a {
  color: var(--accent);
  background: var(--accent-light);
  border-left-color: var(--accent);
}
.doc-index-page.current > a::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 1;
  transform: none;
}

.doc-index .doc-index-sub {
  list-style: none;
  border: none;
  counter-reset: none;
  padding: 2px 0 10px 0;
}
.doc-index .doc-index-sub a {
  display: block;
  padding: 6px 22px 6px 58px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.14s;
}
.doc-index .doc-index-sub a:hover { color: var(--text-1); }
.doc-index .doc-index-sub a.current { color: var(--accent); font-weight: 600; }

.doc-section {
  margin-top: 48px;
  scroll-margin-top: 76px;
}
.doc-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.doc-wrap h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 18px;
}
.doc-lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-2);
  margin-bottom: 8px;
}

.doc-section {
  margin-top: 48px;
}
.doc-section h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.doc-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 26px 0 8px;
}
.doc-section p { margin-bottom: 14px; color: var(--text-2); }
.doc-section p strong { color: var(--text-1); font-weight: 600; }
.doc-section a { color: var(--accent); text-decoration: none; font-weight: 500; }
.doc-section a:hover { text-decoration: underline; }

.doc-section ul { list-style: none; margin: 0 0 14px; }
.doc-section li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: var(--text-2);
}
.doc-section li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.doc-section li strong { color: var(--text-1); font-weight: 600; }

code {
  font-family: 'SF Mono', ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--code-bg);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 1.5px 6px;
  color: #b5145c;
}
pre {
  background: #1c1e21;
  color: #e7eaee;
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 4px 0 18px;
  font-size: 13px;
  line-height: 1.6;
}
pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Spec cards */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 6px 0 14px;
}
.spec {
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.spec .spec-val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-1);
}
.spec .spec-key {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 4px;
}

/* Figures */
.doc-figure { margin: 20px 0 22px; }
.doc-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--paper);
}
.doc-figure img.fig-narrow {
  max-width: 320px;
  margin-inline: auto;
  border: 0;
  border-radius: 16px;
}
.fig-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 240px;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: repeating-linear-gradient(135deg, #fafbfc, #fafbfc 10px, #f4f6f8 10px, #f4f6f8 20px);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
}
.doc-figure figcaption a { color: var(--accent); text-decoration: none; }
.doc-figure figcaption a:hover { text-decoration: underline; }
.doc-figure figcaption {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-3);
}

/* Callout */
.doc-note {
  background: #fff8e6;
  border: 1px solid #f2e3b3;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13.5px;
  color: #6b5a1e;
  margin: 8px 0 14px;
}
.doc-note strong { color: #5a4c19; }

/* Next-step link cards */
.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.doc-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.doc-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(8,102,255,0.10);
  transform: translateY(-2px);
}
.doc-card .card-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 14px;
}
.doc-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.doc-card p { font-size: 13px; color: var(--text-3); margin: 0; }
.doc-card .card-go {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* Pager (bottom of sub-pages) */
.doc-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 22px;
  border-top: 1px solid var(--border-light);
}
.doc-pager a {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.doc-pager a:hover { text-decoration: underline; }
.doc-pager .pg-hint { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; }

@media (max-width: 1080px) {
  .doc-index { width: 300px; min-width: 300px; }
}
@media (max-width: 900px) {
  .doc-layout { display: block; }
  .doc-wrap { max-width: 720px; margin: 0 auto; padding: 32px 18px 72px; }

  /* The sidebar index becomes a horizontal scroller above the content —
     without it there is no way to reach the other pages on a phone. */
  .doc-index {
    width: auto;
    min-width: 0;
    z-index: 9;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: var(--paper);
    padding: 0;
    overflow: visible;
  }
  .doc-index-title { display: none; }
  .doc-index ul {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 12px;
    -webkit-overflow-scrolling: touch;
  }
  .doc-index ul::-webkit-scrollbar { display: none; }
  .doc-index-page { flex: 0 0 auto; border-bottom: 0; }
  .doc-index-page > a {
    padding: 13px 12px;
    font-size: 13.5px;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }
  .doc-index-page > a::after { display: none; }
  .doc-index-page.current > a {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: none;
  }
}
@media (max-width: 640px) {
  .doc-wrap { padding: 26px 16px 64px; }
  .doc-wrap h1 { font-size: 27px; }
  .doc-cards, .doc-pager { grid-template-columns: 1fr; }
  .doc-topbar { height: auto; min-height: 52px; padding: 9px 16px; }
  .doc-brand-title { font-size: 14px; }
  .doc-back { white-space: nowrap; padding: 6px 4px 6px 8px; }
  .doc-index { top: 0; }
  .contact-line a { font-size: 19px; }
}

/* ── Example list ──────────────────────────────────────────────── */
.ex-list { list-style: none; display: grid; gap: 12px; margin-top: 18px; }
.ex-item {
  background: var(--paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.doc-section .ex-item::before { content: none; }
.doc-section .ex-item {
  padding: 16px;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.ex-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #14161a;
  border-radius: 8px;
  overflow: hidden;
}
.ex-thumb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.62);
}
.ex-thumb img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
.ex-body { padding: 2px 4px 4px 0; min-width: 0; }
.doc-section .ex-item:not(:has(.ex-thumb)) { grid-template-columns: minmax(0, 1fr); }
.ex-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 6px; }
.ex-head h3 { font-size: 16px; font-weight: 700; margin: 0; color: var(--text-1); }
.ex-open { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.ex-open:hover { text-decoration: underline; }
.ex-item p { font-size: 14px; color: var(--text-2); margin: 0; }
.ex-tests { margin-top: 8px !important; font-size: 12.5px !important; color: var(--text-3) !important; }
.ex-links { display: flex; gap: 18px; margin-top: 10px !important; }
.ex-links a { font-size: 13px; font-weight: 500; color: var(--accent); text-decoration: none; }
.ex-links a:hover { text-decoration: underline; }
.ex-tests span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-right: 6px;
}

/* ── Footer ────────────────────────────────────────────────────── */
.doc-footer {
  border-top: 1px solid var(--border);
  background: var(--paper);
  margin-top: 24px;
}
.doc-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 44px 40px 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 56px;
  align-items: start;
}
.foot-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}
.foot-lr {
  display: inline-block;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.1px;
  color: var(--text-1);
  text-decoration: none;
}
.foot-lr span { font-weight: 500; color: var(--text-3); font-size: 13px; letter-spacing: 0; }
.foot-lr:hover { color: var(--accent); }
.foot-tag {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-3);
  max-width: 56ch;
}
.foot-tag a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--border); }
.foot-tag a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.foot-links { list-style: none; display: grid; gap: 7px; }
.foot-links a {
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
}
.foot-links a:hover { color: var(--accent); }
.foot-legal p {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-3);
}
.foot-legal em { font-style: normal; color: inherit; }
.doc-footer-base {
  border-top: 1px solid var(--border-light);
}
.foot-copy {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 40px 30px;
  font-size: 11.5px;
  color: var(--text-3);
}
@media (max-width: 760px) {
  .doc-footer-inner { grid-template-columns: 1fr; gap: 26px; padding: 34px 18px 26px; }
  .foot-copy { padding: 14px 18px 26px; }
  .ex-head { flex-direction: column; gap: 4px; }
  .doc-section .ex-item, .doc-section .ex-item:has(.ex-thumb) { grid-template-columns: minmax(0, 1fr); }
  .ex-body { padding: 0 2px 2px; }
}


/* ── Resource lists ────────────────────────────────────────────── */
.res-list { list-style: none; display: grid; gap: 0; margin: 16px 0 8px; border-top: 1px solid var(--border-light); }
.doc-section .res-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 2px;
  margin: 0;
  border-bottom: 1px solid var(--border-light);
}
.doc-section .res-item::before { content: none; }
.res-item > a { font-size: 14.5px; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.res-item > a:hover { text-decoration: underline; }
.res-item > span { font-size: 13px; color: var(--text-3); text-align: right; }
@media (max-width: 640px) {
  .res-item { flex-direction: column; gap: 3px; }
  .res-item > span { text-align: left; }
}

.contact-line { margin-bottom: 18px !important; }
.contact-line a {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--accent);
  text-decoration: none;
}
.contact-line a:hover { text-decoration: underline; }

/* ── Do / avoid rule grid ──────────────────────────────────────── */
.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 20px 0 24px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}
.rule { background: var(--paper); padding: 18px 20px 20px; }
.rule p { font-size: 13.5px; line-height: 1.6; color: var(--text-3); margin: 0; }
.rule-do, .rule-dont {
  font-size: 14.5px !important;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 6px !important;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.rule-do { color: var(--text-1) !important; }
.rule-dont { color: var(--text-3) !important; }
.rule-do::before { content: "+"; color: var(--accent); font-weight: 800; }
.rule-dont::before { content: "\2013"; color: var(--text-3); font-weight: 800; }
@media (max-width: 640px) { .rule-grid { grid-template-columns: 1fr; } }
