/* kgenovz guides — shared dark-theme stylesheet (mobile-first) */

:root{
  --bg:#0a0a0c;
  --bg-2:#101015;
  --ink:#ECECEE;
  --ink-2:#A5A5AE;
  --ink-3:#6F6F78;
  --line:rgba(255,255,255,.08);
  --line-2:rgba(255,255,255,.14);
  --card:rgba(255,255,255,.025);
  --card-2:rgba(255,255,255,.045);
  --card-3:rgba(255,255,255,.07);
  --accent:#7B61FF;
  --accent-2:#9B85FF;
  --accent-soft:rgba(123,97,255,.14);
  --accent-glow:rgba(123,97,255,.35);
  --warn:#F5B97C;
  --warn-soft:rgba(245,185,124,.10);
  --pad-x:clamp(16px, 4vw, 40px);
  --radius:14px;
  --radius-sm:10px;
  --topbar-h:64px;
}

*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
html{scroll-behavior:smooth;scroll-padding-top:calc(var(--topbar-h) + 16px)}

body{
  background:var(--bg);
  color:var(--ink);
  font-family:"Inter Tight","Inter",ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;
  font-feature-settings:"ss01","cv11";
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
  line-height:1.55;
  min-height:100dvh;
  padding-left:env(safe-area-inset-left);
  padding-right:env(safe-area-inset-right);
}

a{color:var(--accent-2);text-decoration:none}
a:hover{color:var(--ink)}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
img{max-width:100%;display:block;height:auto}
::selection{background:var(--accent-soft);color:var(--ink)}

/* ── Background glow + grain ─────────────────────────────────────── */
.bg-layer{position:fixed;inset:0;z-index:-1;pointer-events:none}
.bg-glow{
  position:absolute;inset:0;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(123,97,255,.22), transparent 60%),
    radial-gradient(700px 500px at 110% 20%, rgba(123,97,255,.10), transparent 60%);
}
.bg-grain{
  position:absolute;inset:-10%;opacity:.10;mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size:160px 160px;
}

