/* Wakaru landing — precision-technical, dark-committed.
   Palette = syntax tokens: fn blue, kw purple, str green, comment gray. */

:root {
  --bg: #141924;
  --bg-alt: #181e2a;
  --panel: #1c2330;
  --panel-2: #202838;
  --line: #2c3547;
  --line-soft: #252d3d;
  --ink: #e8ecf3;
  --ink-2: #9da8ba;
  --ink-3: #6e7a8d;
  --blue: #82b4ff;
  --blue-deep: #3d6fce;
  --purple: #c4a0f5;
  --green: #8ddb8c;
  --amber: #f0b86c;
  --red: #f07a7a;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--green);
}

.container { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 780px; }

/* ---------- nav ---------- */

.nav { border-bottom: 1px solid var(--line-soft); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.brand-icon { width: 24px; height: 24px; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 26px; font-size: 14px; font-family: var(--mono); }
.nav-links a { color: var(--ink-2); }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-github { display: inline-flex; align-items: center; }
.nav-github svg { display: none; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: 88px 0 40px;
}
.hero > .container { position: relative; z-index: 1; }
.hero-mark {
  position: absolute;
  z-index: 0;
  top: -68px;
  right: clamp(-190px, -7vw, -70px);
  width: clamp(460px, 50vw, 700px);
  height: auto;
  opacity: .17;
  filter: saturate(1.15) drop-shadow(0 26px 70px rgba(54, 82, 255, .24));
  pointer-events: none;
  user-select: none;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--mono);
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin-bottom: 20px;
}

.lede {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 620px;
  margin-bottom: 30px;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: stretch;
  margin-bottom: 52px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: #3671e9;
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-primary:hover { background: #4a82f2; color: #fff; text-decoration: none; }
.btn-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-2);
}
.btn-secondary:hover {
  border-color: var(--ink-3);
  color: var(--ink);
  text-decoration: none;
}
.cmd-prompt { color: var(--ink-3); user-select: none; }

/* ---------- demo pane ---------- */

.demo {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
}

.demo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
}
.demo-tag {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.demo-cmd {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.demo-code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  padding: 18px 18px 14px 6px;
  min-height: 260px;
  overflow-x: auto;
  white-space: pre;
}

.cl {
  max-height: 1.75em;
  overflow: hidden;
  padding-left: 12px;
  border-left: 2px solid transparent;
  transition: max-height 0.45s ease, opacity 0.45s ease,
              border-color 0.3s ease, background-color 0.3s ease;
}
.cl.out { max-height: 0; opacity: 0; }
.cl.in { max-height: 0; opacity: 0; }
.cl.swap { opacity: 0.15; transition: opacity 0.2s ease; }
.cl.dim { opacity: 0.28; }
.cl.focus {
  border-left-color: var(--blue);
  background: linear-gradient(90deg, rgba(130, 180, 255, 0.09), transparent 65%);
}
.cl.chg {
  border-left-color: var(--green);
  background: linear-gradient(90deg, rgba(141, 219, 140, 0.09), transparent 65%);
}

.tok-kw { color: var(--purple); }
.tok-str { color: var(--green); }
.tok-fn { color: var(--blue); }
.tok-num { color: var(--amber); }
.tok-com { color: var(--ink-3); font-style: italic; }

.demo-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-alt);
  font-family: var(--mono);
  font-size: 12.5px;
  min-height: 40px;
}
.status-text { color: var(--ink-2); transition: opacity 0.2s ease; }
.status-text.dim { opacity: 0; }
.status-text .ok { color: var(--green); }
.status-text .mk { color: var(--blue); }
.stepper { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.step-btn {
  font-size: 14px;
  line-height: 1;
  color: var(--ink-2);
  background: none;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 11px;
  cursor: pointer;
}
.step-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--ink-3); }
.step-btn:disabled { opacity: 0.35; cursor: default; }
.step-btn.pulse {
  color: var(--blue);
  border-color: var(--blue-deep);
  animation: step-pulse 1.8s ease-in-out infinite;
}
@keyframes step-pulse {
  50% { box-shadow: 0 0 0 5px rgba(130, 180, 255, 0.14); }
}
.step-dots { display: flex; gap: 8px; }
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--ink-3);
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.dot:hover { border-color: var(--ink); }
.dot.active { background: var(--blue); border-color: var(--blue); }

.demo-caveat {
  font-size: 13.5px;
  color: var(--ink-3);
  max-width: 640px;
  margin-top: 16px;
}

/* ---------- sections ---------- */

.section { padding: 96px 0; border-top: 1px solid var(--line-soft); }
.section-alt { background: var(--bg-alt); }

.section-eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  opacity: 0.75;
  margin-bottom: 14px;
}

