/* ===================================================================
   Looga User Guide — styles
   -------------------------------------------------------------------
   BRAND COLORS: edit the values below to match your Figma "Colors" frame.
   The two confirmed brand hexes from the app CSS are kept (--red, --orange,
   --cyan). The others are close approximations from the app UI — open your
   Figma Colors frame, copy each hex, and paste it here.
   =================================================================== */
:root {
  --purple:      #6C5CE7;   /* PRIMARY — confirm against Figma */
  --purple-dark: #534bcf;
  --purple-soft: #efeefe;

  --teal:   #14C2B2;        /* Read Arabic green-teal */
  --green:  #2BC48A;        /* success */
  --blue:   #2F9BF5;        /* Library / info */
  --cyan:   #03C4EB;        /* confirmed brand cyan */
  --pink:   #FF4D7D;
  --red:    #FF4742;        /* confirmed brand red */
  --orange: #F37341;        /* confirmed brand orange */
  --yellow: #FFC83D;

  /* surfaces (light) */
  --bg:        #f6f7fb;
  --surface:   #ffffff;
  --ink:       #1f2235;
  --ink-soft:  #5a6072;
  --line:      #e7e9f2;
  --shadow:    0 6px 24px rgba(31,34,53,.08);
  --shadow-sm: 0 2px 8px rgba(31,34,53,.06);
  --radius:    16px;
  --maxw:      1180px;
}

[data-theme="dark"] {
  --bg:        #14161f;
  --surface:   #1d2030;
  --ink:       #eef0f8;
  --ink-soft:  #a7adc4;
  --line:      #2c3043;
  --purple-soft:#262446;
  --shadow:    0 6px 24px rgba(0,0,0,.35);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { line-height: 1.25; }

/* ---------- reading progress ---------- */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  z-index: 1000; transition: width .12s ease-out;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 18px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { height: 38px; width: auto; display: block; }
.brand-name { font-size: 19px; letter-spacing: -.3px; }
.brand-sub { color: var(--purple); }

.search-wrap { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.search-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 15px; opacity: .6; pointer-events: none;
}
#search {
  width: 100%; padding: 11px 38px 11px 40px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink); font-size: 15px; font-family: inherit;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
#search:focus { border-color: var(--purple); box-shadow: 0 0 0 4px var(--purple-soft); }
#search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; font-size: 22px; line-height: 1;
  color: var(--ink-soft); cursor: pointer; padding: 4px 8px;
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; z-index: 70;
  max-height: 60vh; overflow-y: auto;
}
.search-results a {
  display: block; padding: 11px 16px; color: var(--ink); border-bottom: 1px solid var(--line);
}
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.active { background: var(--purple-soft); text-decoration: none; }
.search-results .sr-title { font-weight: 800; }
.search-results .sr-sum { font-size: 13px; color: var(--ink-soft); }
.search-results mark { background: var(--yellow); color: #1f2235; border-radius: 3px; padding: 0 2px; }
.search-results .sr-empty { padding: 16px; color: var(--ink-soft); }

.topbar-actions { display: flex; align-items: center; gap: 6px; }
.home-link {
  display: inline-flex; align-items: center; height: 40px; padding: 0 14px;
  border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--purple); font-weight: 800; font-size: 14px;
  white-space: nowrap; transition: background .15s, border-color .15s;
}
.home-link:hover { border-color: var(--purple); background: var(--purple-soft); text-decoration: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink); font-size: 18px; cursor: pointer;
  display: grid; place-items: center; transition: background .15s, border-color .15s;
}
.icon-btn:hover { border-color: var(--purple); }
.menu-only { display: none; }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(900px 360px at 12% -20%, rgba(108,92,231,.20), transparent 60%),
    radial-gradient(800px 360px at 100% -10%, rgba(3,196,235,.18), transparent 55%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 44px 18px 38px; text-align: center; }
.hero h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 8px; letter-spacing: -.6px; }
.hero-sub { color: var(--ink-soft); font-size: 17px; margin: 0 auto 22px; max-width: 620px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink);
  padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-sm); transition: transform .12s, border-color .15s, color .15s;
}
.chip:hover { transform: translateY(-2px); border-color: var(--purple); text-decoration: none; }
.chip-primary { background: var(--purple); color: #fff; border-color: var(--purple); }
.chip-primary:hover { background: var(--purple-dark); }

/* ---------- layout ---------- */
.layout {
  max-width: var(--maxw); margin: 0 auto; padding: 28px 18px 60px;
  display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start;
}

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky; top: 84px; align-self: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 14px; max-height: calc(100vh - 110px); overflow-y: auto;
}
.sidebar-head { font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); padding: 4px 8px 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  color: var(--ink); font-weight: 600; font-size: 14.5px;
}
.toc a:hover { background: var(--purple-soft); text-decoration: none; }
.toc a.active { background: var(--purple); color: #fff; }
.toc a.active .toc-ico { filter: none; }
.toc-ico { font-size: 16px; width: 22px; text-align: center; flex: none; }
.toc-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- articles ---------- */
.content { min-width: 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 26px 28px; margin-bottom: 22px; scroll-margin-top: 90px;
}
.card.hidden { display: none; }
.card.flash { animation: flash .9s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px var(--purple-soft); } 100% { box-shadow: var(--shadow-sm); } }

