/* =========================================================
   Kainovis — base tokens, layout, header, footer, buttons
   ========================================================= */

:root {
  --bg: #070b10;
  --bg-soft: #0a1118;
  --panel: #0e1720;
  --panel-2: #111c26;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e8eef6;
  --muted: #94a2b3;
  --muted-2: #6e7c8e;
  --accent: #5ce1c2;
  --accent-strong: #2ec9a8;
  --accent-soft: rgba(92, 225, 194, 0.12);
  --blue: #8db4ff;
  --warm: #f0b46a;
  --paper: #f2f1ea;
  --paper-2: #e9e7dd;
  --ink: #0c1413;
  --ink-2: #3d4a48;
  --ink-3: #6b7773;
  --danger: #ff8b8b;
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1180px;
  --header-h: 74px;
  --font-sans: "Segoe UI Variable Display", "Segoe UI", "Inter", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--accent);
  color: #04110d;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #04110d;
  font-weight: 700;
}

.skip-link:focus {
  top: 16px;
}

.container {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

.container--narrow {
  width: min(920px, calc(100% - 48px));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: 104px 0;
}

.section--tight {
  padding: 76px 0;
}

.section--paper {
  background: var(--paper);
  color: var(--ink);
}

.section--soft {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

.section-head {
  max-width: 760px;
  margin-bottom: 48px;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.section--paper .section-foot {
  border-top-color: #dedbd0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section--paper .eyebrow {
  color: #0f766e;
}

.section-title {
  font-size: clamp(30px, 3.8vw, 46px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.section-title .accent {
  color: var(--accent);
}

.section--paper .section-title .accent {
  color: #0f766e;
}

.section-lead {
  margin-top: 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.section--paper .section-lead {
  color: var(--ink-3);
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--muted);
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1;
  transition: transform 0.25s var(--ease), background 0.25s, border-color 0.25s,
    color 0.25s, box-shadow 0.25s;
  white-space: nowrap;
}

.btn .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease);
}

.btn:hover .icon {
  transform: translate(2px, -2px);
}

.btn-primary {
  background: var(--accent);
  color: #04110d;
  box-shadow: 0 10px 30px rgba(92, 225, 194, 0.18);
}

.btn-primary:hover {
  background: #7df0d6;
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(92, 225, 194, 0.26);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(92, 225, 194, 0.45);
  background: rgba(92, 225, 194, 0.07);
  transform: translateY(-2px);
}

.btn-ink {
  background: var(--ink);
  color: var(--paper);
}

.btn-ink:hover {
  background: #1b2a27;
  transform: translateY(-2px);
}

.btn-sm {
  min-height: 40px;
  padding: 0 17px;
  font-size: 13px;
}

.btn-lg {
  min-height: 56px;
  padding: 0 30px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.link-arrow .icon {
  width: 15px;
  height: 15px;
  transition: transform 0.25s var(--ease);
}

.link-arrow:hover .icon {
  transform: translateX(4px);
}

.section--paper .link-arrow {
  color: #0f766e;
}

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

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 80;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: rgba(7, 11, 16, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 36px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(92, 225, 194, 0.34);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(92, 225, 194, 0.2), rgba(141, 180, 255, 0.06));
  color: var(--accent);
  font-size: 17px;
  font-weight: 750;
  line-height: 1;
  box-shadow: inset 0 0 18px rgba(92, 225, 194, 0.12);
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
}

.brand-word {
  color: #f2f7fb;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

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

.nav-links a {
  position: relative;
  padding: 9px 13px;
  border-radius: 8px;
  color: #aeb9c7;
  font-size: 13.5px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.header-actions .btn-ghost {
  border-color: transparent;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  margin: 4px auto;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 16, 0.98);
  backdrop-filter: blur(18px);
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0 22px;
}

.mobile-menu a {
  padding: 13px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  color: #cdd6e1;
  font-size: 15px;
}

.mobile-menu .btn {
  margin-top: 16px;
  border-bottom: 0;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: #05090d;
  padding: 72px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.8fr 1.1fr;
  gap: 48px;
}

.footer-brand p {
  max-width: 340px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.85;
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.footer-badges span {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.footer-col h4 {
  margin-bottom: 18px;
  color: #edf3f8;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

.footer-col a,
.footer-col li {
  color: var(--muted);
  font-size: 13.5px;
  transition: color 0.2s;
}

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

.footer-contact-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.footer-contact-line .icon {
  width: 15px;
  height: 15px;
  margin-top: 4px;
  color: var(--accent);
  flex: none;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 56px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 12px;
}

.footer-bottom .mono {
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* ---------- reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

.js .reveal[data-delay="1"] {
  transition-delay: 0.08s;
}

.js .reveal[data-delay="2"] {
  transition-delay: 0.16s;
}

.js .reveal[data-delay="3"] {
  transition-delay: 0.24s;
}

/* ---------- icon ---------- */

.icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  flex: none;
}

.icon svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 1080px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

  .header-actions {
    margin-left: auto;
  }

  .header-actions .header-demo {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .footer-col:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 66px;
  }

  .container,
  .container--narrow {
    width: min(var(--max), calc(100% - 36px));
  }

  .section {
    padding: 74px 0;
  }

  .section--tight {
    padding: 56px 0;
  }

  .header-actions .btn {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-col:last-child {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .container,
  .container--narrow {
    width: calc(100% - 32px);
  }

  .section-title {
    font-size: 30px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