.section h2 {
  font-family: var(--mono);
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
  margin-bottom: 18px;
}

.section-lede { color: var(--ink-2); margin-bottom: 40px; max-width: 620px; }

/* what it handles */

.cols-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px;
  margin: 40px 0 48px;
}
.mono-h {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 12px;
}
.mono-h svg { width: 19px; height: 19px; flex-shrink: 0; opacity: 0.9; }
.col p { font-size: 15px; color: var(--ink-2); }

/* rewrite levels */

.levels-axis {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 40px 0 18px;
}
.axis-line {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--purple));
  opacity: 0.55;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.level-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
}
.level-card-default { border-color: var(--blue-deep); }
.level-head { display: flex; align-items: center; gap: 10px; }
.level-name {
  font-size: 15px;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
}
.level-minimal { color: var(--green); }
.level-standard { color: var(--blue); }
.level-aggressive { color: var(--purple); }
.level-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  border: 1px solid var(--blue-deep);
  border-radius: 4px;
  padding: 1px 7px;
}
.level-card p { font-size: 14px; color: var(--ink-2); flex: 1; }
.level-cmd {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 8px 12px;
  white-space: pre;
  overflow-x: auto;
}

/* receipts / stat tiles */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 40px 0 36px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px 26px 22px;
  color: var(--ink);
}
.stat:hover { text-decoration: none; border-color: var(--ink-3); }
.stat-value {
  font-family: var(--mono);
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 14px; color: var(--ink-2); flex: 1; }
.stat-src {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--blue);
}
.stat:hover .stat-src { text-decoration: underline; text-underline-offset: 3px; }

/* obfuscation / webcrack */

.compare-note { color: var(--ink-2); max-width: 720px; margin: 32px 0 20px; font-size: 15px; }

.pipeline {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.9;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 22px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.pipeline code { background: none; border: none; padding: 0; color: var(--ink); font-size: inherit; }
.pipeline .tok-com { font-style: normal; }

/* use cases */

.cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.case {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 24px 24px 20px;
}
.case h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.case p { font-size: 14px; color: var(--ink-2); }

.case-cta {
  background: transparent;
  border: 1px dashed var(--ink-3);
}
.case-cta h3 { color: var(--green); }

/* faq */

#faq details {
  border-bottom: 1px solid var(--line-soft);
  padding: 4px 0;
}
#faq details:first-of-type { border-top: 1px solid var(--line-soft); margin-top: 32px; }
#faq summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
#faq summary::-webkit-details-marker { display: none; }
#faq summary::before {
  content: "+";
  font-family: var(--mono);
  color: var(--ink-3);
  flex-shrink: 0;
}
#faq details[open] summary::before { content: "\2212"; color: var(--green); }
#faq details p {
  padding: 0 0 20px 27px;
  color: var(--ink-2);
  font-size: 15px;
  max-width: 660px;
}
#faq .pipeline {
  margin: 0 0 20px 27px;
  max-width: calc(100% - 27px);
}

/* closing cta */

#get-started {
  background:
    radial-gradient(ellipse 90% 80% at 50% 115%, rgba(54, 113, 233, 0.16), transparent 70%),
    var(--bg);
}

.section h2.cta-title {
  font-size: clamp(30px, 4.4vw, 44px);
}
.cta-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.cta-cmd {
  font-size: 13.5px;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 16px;
  white-space: pre;
  overflow-x: auto;
}
.cta-cmd .cmd-select { user-select: all; }

/* footer */

footer { border-top: 1px solid var(--line-soft); padding: 44px 0 52px; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  font-family: var(--mono);
  font-size: 13.5px;
  margin-bottom: 18px;
}
.footer-links a { color: var(--ink-2); }
.footer-links a:hover { color: var(--ink); }
.footer-note { font-size: 13.5px; color: var(--ink-3); margin-bottom: 6px; }
.footer-legal { font-size: 12px; color: var(--ink-3); opacity: 0.75; }

/* ---------- responsive & motion ---------- */

@media (max-width: 640px) {
  .hero { padding: 44px 0 28px; }
  .hero-mark {
    top: -12px;
    right: -190px;
    width: 390px;
    opacity: .1;
  }
  .section { padding: 64px 0; }
  .nav-links { gap: 16px; }
  .nav-github svg { display: block; }
  .nav-github span { display: none; }
  .lede { font-size: 16.5px; margin-bottom: 24px; }
  .hero-actions { gap: 10px; margin-bottom: 36px; }
  .btn { padding: 9px 16px; font-size: 14px; }
  .demo-tag { display: none; }
  .demo-code { font-size: 11.5px; min-height: 220px; }
  .demo-status { flex-wrap: wrap; }
  .demo-status .status-text { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cl, .status-text { transition: none; }
  .step-btn.pulse { animation: none; }
}
