/* ============================================================
   LOO · ຄູ່ມືການໃຊ້ງານ (User Manual)
   Brand: loolao.com — Lao Operational OS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* light theme */
  --bg:        #F5F6FA;
  --surface:   #FFFFFF;
  --surface-2: #FBFBFD;
  --ink:       #151B2B;
  --ink-2:     #5A6478;
  --ink-3:     #8C94A8;
  --line:      #E7E9F0;
  --line-2:    #EEF0F5;

  --brand:     #5468E8;
  --brand-ink: #3F52D6;
  --brand-soft:#EAEDFD;
  --brand-grad: linear-gradient(135deg, #6E82F2, #5566E6);
  --logo-grad: linear-gradient(140deg, #6E82F2 0%, #5468E8 55%, #3F52D6 100%);

  --green:     #14A06A;
  --green-soft:#E1F4EA;
  --amber:     #E8A317;
  --amber-soft:#FBF0D6;
  --danger:    #E0533B;
  --danger-soft:#FBE7E1;

  --sans: 'Noto Sans Lao', system-ui, sans-serif;
  --display: 'Space Grotesk', 'Noto Sans Lao', sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --sh-sm: 0 1px 2px rgba(20,27,43,.04), 0 2px 8px rgba(20,27,43,.05);
  --sh-md: 0 6px 18px rgba(20,27,43,.07), 0 14px 40px rgba(20,27,43,.06);
  --sh-lg: 0 24px 60px rgba(20,27,43,.18);

  --side-w: 286px;
  --top-h: 66px;
}

[data-theme="dark"] {
  --bg:        #080C18;
  --surface:   #0F1526;
  --surface-2: #131A2E;
  --ink:       #EBEEF7;
  --ink-2:     #9AA3BC;
  --ink-3:     #6A7390;
  --line:      #1E2740;
  --line-2:    #182135;
  --brand-soft:#19213E;
  --green-soft:#10301F;
  --amber-soft:#33260C;
  --danger-soft:#34170F;
  --sh-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.25);
  --sh-md: 0 6px 18px rgba(0,0,0,.35), 0 14px 40px rgba(0,0,0,.3);
  --sh-lg: 0 24px 60px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }

/* ===== smooth page transitions =====
   Works for the SPA router (same-document) AND for real navigations
   on file:// via cross-document view transitions. Only the .main
   content area animates (fade + slide); topbar & sidebar stay put. */