/* ── Topbar ──────────────────────────────────────────────────────── */
.topbar{
  position:sticky; top:8px; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  gap:12px;
  padding:10px 14px;
  background:rgba(10,10,12,.66);
  backdrop-filter:blur(14px) saturate(140%);
  -webkit-backdrop-filter:blur(14px) saturate(140%);
  border:1px solid var(--line);
  border-radius:999px;
  margin:8px var(--pad-x) 20px;
  height:var(--topbar-h);
}
.brand{display:flex;align-items:center;gap:10px;font-weight:600;letter-spacing:.005em;color:var(--ink)}
.brand-mark{
  width:14px;height:14px;border-radius:4px;
  background:linear-gradient(135deg, var(--accent), #C6B4FF);
  box-shadow:0 0 0 1px rgba(255,255,255,.1), 0 4px 14px var(--accent-glow);
}
.brand-name{font-size:14px}
.topnav{display:flex;align-items:center;gap:6px}
.topnav a{
  font-size:13px;color:var(--ink-2);
  padding:8px 12px;border-radius:999px;
  min-height:36px;display:inline-flex;align-items:center;
}
.topnav a:hover, .topnav a.active{color:var(--ink);background:var(--card-2)}

/* ── Page shell ──────────────────────────────────────────────────── */
.page{
  max-width:1180px;
  margin:0 auto;
  padding:0 var(--pad-x) 80px;
}

/* ── Hero ────────────────────────────────────────────────────────── */
.hero{
  padding:24px 0 28px;
  border-bottom:1px solid var(--line);
  margin-bottom:24px;
}
.eyebrow{
  display:inline-flex;align-items:center;gap:8px;
  font-size:12px;letter-spacing:.12em;text-transform:uppercase;
  color:var(--accent-2);
  background:var(--accent-soft);
  border:1px solid rgba(123,97,255,.25);
  padding:6px 12px;border-radius:999px;
}
.hero h1{
  font-family:"Fraunces",ui-serif,Georgia,serif;
  font-weight:500;
  font-size:clamp(34px, 9vw, 64px);
  line-height:1.05;
  letter-spacing:-.02em;
  margin:14px 0 10px;
}
.hero h1 em{
  font-style:italic;
  color:var(--accent-2);
}
.hero-sub{
  font-size:clamp(15px, 4vw, 18px);
  color:var(--ink-2);
  max-width:62ch;
  margin:0 0 16px;
}
.meta-row{
  display:flex;flex-wrap:wrap;gap:8px;align-items:center;
  font-size:13px;color:var(--ink-3);
}
.meta-pill{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 12px;border-radius:999px;
  background:var(--card);border:1px solid var(--line);
  color:var(--ink-2);
}
.meta-pill svg{width:14px;height:14px;stroke:currentColor}

/* ── Layout grid (mobile = single col; desktop = sidebar + content) */
.layout{
  display:block;
}

/* ── Sticky "Jump to step…" pill (mobile/tablet) ──────────────────── */
.jump-bar{
  position:sticky;
  top:calc(var(--topbar-h) + 14px);
  z-index:40;
  margin:0 0 20px;
}
.jump-trigger{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  width:100%;
  padding:14px 18px;
  min-height:48px;
  background:rgba(16,16,21,.85);
  backdrop-filter:blur(14px) saturate(140%);
  -webkit-backdrop-filter:blur(14px) saturate(140%);
  border:1px solid var(--line-2);
  border-radius:14px;
  color:var(--ink);
  font-weight:500;
  font-size:15px;
  text-align:left;
}
.jump-trigger .label{display:flex;align-items:center;gap:10px;min-width:0}
.jump-trigger .current{
  color:var(--ink-2);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.jump-trigger .chev{
  width:18px;height:18px;flex:0 0 18px;
  transition:transform .2s ease;
  stroke:var(--ink-2);
}
.jump-trigger[aria-expanded="true"] .chev{transform:rotate(180deg)}

.jump-sheet{
  display:none;
  margin-top:8px;
  background:rgba(16,16,21,.96);
  backdrop-filter:blur(14px) saturate(140%);
  -webkit-backdrop-filter:blur(14px) saturate(140%);
  border:1px solid var(--line-2);
  border-radius:14px;
  padding:8px;
  max-height:60vh;overflow-y:auto;
}
.jump-sheet.open{display:block}
.jump-sheet a{
  display:flex;align-items:center;gap:12px;
  padding:12px 14px;
  min-height:48px;
  border-radius:10px;
  color:var(--ink-2);
  font-size:15px;
}
.jump-sheet a:hover, .jump-sheet a.active{
  color:var(--ink);background:var(--card-2);
}
.jump-sheet a .num{
  flex:0 0 24px;
  font-variant-numeric:tabular-nums;
  font-size:12px;color:var(--accent-2);
  font-weight:600;
}

/* ── Desktop sidebar TOC ─────────────────────────────────────────── */
.toc{display:none}

/* ── Content / sections ──────────────────────────────────────────── */
.content{min-width:0}
.section{
  margin:0 0 36px;
  scroll-margin-top:calc(var(--topbar-h) + 24px);
}
.section-head{
  display:flex;align-items:baseline;gap:14px;
  margin-bottom:16px;
}
.section-num{
  font-family:"Fraunces",ui-serif,Georgia,serif;
  font-weight:500;
  font-size:42px;line-height:1;
  color:var(--accent-2);
  letter-spacing:-.02em;
  font-variant-numeric:tabular-nums;
}
.section h2{
  font-family:"Fraunces",ui-serif,Georgia,serif;
  font-weight:500;
  font-size:clamp(24px, 6vw, 32px);
  line-height:1.15;
  letter-spacing:-.015em;
  margin:0;
}
.section-sub{
  color:var(--ink-2);
  font-size:15px;
  margin:-4px 0 16px;
}

/* Step cards (a section can contain one or more) */
.step-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
  margin:0 0 14px;
}
.step-card + .step-card{margin-top:14px}
.step-card p{margin:0 0 10px;color:var(--ink)}
.step-card p:last-child{margin-bottom:0}
.step-card ol, .step-card ul{
  margin:0 0 0;padding-left:20px;
}
.step-card ol li, .step-card ul li{
  margin:8px 0;
  color:var(--ink);
}
.step-card ol li::marker{color:var(--accent-2);font-weight:600}
.step-card strong{color:var(--ink);font-weight:600}
.step-card .muted{color:var(--ink-2)}

/* ── Code chip (Downloader code) ─────────────────────────────────── */
.code-chip{
  display:flex;align-items:center;gap:10px;
  width:100%;
  padding:14px 18px;
  background:linear-gradient(180deg, rgba(123,97,255,.18), rgba(123,97,255,.06));
  border:1px solid rgba(123,97,255,.35);
  border-radius:14px;
  margin:14px 0;
  min-height:64px;
  transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  text-align:left;
}
.code-chip:hover{
  border-color:var(--accent-2);
  box-shadow:0 8px 28px var(--accent-glow);
}
.code-chip:active{transform:translateY(1px)}
.code-chip .code-label{
  font-size:11px;letter-spacing:.14em;text-transform:uppercase;
  color:var(--accent-2);
  display:block;margin-bottom:2px;
}
.code-chip .code-value{
  font-family:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:clamp(22px, 6vw, 30px);
  font-weight:600;
  letter-spacing:.06em;
  color:var(--ink);
  display:block;
  font-variant-numeric:tabular-nums;
}
.code-chip .copy-btn{
  margin-left:auto;
  display:inline-flex;align-items:center;gap:6px;
  padding:10px 14px;
  min-height:44px;
  border-radius:10px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--line-2);
  color:var(--ink);
  font-size:13px;font-weight:500;
}
.code-chip .copy-btn svg{width:14px;height:14px;stroke:currentColor}

