/* chokita.com — self-host explainer */

:root {
  --bg:        #08090d;
  --bg-soft:   #0b0d13;
  --surface:   #0f1116;
  --surface-2: #14171f;
  --border:    #1e222c;
  --border-2:  #2b3040;
  --text:      #e7e9f0;
  --muted:     #8b91a1;
  --dim:       #626878;

  --green:  #4ade80;
  --orange: #f6821f;
  --blue:   #60a5fa;
  --red:    #f87171;

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -24px rgba(0,0,0,.9);
  --wrap: 1120px;
  --gutter: 24px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 78%);
}

main, .nav, .foot { position: relative; z-index: 1; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface-2); padding: 10px 16px;
  border-radius: 0 0 var(--r-sm) 0; z-index: 99;
}
.skip:focus { left: 0; }

code.inline {
  font: 500 .875em/1 var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  color: #c8cfe0;
  white-space: nowrap;
}

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8,9,13,.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 62px; }

.mark {
  display: flex; align-items: center; gap: 9px;
  font: 600 15px/1 var(--mono); letter-spacing: -.01em;
  color: var(--text); flex: none;
}
.mark:hover { text-decoration: none; }
.mark-node {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(74,222,128,.14), 0 0 14px rgba(74,222,128,.55);
  flex: none;
}
.mark-node.sm { width: 8px; height: 8px; display: inline-block; margin-right: 6px; }
.mark-dot { color: var(--orange); }

.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.live-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 12.5px/1 var(--mono); color: var(--muted);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px; flex: none;
}
.live-chip:hover { color: var(--text); text-decoration: none; border-color: var(--border-2); }
.live-chip[data-state="up"]   { color: var(--green); border-color: rgba(74,222,128,.35); }
.live-chip[data-state="down"] { color: var(--red);   border-color: rgba(248,113,113,.35); }

.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex: none;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .35; transform: scale(.8); }
}

/* HERO */
.hero {
  padding-top: clamp(56px, 9vw, 104px);
  padding-bottom: clamp(40px, 6vw, 64px);
  max-width: 940px;
}
.eyebrow {
  font: 500 12.5px/1 var(--mono);
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--orange); margin: 0 0 22px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px;
  background: linear-gradient(90deg, var(--orange), transparent);
}

h1 {
  font-size: clamp(34px, 6.2vw, 62px);
  line-height: 1.04; letter-spacing: -.035em; font-weight: 680;
  margin: 0 0 26px;
  background: linear-gradient(180deg, #fff 12%, #a8b0c4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lede {
  font-size: clamp(16px, 1.6vw, 18.5px); line-height: 1.68;
  color: var(--muted); max-width: 68ch; margin: 0 0 34px;
}
.lede strong { color: var(--text); font-weight: 600; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 44px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 22px; border-radius: 10px;
  font: 600 14.5px/1 var(--sans); border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--text); color: #08090d; box-shadow: 0 10px 30px -12px rgba(255,255,255,.35); }
.btn-primary:hover { background: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--border-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: #3a4053; }

.hero-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
}
.meta-item { background: var(--bg-soft); padding: 16px 18px; display: flex; flex-direction: column; gap: 5px; }
.meta-k { font: 500 11px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--dim); }
.meta-v { font: 600 14px/1.3 var(--mono); color: var(--text); word-break: break-all; }

