/* ============================================================
   Lurelock site styles. Plain, engineered, not templated.
   ============================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-disp);
  font-weight: 640;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.4em;
  color: var(--cream);
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.3rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1em; }
a { color: var(--mint); text-decoration-thickness: from-font; text-underline-offset: 3px; }
a:hover { color: var(--cream); }
strong { font-weight: 600; color: var(--cream); }
hr { border: 0; border-top: 1px solid var(--edge); margin: var(--grid) * 4 0; }
::selection { background: var(--mint); color: var(--ink); }

img, svg { display: block; }

.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 36px);
}
.wrap-wide { max-width: var(--measure-wide); }

/* ------------------------------------------------------------
   Topbar
   ------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 58px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
  font-family: var(--font-disp);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--cream); }
.brand .bmark { width: 26px; height: 26px; }
.brand .bmark svg { width: 100%; height: 100%; }
.brand .bver {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--mut);
  font-weight: 400;
  letter-spacing: 0.04em;
  border: 1px solid var(--edge-2);
  border-radius: 999px;
  padding: 1px 7px;
  align-self: center;
  margin-top: 2px;
}
.brand .bmark { display: inline-block; }
.bmark svg { width: 100%; height: 100%; }

.nav {
  display: flex;
  gap: 2px;
  align-items: center;
  margin-left: 8px;
  flex: 1;
}
.nav a {
  color: var(--mut);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--r-sm);
}
.nav a:hover { color: var(--cream); background: var(--panel-2); }
.nav a[aria-current="true"] { color: var(--mint); }
.nav .nav-sep { width: 3px; height: 14px; margin-inline: 6px; border-left: 1px solid var(--edge-2); opacity: 0.8; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* theme toggle */
.theme-toggle {
  --tt-r: 9px;
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--edge-2);
  background: var(--panel);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
}
.theme-toggle .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--mint);
  transition: transform 180ms ease;
  display: grid;
  place-items: center;
}
.theme-toggle .knob svg { width: 11px; height: 11px; stroke: var(--ink); }
html[data-theme="light"] .theme-toggle .knob { transform: translateX(18px); }
.theme-toggle span {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  color: var(--mut-dim);
}
html[data-theme="light"] .theme-toggle span { right: auto; left: 7px; }

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  position: relative;
  border-bottom: 1px solid var(--edge);
  overflow: hidden;
}
.hero .grid-mark {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(169, 243, 135, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(169, 243, 135, 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 80%);
  pointer-events: none;
}
.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 5vw, 64px);
  padding-top: clamp(52px, 9vw, 104px);
  padding-bottom: clamp(52px, 9vw, 104px);
  align-items: center;
}

.spec-line {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mint);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.spec-line::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--mint);
  opacity: 0.7;
}
.spec-line .dim { color: var(--mut); text-transform: none; letter-spacing: 0; }

.hero h1 { margin-bottom: 20px; }
.hero h1 .hl {
  color: var(--mint);
  position: relative;
  white-space: nowrap;
}
.hero .lede {
  font-size: 1.09rem;
  color: var(--mut);
  max-width: 34em;
  margin-bottom: 28px;
}
.hero .lede strong { color: var(--cream); }

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-foot {
  margin-top: 30px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mut-dim);
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.hero-foot b { color: var(--mut); font-weight: 500; }

/* console panel in hero */
.console {
  background: var(--ink);
  border: 1px solid var(--edge-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1), 0 34px 70px -44px rgba(0,0,0,0.9);
  overflow: hidden;
  font-family: var(--font-mono);
}
.console .titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--edge);
  background: var(--panel);
}
.console .titlebar span { color: var(--mut-dim); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; }
.console .titlebar .dots { display: flex; gap: 6px; margin-right: 4px; }
.console .titlebar .dots i {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--edge-2);
  display: block;
}
.console .titlebar .dots i:nth-child(1) { background: var(--bait); opacity: .85; }
.console .titlebar .dots i:nth-child(2) { background: var(--bait); opacity: .5; }
.console .titlebar .dots i:nth-child(3) { background: var(--edge-2); }
.console .screen {
  padding: 16px 16px 12px;
  min-height: 288px;
  font-size: 0.74rem;
  line-height: 2;
  color: var(--mut);
  white-space: pre-wrap;
  word-break: break-word;
}
.console .screen .ok { color: var(--mint); }
.console .screen .warn { color: var(--bait); }
.console .screen .dim { color: var(--mut-dim); }
.console .screen .blk { color: var(--cream); }
.console .cursor::after {
  content: "▊";
  color: var(--mint);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.console .statusbar {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--edge);
  font-size: 0.64rem;
  color: var(--mut-dim);
  background: var(--panel);
}
.console .statusbar b { color: var(--mint); font-weight: 500; }