/* ── Credential pills (the {server}/{username}/{password}) ───────── */
.creds{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin:14px 0;
}
.cred{
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  min-height:56px;
  background:var(--card-2);
  border:1px dashed var(--line-2);
  border-radius:12px;
}
.cred-label{
  font-size:11px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--ink-3);
  white-space:nowrap;
}
.cred-value{
  font-family:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:14px;
  color:var(--accent-2);
  word-break:break-all;
}

/* ── Callouts ────────────────────────────────────────────────────── */
.callout{
  display:flex;gap:12px;
  padding:14px 16px;
  border-radius:12px;
  margin:14px 0;
  font-size:14.5px;
  border:1px solid var(--line);
  background:var(--card);
}
.callout .ico{
  flex:0 0 22px;width:22px;height:22px;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:6px;font-size:13px;font-weight:700;
}
.callout--tip{border-color:rgba(123,97,255,.30);background:rgba(123,97,255,.06)}
.callout--tip .ico{background:var(--accent-soft);color:var(--accent-2)}
.callout--note{border-color:var(--line-2);background:var(--card-2)}
.callout--note .ico{background:rgba(255,255,255,.08);color:var(--ink-2)}
.callout--warn{border-color:rgba(245,185,124,.30);background:var(--warn-soft)}
.callout--warn .ico{background:rgba(245,185,124,.18);color:var(--warn)}
.callout strong{color:var(--ink)}