@view-transition { navigation: auto; }
.main { view-transition-name: loo-main; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(loo-main) { animation: loo-out .18s ease both; }
  ::view-transition-new(loo-main) { animation: loo-in .32s cubic-bezier(.22,.61,.36,1) both; }
}
@keyframes loo-out { to   { opacity: 0; transform: translateY(-6px); } }
@keyframes loo-in  { from { opacity: 0; transform: translateY(14px); } }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}
h1,h2,h3,h4 { margin: 0; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* =================== TOP BAR =================== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); z-index: 80;
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hamb {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
  flex: none;
}
.hamb svg { width: 20px; height: 20px; }
.brand { display: flex; align-items: center; gap: 11px; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; background: var(--logo-grad);
  display: grid; place-items: center; position: relative; flex: none;
  box-shadow: 0 4px 12px rgba(84,104,232,.35), inset 0 -3px 0 rgba(0,0,0,.16);
}
.logo span { color: #fff; font-family: var(--display); font-weight: 700; font-size: 19px; }
.logo::after {
  content: ""; position: absolute; top: 8px; right: 8px; width: 5px; height: 5px;
  border-radius: 50%; border: 1.5px solid rgba(255,255,255,.85);
}
.brand .name { display: flex; flex-direction: column; line-height: 1.1; }
.brand .name b { font-family: var(--display); font-size: 17px; letter-spacing: .04em; font-weight: 700; }
.brand .name small { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.toplink { font-size: 14px; color: var(--ink-2); padding: 7px 13px; border-radius: 999px; }
.toplink:hover { background: var(--line-2); color: var(--ink); }
.theme-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.theme-btn svg { width: 19px; height: 19px; }
.theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .sun { display: block; }
[data-theme="dark"] .theme-btn .moon { display: none; }

/* =================== LAYOUT =================== */
.shell { display: flex; padding-top: var(--top-h); }

/* sidebar */
.sidebar {
  width: var(--side-w); flex: none; position: sticky; top: var(--top-h);
  height: calc(100vh - var(--top-h)); overflow-y: auto;
  border-right: 1px solid var(--line); padding: 26px 18px 60px;
  background: var(--surface);
}
.side-title {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); padding: 0 12px; margin-bottom: 12px;
}
.side-group { margin-bottom: 26px; }
.side-group > .gh {
  font-size: 13.5px; font-weight: 700; color: var(--ink); padding: 6px 12px; margin-bottom: 4px;
}
.side-link {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 10px;
  font-size: 14.5px; color: var(--ink-2); margin: 1px 0; transition: .14s;
}
.side-link .ix {
  flex: none; width: 22px; height: 22px; border-radius: 7px; background: var(--line-2);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-3);
  font-family: var(--display);
}
.side-link:hover { background: var(--line-2); color: var(--ink); }
.side-link.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.side-link.active .ix { background: var(--brand); color: #fff; }
.side-link.todo { opacity: .85; }

/* main */
.main { flex: 1; min-width: 0; display: flex; }
.content { flex: 1; min-width: 0; max-width: 820px; margin: 0 auto; padding: 44px 48px 100px; }

/* on this page rail */
.onpage {
  width: 218px; flex: none; position: sticky; top: var(--top-h); align-self: flex-start;
  height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 48px 22px;
  border-left: 1px solid var(--line);
}
.onpage .t { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.onpage a { display: block; font-size: 13.5px; color: var(--ink-2); padding: 5px 0 5px 12px; border-left: 2px solid var(--line); }
.onpage a:hover, .onpage a.active { color: var(--brand-ink); border-left-color: var(--brand); }

/* =================== CONTENT ELEMENTS =================== */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); margin-bottom: 18px; }
.breadcrumb b { color: var(--ink-2); font-weight: 600; }
.breadcrumb svg { width: 14px; height: 14px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
  color: var(--brand-ink); background: var(--brand-soft); padding: 6px 13px; border-radius: 999px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

.content h1 { font-size: clamp(30px, 4vw, 42px); margin: 18px 0 0; letter-spacing: -.025em; line-height: 1.12; }
.lead { font-size: 18.5px; color: var(--ink-2); margin-top: 18px; }

.content h2 {
  font-size: 25px; margin: 52px 0 0; letter-spacing: -.02em; scroll-margin-top: 90px;
  display: flex; align-items: center; gap: 12px;
}
.content h2 .hn {
  font-family: var(--display); font-size: 15px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; flex: none;
}
.content p.body { margin-top: 16px; color: var(--ink-2); font-size: 16.5px; }
.content p.body b, .content .body b { color: var(--ink); font-weight: 600; }
.content .mono { font-family: var(--display); font-weight: 600; background: var(--brand-soft); color: var(--brand-ink); padding: 1px 8px; border-radius: 7px; font-size: .94em; }

hr.div { border: 0; border-top: 1px solid var(--line); margin: 44px 0; }

/* steps (numbered, vertical) */
.steps { margin-top: 26px; display: flex; flex-direction: column; gap: 4px; }
.step {
  display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 8px 0 26px;
  position: relative;
}
.step:not(:last-child)::before {
  content: ""; position: absolute; left: 21px; top: 44px; bottom: 0; width: 2px; background: var(--line);
}
.step .sn {
  width: 44px; height: 44px; border-radius: 13px; background: var(--brand-grad); color: #fff;
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px;
  box-shadow: 0 5px 14px rgba(84,104,232,.32); z-index: 1;
}
.step .sc h3 { font-size: 19px; }
.step .sc p { color: var(--ink-2); margin-top: 6px; font-size: 16px; }

/* callouts */
.callout {
  display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--r-md); margin-top: 24px;
  font-size: 15.5px; line-height: 1.6; border: 1px solid transparent;
}
.callout .ic { flex: none; width: 24px; height: 24px; }
.callout .ic svg { width: 22px; height: 22px; }
.callout b { font-weight: 700; }
.callout > span > b:first-child { display: block; margin-bottom: 2px; }
.callout.info   { background: var(--brand-soft); color: var(--brand-ink); }
.callout.tip    { background: var(--green-soft); color: #0c7a4e; }
.callout.warn   { background: var(--amber-soft); color: #8a6410; }
[data-theme="dark"] .callout.tip { color: #4fd6a0; }
[data-theme="dark"] .callout.warn { color: #f0c04e; }
[data-theme="dark"] .callout.info { color: #9fb0ff; }

/* business chips */
.chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; font-weight: 500;
  box-shadow: var(--sh-sm);
}
.chip .e { font-size: 17px; line-height: 1; }

/* browser frame */
.browser {
  margin-top: 26px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--sh-md); background: var(--surface);
}
.browser .bar {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.browser .dots { display: flex; gap: 7px; }
.browser .dots i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.browser .dots i:nth-child(1){ background:#FF5F57; }
.browser .dots i:nth-child(2){ background:#FEBC2E; }
.browser .dots i:nth-child(3){ background:#28C840; }
.browser .url {
  flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 14px; font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 500;
}
.browser .url svg { width: 13px; height: 13px; color: var(--green); }
.browser .shot { display: flex; justify-content: center; background: #0a0e1a; }
.browser .shot img { width: 100%; max-width: 420px; }

.caption { text-align: center; font-size: 13.5px; color: var(--ink-3); margin-top: 10px; }

/* annotated buttons explainer */
.btn-explain { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.be-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; background: var(--surface); box-shadow: var(--sh-sm); }
.be-card .demo { margin-bottom: 14px; }
.demo-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px;
  font-weight: 600; font-size: 15px; font-family: var(--sans);
}
.demo-btn.primary { background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px rgba(84,104,232,.3); }
.demo-btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.be-card h4 { font-size: 16px; }
.be-card p { font-size: 14.5px; color: var(--ink-2); margin-top: 6px; }

/* next/prev nav */
.pager { display: flex; justify-content: flex-end; gap: 16px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager a {
  display: flex; flex-direction: column; gap: 3px; padding: 16px 22px; border: 1px solid var(--line);
  border-radius: var(--r-md); min-width: 220px; transition: .16s; background: var(--surface);
}
.pager a:hover { border-color: var(--brand); box-shadow: var(--sh-sm); }
.pager .lbl { font-size: 12.5px; color: var(--ink-3); }
.pager .ttl { font-size: 16px; font-weight: 600; color: var(--brand-ink); }
.pager a.next { text-align: right; }

/* annotated screenshots */
.figrow { display: flex; gap: 40px; align-items: flex-start; margin-top: 28px; flex-wrap: wrap; }
.device { width: 318px; flex: none; margin: 0 auto; }
.device .frame {
  border-radius: 40px; background: #0c0e16; padding: 9px; box-shadow: var(--sh-lg);
  position: relative; border: 1px solid #20242f;
}
.device .scr { border-radius: 32px; overflow: hidden; position: relative; background: #fff; }
.device img { width: 100%; display: block; }
.device .cap { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 12px; }

/* lighter screenshot frame (images already carry their own device edge) */
.shotframe {
  position: relative; border-radius: 24px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--sh-md); background: #0c0e16;
}
.shotframe img { width: 100%; display: block; }

/* wide modal screenshots — image full-width, legend below */
.figcol { margin-top: 28px; }
.figcol .shotframe { max-width: 720px; margin: 0 auto; }
.figcol .cap { text-align: center; font-size: 13px; color: var(--ink-3); margin-top: 12px; }
.figcol .legend { margin-top: 20px; max-width: 720px; margin-left: auto; margin-right: auto; }

.hl {
  position: absolute; border: 2.5px solid var(--brand); border-radius: 11px;
  background: color-mix(in srgb, var(--brand) 13%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
  animation: hlpulse 2.4s ease-in-out infinite;
}
@keyframes hlpulse {
  0%,100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--brand) 7%, transparent); }
}
.hl .pin {
  position: absolute; top: -14px; left: -14px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 14px; box-shadow: 0 3px 9px rgba(0,0,0,.35);
}
.hl.amber { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 16%, transparent); animation: none; }
.hl.amber .pin { background: var(--amber); }
/* left-rail pin — badge centred on the box's left edge, sits in the side margin
   so it never covers text. Use on tightly-stacked highlights (e.g. login form). */
.hl.lpin .pin { top: 50%; left: -15px; transform: translateY(-50%); }

/* legend list */
.legend { flex: 1; min-width: 270px; display: flex; flex-direction: column; gap: 0; }
.legend .li { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.legend .li:last-child { border-bottom: 0; }
.legend .li .n {
  flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft);
  color: var(--brand-ink); display: grid; place-items: center; font-family: var(--display);
  font-weight: 700; font-size: 14px;
}
.legend .li .n.amber { background: var(--amber-soft); color: #8a6410; }
.legend .li h4 { font-size: 16px; }
.legend .li p { font-size: 14.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.55; }

/* mobile */
.overlay { display: none; }
@media (max-width: 1100px) { .onpage { display: none; } }
@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: var(--top-h); left: 0; bottom: 0; z-index: 70;
    transform: translateX(-100%); transition: transform .25s; box-shadow: var(--sh-lg);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .overlay { display: block; position: fixed; inset: var(--top-h) 0 0; background: rgba(0,0,0,.4); z-index: 65; }
  .content { padding: 30px 22px 80px; }
  .btn-explain { grid-template-columns: 1fr; }
}
@media (min-width: 861px) { .hamb { display: none; } }