/* PIPELINE */
.pipeline-wrap { padding-bottom: clamp(48px, 7vw, 80px); }
.pipeline {
  display: flex; align-items: stretch;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 26px 20px; box-shadow: var(--shadow); overflow: hidden;
}
.hop {
  flex: 1 1 0; min-width: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 16px 18px; position: relative;
}
.hop-head {
  font: 600 13px/1 var(--mono); letter-spacing: -.01em;
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.hop-head::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--dim); }
.hop-body { font-size: 13px; line-height: 1.55; color: #b3b9c9; }
.hop-body .dim { color: var(--dim); font-family: var(--mono); font-size: 12px; }

.hop-edge { border-color: rgba(246,130,31,.34); background: linear-gradient(180deg, rgba(246,130,31,.07), var(--bg)); }
.hop-edge .hop-head::before { background: var(--orange); box-shadow: 0 0 10px rgba(246,130,31,.7); }
.hop-origin { border-color: rgba(74,222,128,.30); background: linear-gradient(180deg, rgba(74,222,128,.07), var(--bg)); }
.hop-origin .hop-head::before { background: var(--green); box-shadow: 0 0 10px rgba(74,222,128,.7); }
.hop-connector { border-color: rgba(96,165,250,.30); background: linear-gradient(180deg, rgba(96,165,250,.07), var(--bg)); }
.hop-connector .hop-head::before { background: var(--blue); box-shadow: 0 0 10px rgba(96,165,250,.7); }

.link {
  flex: 0 0 clamp(56px, 8vw, 104px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 9px; position: relative; padding-inline: 6px;
}
.link-label { font: 500 10.5px/1.25 var(--mono); color: var(--dim); text-align: center; white-space: nowrap; }
.link-line {
  width: 100%; height: 2px; border-radius: 2px;
  background-image: linear-gradient(90deg, #2b3040 0 50%, transparent 50% 100%);
  background-size: 12px 2px; position: relative;
}
.link-line::after {
  content: ""; position: absolute; top: 50%; left: 0;
  width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: var(--dim);
  animation: travel 3.4s cubic-bezier(.45,0,.55,1) infinite;
}
.link[data-flow="edge"]   .link-line::after { background: var(--orange); box-shadow: 0 0 10px rgba(246,130,31,.8); }
.link[data-flow="tunnel"] .link-line::after { background: var(--blue);   box-shadow: 0 0 10px rgba(96,165,250,.8); animation-delay: .5s; }
.link[data-flow="local"]  .link-line::after { background: var(--green);  box-shadow: 0 0 10px rgba(74,222,128,.8); animation-delay: 1s; }

@keyframes travel {
  0%   { left: 0; opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { left: calc(100% - 7px); opacity: 0; }
}

.pipeline-note { margin: 18px 0 0; font-size: 14.5px; color: var(--muted); max-width: 76ch; }
.pipeline-note em { color: var(--text); font-style: normal; border-bottom: 1px dashed var(--border-2); }

/* SECTIONS */
.section { padding-block: clamp(56px, 8vw, 92px); border-top: 1px solid var(--border); }
.section-head { margin-bottom: 44px; max-width: 74ch; }
.num { font: 500 12px/1 var(--mono); letter-spacing: .12em; color: var(--dim); display: block; margin-bottom: 14px; }
h2 {
  font-size: clamp(25px, 3.4vw, 36px); line-height: 1.16;
  letter-spacing: -.028em; font-weight: 660; margin: 0 0 14px;
}
.section-sub { color: var(--muted); font-size: 16px; margin: 0; max-width: 68ch; }
.section-sub strong { color: var(--text); font-weight: 600; }
h3 { font-size: 17px; letter-spacing: -.015em; font-weight: 620; margin: 0 0 9px; }
h4 { font: 600 12.5px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--dim); margin: 0 0 12px; }

/* STEPS */
.steps { list-style: none; margin: 0; padding: 0; }
.step {
  display: grid; grid-template-columns: 62px 1fr; gap: 24px;
  padding: 30px 0; border-top: 1px solid var(--border); position: relative;
}
.step:first-child { border-top: 0; padding-top: 0; }
.step:last-child { padding-bottom: 0; }
.step-num {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  font: 600 15px/1 var(--mono); color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-2);
}
.step::after {
  content: ""; position: absolute; left: 19.5px; top: 70px; bottom: -30px;
  width: 1px; background: linear-gradient(180deg, var(--border-2), transparent);
}
.step:last-child::after { display: none; }
.step-body p { margin: 0 0 16px; color: var(--muted); font-size: 15px; max-width: 74ch; }
.step-body p:last-child { margin-bottom: 0; }

/* CODE */
.code {
  margin: 0 0 16px; background: #06070a;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 16px 18px; overflow-x: auto; position: relative;
}
.code:last-child { margin-bottom: 0; }
.code::before {
  content: attr(data-lang);
  position: absolute; top: 8px; right: 12px;
  font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: #454b5c;
}
.code code { font: 400 13px/1.75 var(--mono); color: #c3cadb; white-space: pre; }

.callout {
  margin: 0; font-size: 14.5px; color: var(--muted);
  background: rgba(74,222,128,.05);
  border: 1px solid rgba(74,222,128,.2);
  border-left: 3px solid var(--green);
  border-radius: var(--r-sm); padding: 14px 18px;
}
.callout strong { color: var(--text); }
.callout.warn {
  background: rgba(246,130,31,.05);
  border-color: rgba(246,130,31,.22);
  border-left-color: var(--orange);
}

/* CARDS */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 16px; }
.card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--r); padding: 24px 22px 26px;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.card:hover { border-color: var(--border-2); background: var(--surface); transform: translateY(-2px); }
.card h3 { font-size: 15.5px; }
.card p { margin: 0; font-size: 14.5px; color: var(--muted); line-height: 1.6; }

/* TABS */
.tablist {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 5px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; margin-bottom: 24px;
}
.tab {
  appearance: none; background: transparent; border: 0; color: var(--muted);
  font: 550 13.5px/1 var(--sans); padding: 11px 16px; border-radius: 8px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 9px;
  transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.05) inset; }