/* ── Toggle list (settings tweaks) ───────────────────────────────── */
.toggle-list{
  list-style:none;padding:0;margin:12px 0;
  display:grid;gap:8px;
}
.toggle-list li{
  display:flex;align-items:center;gap:12px;
  padding:12px 14px;
  min-height:48px;
  background:var(--card-2);
  border:1px solid var(--line);
  border-radius:12px;
  color:var(--ink);
  font-size:15px;
}
.toggle-list li::before{
  content:"";
  flex:0 0 22px;width:22px;height:22px;
  border-radius:7px;
  background:
    linear-gradient(180deg, var(--accent), #5C44CF);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.15), 0 4px 14px var(--accent-glow);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 8.5 6.5 12 13 4.5'/></svg>"),
    linear-gradient(180deg, var(--accent), #5C44CF);
  background-repeat:no-repeat;
  background-position:center;
  background-size:14px 14px, 100% 100%;
}

/* ── Setting paths (Settings → Display → Guide) ──────────────────── */
.path{
  display:inline-flex;flex-wrap:wrap;align-items:center;gap:4px;
  font-family:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:13px;
  padding:4px 8px;
  background:var(--card-2);
  border:1px solid var(--line);
  border-radius:8px;
  color:var(--ink-2);
}
.path b{font-weight:500;color:var(--ink)}
.path .sep{color:var(--ink-3);margin:0 2px}

/* ── Screenshots ─────────────────────────────────────────────────── */
.shot{
  margin:14px 0 6px;
  background:#000;
  border:1px solid var(--line-2);
  border-radius:14px;
  overflow:hidden;
  cursor:zoom-in;
  position:relative;
  min-height:44px;
}
.shot img{
  width:100%;
  height:auto;
  display:block;
  background:#000;
}
.shot-caption{
  font-size:13px;color:var(--ink-3);
  margin:8px 4px 14px;
}
.shot-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

/* ── Success / "done" card ───────────────────────────────────────── */
.done-card{
  text-align:center;
  padding:32px 22px;
  background:
    radial-gradient(400px 200px at 50% 0%, rgba(123,97,255,.15), transparent 70%),
    var(--card);
  border:1px solid rgba(123,97,255,.30);
  border-radius:18px;
  margin:14px 0;
}
.done-icon{
  width:56px;height:56px;
  margin:0 auto 12px;
  display:flex;align-items:center;justify-content:center;
  border-radius:16px;
  background:linear-gradient(180deg, var(--accent), #5C44CF);
  box-shadow:0 10px 32px var(--accent-glow);
}
.done-icon svg{width:28px;height:28px;stroke:#fff;stroke-width:2.5}
.done-card h3{
  font-family:"Fraunces",ui-serif,Georgia,serif;
  font-weight:500;
  font-size:26px;
  margin:0 0 6px;
  letter-spacing:-.01em;
}
.done-card p{color:var(--ink-2);margin:0;font-size:15px}

/* ── Footer ──────────────────────────────────────────────────────── */
.footer{
  margin-top:40px;
  padding:24px 0;
  border-top:1px solid var(--line);
  color:var(--ink-3);
  font-size:13px;
  display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;
}
.footer a{color:var(--ink-2)}
.footer a:hover{color:var(--ink)}

/* ── Floating "back to top" button ───────────────────────────────── */
.to-top{
  position:fixed;
  right:max(16px, env(safe-area-inset-right));
  bottom:max(20px, env(safe-area-inset-bottom));
  width:48px;height:48px;
  border-radius:50%;
  background:rgba(16,16,21,.92);
  border:1px solid var(--line-2);
  backdrop-filter:blur(14px) saturate(140%);
  -webkit-backdrop-filter:blur(14px) saturate(140%);
  display:flex;align-items:center;justify-content:center;
  z-index:60;
  opacity:0;
  transform:translateY(8px);
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
  box-shadow:0 10px 28px rgba(0,0,0,.4);
}
.to-top.show{opacity:1;transform:translateY(0);pointer-events:auto}
.to-top svg{width:18px;height:18px;stroke:var(--ink)}

/* ── Toast (copy feedback) ───────────────────────────────────────── */
.toast{
  position:fixed;
  left:50%;
  bottom:max(28px, env(safe-area-inset-bottom));
  transform:translate(-50%, 24px);
  background:rgba(16,16,21,.96);
  border:1px solid var(--line-2);
  color:var(--ink);
  padding:10px 16px;
  border-radius:999px;
  font-size:13px;
  font-weight:500;
  z-index:80;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
  display:flex;align-items:center;gap:8px;
  box-shadow:0 14px 40px rgba(0,0,0,.5);
}
.toast.show{opacity:1;transform:translate(-50%, 0)}
.toast svg{width:14px;height:14px;stroke:var(--accent-2)}

/* ── Lightbox ────────────────────────────────────────────────────── */
.lightbox{
  position:fixed;inset:0;
  background:rgba(5,5,8,.92);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  display:none;
  align-items:center;justify-content:center;
  z-index:100;
  padding:max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
}
.lightbox.open{display:flex}
.lightbox img{
  max-width:100%;max-height:100%;
  border-radius:10px;
  touch-action:pinch-zoom;
  user-select:none;
}
.lightbox-close{
  position:absolute;
  top:max(14px, env(safe-area-inset-top));
  right:max(14px, env(safe-area-inset-right));
  width:48px;height:48px;
  border-radius:50%;
  background:rgba(16,16,21,.85);
  border:1px solid var(--line-2);
  display:flex;align-items:center;justify-content:center;
}
.lightbox-close svg{width:20px;height:20px;stroke:var(--ink)}

/* ── Hub page (index.html) ───────────────────────────────────────── */
.guide-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
  margin-top:24px;
}
.guide-card{
  display:flex;flex-direction:column;
  padding:22px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  color:var(--ink);
  transition:transform .15s ease, border-color .15s ease, background .15s ease;
  min-height:160px;
}
.guide-card:hover{
  transform:translateY(-2px);
  border-color:var(--line-2);
  background:var(--card-2);
  color:var(--ink);
}
.guide-card-ico{
  width:38px;height:38px;border-radius:10px;
  background:var(--accent-soft);
  border:1px solid rgba(123,97,255,.25);
  display:flex;align-items:center;justify-content:center;
  color:var(--accent-2);
  font-size:18px;
  margin-bottom:14px;
}
.guide-card h3{
  font-family:"Fraunces",ui-serif,Georgia,serif;
  font-weight:500;
  font-size:22px;
  margin:0 0 6px;
  letter-spacing:-.01em;
}
.guide-card p{
  color:var(--ink-2);
  font-size:14px;
  margin:0 0 14px;
  flex:1;
}
.guide-card .meta-row{margin-top:auto}

.coming-soon{
  margin-top:32px;
  padding:18px;
  background:var(--card);
  border:1px dashed var(--line-2);
  border-radius:var(--radius);
  color:var(--ink-3);
  font-size:14px;
  text-align:center;
}

/* ─────────────────────────────────────────────────────────────────── */
/* Tablet (≥640px)                                                     */
/* ─────────────────────────────────────────────────────────────────── */
@media (min-width: 640px){
  .creds{grid-template-columns:repeat(3, 1fr)}
  .cred{grid-template-columns:1fr;align-items:flex-start;padding:14px}
  .cred-label{margin-bottom:4px}
  .shot-grid--2{grid-template-columns:1fr 1fr}
  .guide-grid{grid-template-columns:repeat(2, 1fr)}
}

/* ─────────────────────────────────────────────────────────────────── */
/* Desktop (≥1024px)                                                    */
/* ─────────────────────────────────────────────────────────────────── */
@media (min-width: 1024px){
  :root{ --topbar-h:68px; }

  .layout{
    display:grid;
    grid-template-columns:240px minmax(0, 1fr);
    gap:48px;
    align-items:flex-start;
  }

  /* Hide mobile pill, show real sidebar */
  .jump-bar{display:none}
  .toc{
    display:block;
    position:sticky;
    top:calc(var(--topbar-h) + 20px);
    align-self:flex-start;
    max-height:calc(100dvh - var(--topbar-h) - 40px);
    overflow-y:auto;
    padding:8px 6px;
  }
  .toc-title{
    font-size:11px;letter-spacing:.14em;text-transform:uppercase;
    color:var(--ink-3);
    padding:6px 10px;
    margin-bottom:6px;
  }
  .toc a{
    display:flex;align-items:center;gap:10px;
    padding:9px 10px;
    border-radius:8px;
    color:var(--ink-2);
    font-size:14px;
    line-height:1.3;
    border-left:2px solid transparent;
    transition:color .12s ease, background .12s ease, border-color .12s ease;
  }
  .toc a:hover{color:var(--ink);background:var(--card)}
  .toc a.active{
    color:var(--ink);
    background:var(--accent-soft);
    border-left-color:var(--accent);
  }
  .toc a .num{
    flex:0 0 22px;
    font-size:11px;
    color:var(--accent-2);
    font-weight:600;
    font-variant-numeric:tabular-nums;
  }

  .step-card{padding:24px}
  .section{margin-bottom:56px}
  .section-head{gap:18px}
  .section-num{font-size:56px}

  .shot-grid{gap:18px}

  .guide-grid{grid-template-columns:repeat(3, 1fr)}

  .to-top{display:none} /* desktop doesn't need it as much */
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    transition:none !important;
    animation:none !important;
    scroll-behavior:auto !important;
  }
}