/* ------------------------------------------------------------
   Sections & steps
   ------------------------------------------------------------ */
.section { padding-block: clamp(48px, 8vw, 88px); }
.section + .section { border-top: 1px solid var(--edge); }

.shead { display: flex; align-items: baseline; gap: 14px; margin-bottom: 30px; }
.shead .idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--mint);
  letter-spacing: 0.05em;
  border: 1px solid var(--edge-2);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.shead h2 { margin: 0; }
.shead p { color: var(--mut); margin: 0; max-width: 44em; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--r-md);
  padding: 20px 20px 22px;
  position: relative;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}
.card:hover { border-color: var(--edge-2); transform: translateY(-2px); }
.card .ico {
  width: 34px; height: 34px;
  border: 1px solid var(--edge-2);
  border-radius: 8px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: var(--panel-2);
}
.card .ico svg { width: 18px; height: 18px; stroke: var(--mint); }
.card h3 { font-size: 1.02rem; margin-bottom: 6px; }
.card p { font-size: 0.9rem; color: var(--mut); margin: 0; }
.card .tag {
  position: absolute;
  top: 14px; right: 14px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--mut-dim);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 2px 8px;
}

/* step list */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 22px;
  border-top: 1px solid var(--edge);
  padding-block: 20px;
}
.steps li:last-child { border-bottom: 1px solid var(--edge); }
.steps .n {
  font-family: var(--font-disp);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--edge-2);
  letter-spacing: -0.04em;
  line-height: 1;
}
.steps li:hover .n { color: var(--mint); }
.steps .body h3 { margin-bottom: 4px; }
.steps .body p { color: var(--mut); margin: 0; font-size: 0.95rem; }

/* ------------------------------------------------------------
   Buttons & chips
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--cream);
  background: var(--panel-2);
  border: 1px solid var(--edge-2);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
  position: relative;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; }
.btn:hover { background: var(--raise); color: var(--cream); border-color: var(--edge-2); }
.btn-primary { background: var(--mint); color: var(--ink); border-color: var(--mint); }
.btn-primary:hover { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.btn-bait { background: var(--bait); color: var(--ink); border-color: var(--bait); }
.btn-bait:hover { background: var(--cream); color: var(--ink); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--panel-2); }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.chip {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  border: 1px solid var(--edge-2);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--mut);
  white-space: nowrap;
}
.chip-mint { border-color: transparent; background: color-mix(in srgb, var(--mint) 14%, transparent); color: var(--mint); }
.chip-bait { border-color: transparent; background: color-mix(in srgb, var(--bait) 14%, transparent); color: var(--bait); }

kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--panel-2);
  border: 1px solid var(--edge-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--cream);
}

/* ------------------------------------------------------------
   Spec tables
   ------------------------------------------------------------ */
.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.spec th, .spec td {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--edge);
  vertical-align: top;
}
.spec th {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mut);
  background: var(--panel);
  font-weight: 500;
}
.spec td code { font-size: 0.8rem; }
.spec tr:hover td { background: var(--panel); }

code, .mono { font-family: var(--font-mono); }
code {
  font-size: 0.84em;
  background: var(--panel-2);
  border: 1px solid var(--edge);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--mint);
}

/* ------------------------------------------------------------
   Callouts
   ------------------------------------------------------------ */
.note, .warn, .bar {
  border: 1px solid var(--edge);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 0.92rem;
  background: var(--panel);
}
.note { border-left-color: var(--sky); }
.note .lead { color: var(--sky); }
.warn { border-left-color: var(--bait); }
.warn .lead { color: var(--bait); }
.bad { border-left-color: var(--bad); }
.bad .lead { color: var(--bad); }
.note .lead, .warn .lead, .bad .lead {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
}

/* ------------------------------------------------------------
   Fake app preview (hand-built mock of the manager UI)
   ------------------------------------------------------------ */
.mock {
  border: 1px solid var(--edge-2);
  border-radius: var(--r-lg);
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow-1), 0 36px 70px -50px rgba(0,0,0,0.9);
  font-size: 0.8rem;
}
.mock .m-title {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--edge);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--mut);
  background: var(--panel-2);
}
.mock .m-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.mock .m-body { display: grid; grid-template-columns: 168px 1fr; min-height: 300px; }
.mock .m-side {
  border-right: 1px solid var(--edge);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--ink);
}
.mock .m-side a {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--mut);
  text-decoration: none;
  padding: 7px 9px;
  border-radius: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.mock .m-side a i { width: 7px; height: 7px; border-radius: 50%; background: var(--edge-2); display: block; }