.section-head { display: flex; gap: 14px; align-items: flex-start; position: relative; padding-bottom: 14px; border-bottom: 1px dashed var(--line); margin-bottom: 18px; }
.section-ico {
  font-size: 22px; width: 46px; height: 46px; flex: none; display: grid; place-items: center;
  background: var(--purple-soft); border-radius: 14px;
}
.section-num { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--purple); }
.section-head h2 { margin: 2px 0 4px; font-size: 22px; letter-spacing: -.4px; }
.section-summary { margin: 0; color: var(--ink-soft); font-size: 15px; }
.anchor { margin-left: auto; color: var(--line); font-weight: 900; font-size: 18px; }
.anchor:hover { color: var(--purple); text-decoration: none; }

.section-body h3 { margin: 22px 0 8px; font-size: 17px; }
.section-body p { margin: 10px 0; }

.pill { display: inline-block; background: var(--green); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; vertical-align: middle; text-transform: uppercase; letter-spacing: .04em; }

/* feature lists */
.feature-list { list-style: none; margin: 10px 0; padding: 0; }
.feature-list li { position: relative; padding: 4px 0 4px 24px; }
.feature-list li::before { content: "•"; position: absolute; left: 6px; color: var(--purple); font-weight: 900; }
.feature-list .feature-list li::before { color: var(--cyan); }

/* step list — microdosing numbered steps */
.step-list { list-style: none; counter-reset: step; margin: 14px 0; padding: 0; }
.step-list > li {
  counter-increment: step; position: relative; padding: 10px 0 10px 46px; margin: 4px 0;
  border-bottom: 1px solid var(--line);
}
.step-list > li:last-child { border-bottom: 0; }
.step-list > li::before {
  content: counter(step); position: absolute; left: 0; top: 8px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--purple); color: #fff; font-weight: 800; font-size: 14px;
  display: grid; place-items: center; box-shadow: 0 3px 8px rgba(108,92,231,.35);
}
.step-list .feature-list { margin-top: 6px; }

/* callouts */
.callout { border-radius: 12px; padding: 13px 16px; margin: 14px 0; font-size: 15px; border-left: 5px solid; }
.callout.tip    { background: color-mix(in srgb, var(--green) 12%, var(--surface)); border-color: var(--green); }
.callout.note   { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); border-color: var(--blue); }
.callout.warn   { background: color-mix(in srgb, var(--orange) 14%, var(--surface)); border-color: var(--orange); }
.callout.advice { background: var(--purple-soft); border-color: var(--purple); }
/* fallback if color-mix unsupported */
@supports not (background: color-mix(in srgb, red, blue)) {
  .callout.tip { background: #eafaf2; } .callout.note { background: #eaf4fe; } .callout.warn { background: #fdeee6; }
}

/* accordions */
.acc { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; overflow: hidden; background: var(--bg); }
.acc > summary {
  cursor: pointer; padding: 13px 16px; font-weight: 800; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: "+"; font-size: 20px; color: var(--purple); font-weight: 700; }
.acc[open] > summary::after { content: "–"; }
.acc[open] > summary { background: var(--purple-soft); }
.acc > *:not(summary) { padding: 0 16px; }
.acc > *:not(summary):last-child { padding-bottom: 14px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 14px 0; }
table.compare { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 460px; }
table.compare th, table.compare td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.compare thead th { background: var(--purple); color: #fff; }
table.compare thead th:first-child { border-top-left-radius: 10px; }
table.compare thead th:last-child { border-top-right-radius: 10px; }
table.compare tbody tr:nth-child(even) { background: var(--bg); }

/* figures / screenshots */
figure.shot { margin: 18px 0; }
figure.shot img { max-width: 100%; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); display: block; }
figure.shot figcaption { font-size: 13px; color: var(--ink-soft); margin-top: 8px; text-align: center; }
.img-placeholder {
  border: 2px dashed var(--line); border-radius: 14px; padding: 30px 18px; text-align: center;
  color: var(--ink-soft); background: var(--bg); font-size: 14px;
}
.img-placeholder strong { color: var(--ink); display: block; margin-bottom: 4px; }
.img-placeholder code { background: var(--purple-soft); color: var(--purple); padding: 2px 7px; border-radius: 6px; font-size: 13px; }

.signoff-wrap { text-align: center; margin-top: 24px; }
.signoff-mascot {
  display: inline-block; height: 120px; width: auto;
  animation: signoff-bob 2.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .signoff-mascot { animation: none; } }
@keyframes signoff-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.signoff { font-size: 18px; font-weight: 800; text-align: center; margin-top: 8px; }

/* footer */
.page-foot { color: var(--ink-soft); font-size: 14px; text-align: center; padding: 18px; }
.page-foot .updated { font-size: 12px; opacity: .8; }
.no-results { text-align: center; color: var(--ink-soft); padding: 40px; font-size: 17px; }

/* back to top */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 50;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--purple); color: #fff; font-size: 22px; box-shadow: var(--shadow);
  transition: transform .15s, opacity .2s;
}
.to-top:hover { transform: translateY(-3px); background: var(--purple-dark); }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .menu-only { display: grid; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 290px; max-height: none; z-index: 90;
    border-radius: 0; transform: translateX(-105%); transition: transform .25s ease;
    padding-top: 18px;
  }
  .sidebar.open { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 80; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; }
  .topbar-inner { flex-wrap: wrap; }
}
@media (max-width: 540px) {
  .card { padding: 20px 18px; }
  .hero-inner { padding: 30px 16px 26px; }
  .section-head h2 { font-size: 19px; }
}