.tag {
  font: 500 10px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase;
  color: #08110b; background: var(--green); padding: 4px 7px; border-radius: 5px;
}
.tag.ghost { background: transparent; color: var(--orange); border: 1px solid rgba(246,130,31,.4); }

.tabpanel { display: none; animation: fade .25s ease; }
.tabpanel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.panel-lede { margin: 0 0 18px; color: var(--muted); font-size: 15px; max-width: 78ch; }
.panel-lede em { color: var(--text); font-style: normal; }
.subhead { margin: 42px 0 20px; }
.subhead p { margin: 0; color: var(--muted); font-size: 14.5px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

/* STATUS */
.status-card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px;
  box-shadow: var(--shadow); transition: border-color .3s ease;
}
.status-card[data-state="up"]   { border-color: rgba(74,222,128,.28); }
.status-card[data-state="down"] { border-color: rgba(248,113,113,.34); }

.status-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.status-state { display: flex; align-items: center; gap: 10px; font: 600 15px/1 var(--mono); }
.status-route { font: 500 12px/1.3 var(--mono); color: var(--muted); }

.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--dim); flex: none;
  animation: pulse 2s ease-in-out infinite;
}
[data-state="up"]   .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(74,222,128,.15), 0 0 12px rgba(74,222,128,.6); }
[data-state="down"] .dot { background: var(--red); box-shadow: 0 0 0 3px rgba(248,113,113,.15), 0 0 12px rgba(248,113,113,.6); }

.status-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 1px; background: var(--border); border-radius: var(--r-sm);
  overflow: hidden; margin: 18px 0;
}
.status-grid > div { background: var(--bg); padding: 13px 15px; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.status-grid dt {
  font: 500 10.5px/1 var(--mono); letter-spacing: .08em;
  text-transform: uppercase; color: var(--dim);
}
.status-grid dd { margin: 0; font: 500 13px/1.35 var(--mono); color: #c3cadb; word-break: break-word; }
.status-grid dd[data-good="true"]  { color: var(--green); }
.status-grid dd[data-good="false"] { color: var(--orange); }

.status-foot {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin: 0; font: 500 12px/1 var(--mono); color: var(--dim);
}
.status-foot a { color: var(--muted); }
.status-foot a:hover { color: var(--blue); }

/* LIST */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.list li { background: var(--bg-soft); padding: 18px 20px; font-size: 14.5px; color: var(--muted); line-height: 1.62; }
.list li strong { color: var(--text); font-weight: 620; }

/* FOOTER */
.foot { border-top: 1px solid var(--border); padding-block: 30px; background: var(--bg-soft); }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 13.5px; color: var(--dim); }
.foot-inner strong { color: var(--text); font-family: var(--mono); font-size: 13px; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono); font-size: 12.5px; }
.foot-links a { color: var(--muted); }

/* RESPONSIVE */
@media (max-width: 1080px) {
  .pipeline { flex-wrap: wrap; gap: 14px; }
  .hop { flex: 1 1 200px; }
  .link { flex: 1 1 100%; flex-direction: row; gap: 12px; }
  .link-line { width: auto; flex: 1 1 auto; }
  .link-label { white-space: normal; }
}

@media (max-width: 780px) {
  :root { --gutter: 18px; }
  .nav-links { display: none; }
  .step { grid-template-columns: 1fr; gap: 14px; }
  .step::after { display: none; }
  .status-top { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .link-line::after { opacity: .9; }
}

@media print {
  body::before, .nav, .foot { display: none; }
  body { background: #fff; color: #000; }
}



