/* ---------------------------------------------------------------------------
   jiku.app design concept — shared system, extracted from the Juice landing
   page (pages/01-landing.html). Every value below comes from that page: the
   faces, the ink ladder, the hairlines, the 12px control radius, the mono
   figures. Nothing new is introduced except components the landing did not
   need (forms, tabs, console shell, docs frame), and each of those is built
   from the nearest thing the landing already had.
   --------------------------------------------------------------------------- */

:root {
  --bg-page: #ffffff;
  --bg-subtle: #fafafa;
  --bg-dark: #0d0c0d;
  --ink-strong: #080808;
  --ink-active: #111111;
  --ink-muted-head: #565656;
  --ink-body: #5c5c5c;
  --ink-label: #7b7b7b;
  --ink-chevron: #8c8c8c;
  --ink-on-dark: #f5f5f5;
  --ink-footer-head: #eeeeee;
  --btn-dark: #050505;
  --btn-dark-hover: #242222;
  --btn-light: #f2f2f2;
  --btn-light-hover: #eeeeee;
  --term-bg: #1a1818;
  --term-title: #242222;
  --term-resp: #292727;
  --line-light: #eeeeee;
  --line-table: #e8e8e8;
  --line-hair: #e5e5e5;
  --line-dark: #333333;
  --green-active: #2f9e64;
  --green-dot: #3cb043;
  --green-bright: #62c976;
  --green-check: #3fa666;
  --red-revoked: #d98c8c;
  --font-sans: 'Arimo', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --r-btn: 12px;
  --r-panel: 14px;
  --r-field: 8px;
  --r-tag: 4px;
  --gutter: 80px;
  --max: 1440px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--ink-body);
  font-size: 16px;
  line-height: 24px;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img, svg { display: block; }
ul, ol { list-style: none; }

:focus-visible {
  outline: 2px solid var(--ink-active);
  outline-offset: 2px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* --- type ---------------------------------------------------------------- */

.section-heading {
  font-size: 40px;
  line-height: 50px;
  font-weight: 400;
  letter-spacing: -1.1px;
  color: var(--ink-strong);
}

.page-title {
  font-size: 44px;
  line-height: 54px;
  font-weight: 400;
  letter-spacing: -1.3px;
  color: var(--ink-strong);
}

.card-title {
  font-size: 20px;
  line-height: 28px;
  font-weight: 400;
  letter-spacing: -0.4px;
  color: var(--ink-strong);
}

.card-title-sm {
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--ink-strong);
}

.card-desc {
  margin-top: 10px;
  max-width: 440px;
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-body);
}

.lead {
  margin-top: 16px;
  max-width: 560px;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-body);
}

.eyebrow,
.mono-label {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0.02em;
  color: var(--ink-label);
}

.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-body); }
.faint { color: var(--ink-label); }
.ink { color: var(--ink-strong); }
.small { font-size: 14px; line-height: 21px; }
.micro { font-size: 12px; line-height: 18px; }

/* --- buttons ------------------------------------------------------------- */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--r-btn);
  background: var(--btn-dark);
  color: #ffffff;
  font-size: 14px;
  line-height: 20px;
  transition: background-color 150ms ease, transform 100ms ease;
}
.btn-primary:hover { background: var(--btn-dark-hover); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--r-btn);
  background: var(--btn-light);
  color: var(--ink-active);
  font-size: 14px;
  line-height: 20px;
  transition: background-color 150ms ease, transform 100ms ease;
}
.btn-secondary:hover { background: var(--btn-light-hover); }
.btn-secondary:active { transform: translateY(1px); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--r-btn);
  border: 1px solid var(--line-table);
  color: var(--ink-strong);
  font-size: 14px;
  line-height: 20px;
  transition: border-color 150ms ease, transform 100ms ease;
}
.btn-outline:hover { border-color: var(--ink-label); }
.btn-outline:active { transform: translateY(1px); }

.btn-sm {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-field);
  font-size: 13px;
}

.btn-quiet {
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-field);
  font-size: 13px;
  color: var(--ink-body);
  transition: color 150ms ease, background-color 150ms ease;
}
.btn-quiet:hover { color: var(--ink-strong); background: var(--bg-subtle); }

.btn-pill-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-btn);
  background: var(--btn-dark);
  color: #ffffff;
  font-size: 13px;
  line-height: 20px;
  transition: background-color 150ms ease, transform 100ms ease;
}
.btn-pill-sm:hover { background: var(--btn-dark-hover); }
.btn-pill-sm:active { transform: translateY(1px); }

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-outline:disabled {
  background: var(--bg-subtle);
  color: var(--ink-label);
  border-color: var(--line-table);
  cursor: not-allowed;
  transform: none;
}

.link-underline {
  color: var(--ink-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}
.link-underline:hover { color: var(--ink-body); }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-strong);
}
.arrow-link svg { transition: transform 150ms ease; }
.arrow-link:hover svg { transform: translateX(3px); }

/* --- header -------------------------------------------------------------- */

.site-header {
  height: 84px;
  border-bottom: 1px solid var(--line-light);
  background: var(--bg-page);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left { display: flex; align-items: center; }

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  line-height: 24px;
  font-weight: 700;
  color: var(--ink-strong);
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: 48px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 44px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-body);
  transition: color 150ms ease;
}
.nav-link.active { color: var(--ink-active); }
.nav-link:hover { color: var(--ink-strong); }

.header-right { display: flex; align-items: center; gap: 20px; }

.header-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-table);
  border-radius: var(--r-field);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-body);
}

.header-balance {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-strong);
}

/* --- page shell ---------------------------------------------------------- */

.page-head {
  padding-top: 72px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line-light);
}
.page-head .page-title { max-width: 760px; }
.page-head .lead { max-width: 620px; }

.page-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.page-body { padding-top: 40px; padding-bottom: 96px; }

.section {
  padding-top: 96px;
  padding-bottom: 96px;
}

.rule { height: 1px; background: var(--line-light); }

/* --- cards + tables ------------------------------------------------------ */

.panel {
  border: 1px solid var(--line-light);
  border-radius: var(--r-tag);
  background: var(--bg-page);
}

.panel-pad { padding: 28px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-light);
}

.subtle-panel {
  background: var(--bg-subtle);
  padding: 48px 44px;
}

.dark-panel {
  background: var(--bg-dark);
  color: var(--ink-on-dark);
  border-radius: var(--r-panel);
  padding: 32px;
}

.dark-panel .card-title { color: #ffffff; }
.dark-panel .card-desc { color: #b6b6b6; }

.table-wrap {
  border: 1px solid var(--line-table);
  border-radius: var(--r-tag);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 20px;
}

.data-table th {
  text-align: left;
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
  color: var(--ink-label);
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-light);
  white-space: nowrap;
}

.data-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-light);
  color: var(--ink-strong);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg-subtle); }
.data-table .num,
.data-table .money { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.data-table .right { text-align: right; }
.data-table td.wrap { white-space: normal; }

.row-title { display: flex; align-items: center; gap: 8px; }
.row-sub { display: block; margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--ink-label); }

.tag-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--r-tag);
  background: #f5f5f5;
  color: #555555;
  font-size: 11px;
  line-height: 14px;
  white-space: nowrap;
}

.tag-outline {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line-table);
  border-radius: var(--r-tag);
  color: var(--ink-body);
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}

.proto-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }

.proto-tag {
  padding: 4px 8px;
  border-radius: var(--r-tag);
  background: #f5f5f5;
  color: #555555;
  font-size: 11px;
  line-height: 14px;
  white-space: nowrap;
}

.active-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-active);
  font-size: 12px;
  white-space: nowrap;
}
.active-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-dot); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-dot); }
.status-pill.is-warn { color: #8a6d1f; }
.status-pill.is-warn .dot { background: #d9a521; }
.status-pill.is-crit { color: #a03c3c; }
.status-pill.is-crit .dot { background: #c85252; }
.status-pill.is-muted { color: var(--ink-label); }
.status-pill.is-muted .dot { background: #b9b9b9; }

.official-cell { display: inline-flex; align-items: center; gap: 10px; }
.official-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green-dot); }
.official-prices { color: var(--ink-label); font-family: var(--font-mono); }
.saving-badge { color: var(--green-bright); font-family: var(--font-mono); }

/* --- forms --------------------------------------------------------------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field-wide { grid-column: 1 / -1; }

.field label {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-strong);
}

.input,
.select,
.textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-table);
  border-radius: var(--r-field);
  background: var(--bg-page);
  color: var(--ink-strong);
  font-size: 14px;
  outline: none;
  transition: border-color 150ms ease;
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 21px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-chevron); }
.input:hover, .select:hover, .textarea:hover { border-color: #d6d6d6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink-active); }
.input[aria-invalid="true"] { border-color: #c85252; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b7b7b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.help { font-size: 12px; line-height: 18px; color: var(--ink-label); }
.error-text { font-size: 12px; line-height: 18px; color: #a03c3c; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-body);
}
.check input {
  appearance: none;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1px solid #cfcfcf;
  border-radius: 3px;
  background: var(--bg-page);
  transition: border-color 150ms ease, background-color 150ms ease;
}
.check input:checked {
  background: var(--btn-dark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/10px no-repeat;
  border-color: var(--btn-dark);
}

.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 24px; }

/* --- tabs / segmented ---------------------------------------------------- */

.tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line-light);
}

.tab {
  position: relative;
  padding: 0 0 14px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-body);
  white-space: nowrap;
}
.tab:hover { color: var(--ink-strong); }
.tab[aria-selected="true"] { color: var(--ink-strong); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--ink-strong);
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-table);
  border-radius: var(--r-field);
  overflow: hidden;
}
.segmented button {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--ink-body);
  border-right: 1px solid var(--line-table);
}
.segmented button:last-child { border-right: none; }
.segmented button[aria-pressed="true"] { background: var(--ink-active); color: #ffffff; }
.segmented button:hover:not([aria-pressed="true"]) { color: var(--ink-strong); }

/* --- code ---------------------------------------------------------------- */

.code-block {
  background: var(--term-bg);
  border-radius: var(--r-panel);
  overflow: hidden;
}

.code-titlebar {
  height: 38px;
  background: var(--term-title);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #b6b6b6;
}

.code-body {
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 21px;
  color: #e2e2e2;
  overflow-x: auto;
  white-space: pre;
}

.code-inline {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: var(--r-tag);
  background: #f5f5f5;
  color: var(--ink-active);
}

/* --- footer -------------------------------------------------------------- */

.site-footer {
  background: var(--bg-dark);
  color: var(--ink-on-dark);
  padding-top: 96px;
  padding-bottom: 72px;
}

.footer-newsletter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  line-height: 24px;
  font-weight: 700;
  color: #ffffff;
}

.endpoint { }

.endpoint-label {
  font-size: 12px;
  line-height: 16px;
  color: #7b7b7b;
  margin-bottom: 10px;
}

.newsletter-form { display: flex; align-items: center; gap: 14px; width: 420px; }

.endpoint-code {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--r-field);
  background: #1c1a1c;
  border: 1px solid transparent;
  color: #d8d8d8;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-links-grid {
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.footer-col h4 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--ink-footer-head);
  margin-bottom: 16px;
}

.footer-col ul { display: flex; flex-direction: column; gap: 14px; }

.footer-col a {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-label);
  transition: color 150ms ease;
}
.footer-col a:hover { color: #ffffff; }

.footer-bottom {
  margin-top: 88px;
  border-top: 1px solid #777777;
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.copyright { font-size: 14px; line-height: 20px; color: #9a9a9a; }

.status-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #b6b6b6;
}
.status-link:hover { color: #ffffff; }

/* --- layout helpers ------------------------------------------------------ */

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 56px;
  align-items: start;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
}

.stack-8 > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }
.stack-32 > * + * { margin-top: 32px; }
.stack-48 > * + * { margin-top: 48px; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.row-gap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- concept index ------------------------------------------------------- */

.index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.index-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-light);
  border-radius: var(--r-tag);
  padding: 24px;
  min-height: 176px;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.index-card:hover { border-color: var(--ink-label); background: var(--bg-subtle); }
.index-card .mono-label { margin-bottom: 14px; }
.index-card h3 { font-size: 18px; line-height: 26px; font-weight: 400; color: var(--ink-strong); letter-spacing: -0.3px; }
.index-card p { margin-top: 8px; font-size: 13px; line-height: 20px; color: var(--ink-body); }
.index-card .arrow-link { margin-top: auto; padding-top: 20px; }

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 1080px) {
  :root { --gutter: 40px; }
  .page-title { font-size: 36px; line-height: 44px; }
  .section-heading { font-size: 32px; line-height: 40px; }
  .two-col, .split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; }
  .site-header { height: 64px; }
  .nav-links { display: none; }
  .page-title { font-size: 30px; line-height: 38px; }
  .section-heading { font-size: 26px; line-height: 34px; }
  .page-head { padding-top: 48px; }
  .page-body { padding-bottom: 64px; }
  .section { padding-top: 64px; padding-bottom: 64px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-newsletter { flex-direction: column; align-items: flex-start; }
  .newsletter-form { width: 100%; }
  .footer-links-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
  .index-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head-row { flex-direction: column; align-items: flex-start; }
}