.mock .m-side a.on { color: var(--mint); background: var(--panel-2); }
.mock .m-side a.on i { background: var(--mint); }
.mock .m-main { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.mock .m-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--ink);
  align-items: center;
}
.mock .m-row b { font-size: 0.76rem; font-weight: 600; display: block; }
.mock .m-row em { font-style: normal; font-family: var(--font-mono); font-size: 0.62rem; color: var(--mut); }
.mock .m-row .sw {
  width: 30px; height: 16px; border-radius: 999px;
  background: var(--edge-2);
  position: relative;
}
.mock .m-row .sw::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--mut-dim);
  transition: transform 150ms ease;
}
.mock .m-row .sw.on { background: var(--mint); }
.mock .m-row .sw.on::after { transform: translateX(14px); background: var(--ink); }

/* ------------------------------------------------------------
   Dev docs layout
   ------------------------------------------------------------ */
.doc-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 44px;
  padding-block: 40px 80px;
  align-items: start;
}
.doc-toc {
  position: sticky;
  top: 78px;
  font-size: 0.85rem;
  max-height: calc(100vh - 100px);
  overflow: auto;
}
.doc-toc .toc-label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mut);
  margin-bottom: 10px;
}
.doc-toc a {
  display: block;
  color: var(--mut);
  text-decoration: none;
  padding: 5px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
}
.doc-toc a:hover { color: var(--cream); border-left-color: var(--edge-2); }
.doc-toc a.on { color: var(--mint); border-left-color: var(--mint); }

.doc { max-width: 780px; }
.doc h1 { font-size: 2.3rem; margin-bottom: 6px; }
.doc .doc-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mut);
  margin-bottom: 26px;
  display: flex; gap: 16px; flex-wrap: wrap;
}
.doc h2 {
  font-size: 1.4rem;
  margin-top: 2.2em;
  padding-top: 1.1em;
  border-top: 1px solid var(--edge);
}
.doc h2 .hk { color: var(--mint); font-size: 0.8em; padding-right: 10px; }
.doc h3 { margin-top: 1.6em; }
.doc ul, .doc ol { margin: 0 0 1em; padding-left: 22px; }
.doc li { margin-bottom: 5px; }

pre {
  background: var(--ink);
  border: 1px solid var(--edge);
  border-radius: var(--r-md);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 18px 0;
  font-size: 0.8rem;
  line-height: 1.7;
}
pre code { background: none; border: 0; padding: 0; color: var(--cream); }
pre .cm { color: var(--mut-dim); }
pre .k { color: var(--mint); }
pre .n { color: var(--bait); }
pre .s { color: var(--sky); }

.doc table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 0.86rem; }
.doc th, .doc td { text-align: left; border: 1px solid var(--edge); padding: 9px 12px; }
.doc th { background: var(--panel); font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mut); font-weight: 500; }

/* flag badges */
.flag-s, .flag-p, .flag-r, .flag-c, .flag-t {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.flag-s { background: color-mix(in srgb, var(--mint) 16%, transparent); color: var(--mint); }
.flag-p { background: color-mix(in srgb, var(--bait) 16%, transparent); color: var(--bait); }
.flag-r { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.flag-c { background: color-mix(in srgb, var(--sky) 16%, transparent); color: var(--sky); }
.flag-t { background: color-mix(in srgb, var(--mut) 20%, transparent); color: var(--mut); }

/* ------------------------------------------------------------
   Misc / footer
   ------------------------------------------------------------ */
.big-note {
  text-align: center;
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  background: var(--panel);
  padding: clamp(28px, 5vw, 48px) clamp(18px, 4vw, 44px);
}
.big-note h2 { margin-bottom: 10px; }
.big-note p { color: var(--mut); max-width: 34em; margin: 0 auto 22px; }

.partners {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  justify-content: center;
}

footer {
  border-top: 1px solid var(--edge);
  background: var(--ink);
  margin-top: 0;
}
footer .wrap {
  padding-block: 40px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
}
footer .f-brand { font-family: var(--font-disp); font-weight: 700; font-size: 1.1rem; margin-bottom: 8px; }
footer p { color: var(--mut); font-size: 0.86rem; }
footer h4 {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mut);
  margin-bottom: 12px;
  font-weight: 500;
}
footer nav a { display: block; color: var(--mut); text-decoration: none; font-size: 0.86rem; padding: 3px 0; }
footer nav a:hover { color: var(--cream); }
footer .f-base {
  grid-column: 1 / -1;
  border-top: 1px solid var(--edge);
  padding-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--mut-dim);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-toc { position: static; max-height: none; }
  .doc-toc .toc-links { display: flex; flex-wrap: wrap; gap: 4px; }
  .doc-toc .toc-links a { border-left: 0; padding: 5px 10px; border: 1px solid var(--edge); border-radius: 999px; margin: 2px; }
  footer .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .steps li { grid-template-columns: 1fr; gap: 6px; }
  .steps .n { font-size: 1.6rem; }
  body { font-size: 15px; }
}

/* nice scrollbars */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--edge-2); border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }