:root {

  color-scheme: light;

  --bg-app: #ffffff;
  --bg-card: #f5f5f7;
  --border-color: #e4e4e7;

  --text-main: #1f1f23;

  --success: #106b36;
  --success-bg: rgba(16, 107, 54, 0.08);
  --success-border: rgba(16, 107, 54, 0.75);

  --danger: #b91c1c;
  --danger-bg: rgba(185, 28, 28, 0.07);
  --danger-border: rgba(185, 28, 28, 0.7);
  --danger-text: #b91c1c;

  --shadow-lg: 0 1px 2px rgba(22, 19, 31, 0.06), 0 4px 12px rgba(22, 19, 31, 0.06);

  --radius-sm: 9px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --page-max: 1180px;
  --page-pad-x: 40px;
  --page-pad-x-mobile: 20px;

  --page-space-top: 84px;
  --page-space-bottom: 128px;

  --surface-0: #ececef;
  --surface-1: #ffffff;
  --surface-2: #f5f5f7;
  --surface-3: #ffffff;
  --surface-4: #ffffff;
  --surface-hover: #e6e6ea;

  --surface-accent-soft:   #f1edfd;
  --surface-accent-active: #5a35c9;

  --border-hairline: #e4e4e7;
  --border-control:  #7c7c86;
  --border-dashed:   #7f7f89;
  --border-hover:    #5c5c66;
  --border-accent:        #e2dafc;
  --border-accent-strong: #8b6fe8;
  --border-accent-ctrl:   #6d4fd8;

  --text-primary:   #0a0a0a;
  --text-secondary: #1f1f23;
  --text-muted-2:   #3f3f46;
  --text-subtle:    #52525b;
  --text-faint:     #61616a;
  --text-ghost:     var(--text-faint);

  --accent:       #5a35c9;
  --accent-hover: #4b2ca3;
  --on-accent:    #ffffff;

  --gold-text: #8a5a00;

  --grad-primary:  linear-gradient(#5a35c9, #5a35c9);
  --grad-featured: linear-gradient(#f4f1fe, #f4f1fe);

  --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: var(--font-display);

  --fs-h1: clamp(40px, 6vw, 64px);
  --fs-page-title: clamp(34px, 5vw, 52px);
  --fs-h2: 30px;
  --fs-h3: 22px;
  --fs-lead: 20px;
  --fs-body: 17px;
  --fs-sm: 16px;
  --fs-xs: 15px;
  --fs-meta: 14px;
  --fs-eyebrow: 13px;

  --radius-xs: 6px;
  --radius-pill: 999px;
  --ease: 0.16s ease;
}

@media (max-width: 640px) {
  :root {
    --page-space-top: 52px;
    --page-space-bottom: 88px;
  }
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-display);
  line-height: 1.55;
  min-height: 100vh;
  width: 100%;
}

h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

h3 { font-size: var(--fs-h3); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--ease);
}

a:hover { color: var(--accent-hover); }

[class^="kz-"], [class*=" kz-"],
[class^="kz-"]::before, [class*=" kz-"]::before,
[class^="kz-"]::after, [class*=" kz-"]::after {
  box-sizing: border-box;
}

.kz-page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 64px var(--page-pad-x) 96px;
  display: flex;
  flex-direction: column;
  gap: 72px;
}

@media (max-width: 640px) {
  .kz-page {
    padding: 32px var(--page-pad-x-mobile) 56px;
    gap: 40px;
  }
}

.kz-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-hairline);
}

.kz-section-head h2 {
  margin: 0;
  font-size: var(--fs-h2);
}

.kz-section-head .kz-meta { flex-shrink: 0; }

.kz-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-variant-numeric: tabular-nums;
  color: var(--text-ghost);
}

.kz-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.kz-eyebrow--accent { color: var(--accent); }

.kz-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
}

.kz-card--featured {
  background: var(--grad-featured);
  border-color: var(--border-accent);
}

.kz-card--primary {
  background: var(--grad-featured);
  border-color: var(--border-accent-strong);
}

.kz-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease),
              color var(--ease), filter var(--ease);
}

.kz-btn--primary {
  background: var(--grad-primary);
  color: var(--on-accent);
}

.kz-btn--primary:hover { filter: brightness(0.92); }

.kz-btn--secondary {
  background: var(--surface-0);
  color: var(--text-primary);
}

.kz-btn--secondary:hover { background: var(--surface-hover); }

.kz-btn--ghost {
  background: transparent;
  border: 1px dashed var(--border-dashed);
  font-weight: 400;
  font-size: var(--fs-sm);
  color: var(--text-muted-2);
}

.kz-btn--ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.kz-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background: var(--surface-4);
  border: 1px solid var(--border-control);
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  color: var(--text-secondary);
  white-space: nowrap;
}

.kz-badge--accent {
  background: var(--surface-accent-soft);
  border-color: var(--border-accent-ctrl);
  color: var(--accent-hover);
}

.kz-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.kz-chip {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-control);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}

.kz-chip:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.kz-chip.kz-chip--active,
.kz-chip.kz-chip--active:hover {
  background: var(--surface-accent-active);
  border-color: var(--border-accent-ctrl);
  color: var(--on-accent);
  font-weight: 600;
}

.kz-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 32px;
  background: var(--surface-2);
  border: 1px dashed var(--border-dashed);
  border-radius: var(--radius-lg);
  text-align: center;
}

.kz-empty__mark {
  width: 40px;
  height: 40px;
  margin-bottom: 4px;
  border: 1px dashed var(--border-dashed);
  border-radius: var(--radius-md);
}

.kz-empty__title {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text-primary);
}

.kz-empty__desc {
  max-width: 420px;
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--text-muted-2);
}

.kz-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 40px var(--page-pad-x) 28px;
}

.kz-auth > .kz-auth__card { margin-block: auto; }

.kz-auth > .site-footer {
  position: static;
  left: auto;
  width: 100vw;
  max-width: none;
  margin-top: 40px;
  transform: none;
}

@media (max-width: 640px) {
  .kz-auth { padding: 24px var(--page-pad-x-mobile) 20px; }
  .kz-auth__card { padding: 22px; }
}

.kz-auth__card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 420px;
  padding: 32px;
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-sizing: border-box;
}

.kz-auth__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.kz-auth__brand {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-primary);
}

.kz-auth__sub {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted-2);
}

.kz-auth__note {
  margin: 0;
  font-size: var(--fs-meta);
  color: var(--text-faint);
}

.kz-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kz-label {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

.kz-req { color: var(--accent); }

.kz-input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  box-sizing: border-box;
  background: var(--surface-4);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--ease), background var(--ease);
}

.kz-input::placeholder { color: var(--text-faint); }
.kz-input:focus { border-color: var(--border-accent-ctrl); }
.kz-input:disabled { opacity: 0.55; cursor: not-allowed; }

.kz-input--code {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3em;
  text-align: center;
}

.kz-hint {
  font-size: var(--fs-meta);
  line-height: 1.5;
  color: var(--text-faint);
}

.kz-hint--error {
  color: var(--danger-text);
}

.kz-textarea {
  width: 100%;
  min-height: 108px;
  padding: 11px 13px;
  background: var(--surface-4);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  transition: border-color var(--ease);
}

.kz-textarea::placeholder { color: var(--text-faint); }
.kz-textarea:focus { border-color: var(--border-accent-ctrl); }

.kz-select-wrap {
  position: relative;
  display: block;
}

.kz-select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.5px solid var(--text-faint);
  border-bottom: 1.5px solid var(--text-faint);
  transform: rotate(45deg);
  pointer-events: none;
}

.kz-select {
  width: 100%;
  height: 42px;
  padding: 0 34px 0 13px;
  background: var(--surface-4);
  border: 1px solid var(--border-control);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--ease);
}

.kz-select:focus { border-color: var(--border-accent-ctrl); }
.kz-select:disabled { opacity: 0.55; cursor: not-allowed; }

.kz-select option {
  background: var(--surface-3);
  color: var(--text-primary);
}

@media (max-width: 767px) {
  .kz-input,
  .kz-textarea,
  .kz-select {
    font-size: 16px;
  }
}

.kz-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kz-progress__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--fs-xs);
  color: var(--text-muted-2);
}

.kz-progress__pct {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  color: var(--accent-hover);
}

.kz-progress__track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-0);
  border: 1px solid var(--border-hairline);
  overflow: hidden;
}

.kz-progress__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--grad-primary);
  transition: width 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .kz-progress__fill { transition: none; }
}

.kz-btn--danger {
  background: transparent;
  border-color: var(--border-control);
  color: var(--text-muted-2);
}

.kz-btn--danger:hover {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-text);
}

.kz-formrow {
  display: flex;
  justify-content: flex-end;
}

.kz-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-display);
  font-size: var(--fs-meta);
  color: var(--accent);
  cursor: pointer;
  transition: color var(--ease);
}

.kz-link:hover { color: var(--accent-hover); }

.kz-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface-0);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
}

.kz-tab {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted-2);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

.kz-tab:hover { background: var(--surface-hover); color: var(--text-primary); }

.kz-tab.kz-tab--active,
.kz-tab.kz-tab--active:hover {
  background: var(--surface-accent-active);
  color: var(--on-accent);
  font-weight: 600;
}

.kz-msg {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  border-left-width: 2px;
  background: var(--surface-4);
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--text-muted-2);
}

.kz-msg--info    { border-left-color: var(--accent); }
.kz-msg--success { border-left-color: var(--success); color: var(--text-secondary); }
.kz-msg--error   { border-left-color: var(--danger-text); color: var(--danger-text); }

.kz-spinner {
  width: 13px;
  height: 13px;
  border: 2px solid var(--border-hairline);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: kzSpin 0.7s linear infinite;
}

@keyframes kzSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .kz-spinner { animation-duration: 2s; }
}

.kz-prose {
  max-width: 68ch;
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--text-muted-2);
}

.kz-prose h2 {
  margin: 32px 0 10px;
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text-primary);
}

.kz-prose h2:first-child { margin-top: 0; }

.kz-prose h3 {
  margin: 22px 0 8px;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text-primary);
}
.kz-prose p { margin: 0 0 12px; }
.kz-prose ul { margin: 0 0 12px; padding-left: 20px; }
.kz-prose li { margin-bottom: 7px; }
.kz-prose strong { color: var(--text-secondary); font-weight: 600; }

.kz-dot-art {
  display: grid;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  line-height: 0.75;
}

.kz-dot-art > pre {
  grid-area: 1 / 1;
  margin: 0;
  font: inherit;
  line-height: inherit;
  white-space: pre;
}

.kz-dot-art > pre:nth-child(1) { color: #c4b5fd; }
.kz-dot-art > pre:nth-child(2) { color: #8b6fe8; }
.kz-dot-art > pre:nth-child(3) { color: #24145c; }
.kz-dot-art > pre:nth-child(4) { color: #f08c00; }

.app {
  display: block;
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-app);
  overflow-x: clip;
}

.site-header {
    display: block;
    height: 64px;
    flex: 0 0 64px;
}

.sh-header {
    position: fixed;
    z-index: 100;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 64px;
    box-sizing: border-box;
    padding: 0 clamp(20px, 4.3vw, 72px);
    background: var(--surface-1);
    border-bottom: 1px solid var(--border-hairline);
}

.sh-brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.sh-brand:hover { color: var(--text-primary); }

.sh-mark {
    display: block;
    width: 28px;
    height: 28px;
}

.sh-wordmark {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.sh-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.sh-nav-link {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 14px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    transition: background var(--ease), color var(--ease);
}

.sh-nav-link:hover { background: var(--surface-0); color: var(--text-primary); }

.sh-nav-link--active,
.sh-nav-link--active:hover {
    background: var(--surface-accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.sh-brand:focus-visible,
.sh-nav-link:focus-visible,
.sh-menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sh-menu-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--ease);
}

.sh-menu-toggle.is-active { background: var(--surface-0); }

@media (hover: hover) {
    .sh-menu-toggle:hover { background: var(--surface-0); }
}

.sh-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: var(--text-primary);
    transition: transform var(--ease), opacity var(--ease);
}

.sh-menu-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sh-menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.sh-menu-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1100px) {
    .sh-menu-toggle { display: flex; margin-left: auto; }

    .sh-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin-left: 0;
        padding: 8px clamp(20px, 4.3vw, 72px) 16px;
        border-bottom: 1px solid var(--border-hairline);
        background: var(--surface-1);
        box-shadow: 0 12px 24px rgba(22, 19, 31, 0.08);
    }

    .sh-nav.sh-nav--open { display: flex; }
    .sh-nav-link { height: 52px; padding: 0 16px; font-size: 18px; }
    .sh-nav-link:focus-visible { outline-offset: -2px; }
}

@media (max-width: 640px) {
    .site-header { height: 60px; flex-basis: 60px; }
    .sh-header { height: 60px; gap: 0; padding: 0 20px; }
    .sh-nav { padding: 8px 20px 16px; }
}

@media (max-width: 370px) {
    .sh-mark { width: 26px; height: 26px; }
}

.site-footer {
    display: block;
    position: relative;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
}

.sf-footer {
    border-top: 1px solid var(--border-hairline);
}

.sf-inner {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 48px var(--page-pad-x) 0;
    box-sizing: border-box;
}

.sf-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 220px));
    gap: 32px 48px;
    padding-bottom: 40px;
}

.sf-head {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.sf-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sf-link {
    font-size: 16px;
    color: var(--text-primary);
    transition: color var(--ease);
}

.sf-link:hover {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sf-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.sf-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding: 20px 0;
    border-top: 1px solid var(--border-hairline);
}

.sf-copy {
    font-size: 14px;
    color: var(--text-faint);
}

.sf-link--small { font-size: 14px; color: var(--text-faint); }

@media (max-width: 640px) {
    .sf-inner { padding: 36px var(--page-pad-x-mobile) 0; }
    .sf-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; padding-bottom: 32px; }
}
