/* ==================================================================
   Shark Tools — Ai Hub
   Layout, components, and page styles.
   ================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[lang='km'] body {
  font-family: var(--font-khmer);
  line-height: 1.85;
}

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

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

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
pre {
  margin: 0;
}

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

::selection {
  background: color-mix(in srgb, var(--primary) 30%, transparent);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--foreground);
  color: var(--background);
  font-size: 13px;
  font-weight: 600;
  transition: top 0.2s ease;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 92px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-head {
  max-width: 660px;
  margin: 0 auto 52px;
  text-align: center;
}

.section-title {
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin: 14px 0 12px;
}

.section-sub {
  color: var(--muted-foreground);
  font-size: 15.5px;
  line-height: 1.65;
  max-width: 58ch;
  margin: 0 auto;
}

.eyebrow,
.pill-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--muted-foreground);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}

.eyebrow {
  flex-wrap: wrap;
  row-gap: 4px;
  max-width: 100%;
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}

.eyebrow span {
  white-space: nowrap;
}

.eyebrow .sep {
  opacity: 0.45;
}

.gradient-text {
  background: linear-gradient(100deg, var(--grad-from) 5%, var(--grad-mid) 48%, var(--grad-to) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

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

.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;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.16s ease, background-color 0.16s ease,
    border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--primary) 70%, transparent);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--primary) 88%, #000);
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--primary) 75%, transparent);
}

.btn-secondary {
  background: var(--muted);
  border-color: var(--border);
  color: var(--foreground);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--muted) 72%, var(--border));
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--foreground);
}

.btn-outline:hover {
  background: var(--muted);
}

.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
}

.btn-ghost:hover {
  color: var(--foreground);
  background: var(--muted);
}

.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
}

.btn-lg {
  height: 50px;
  padding: 0 26px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: transparent;
  border: 0;
  pointer-events: none;
  transition: height 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-inner {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: var(--container);
  height: var(--header-h);
  margin: 0 auto;
  top: 0;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  pointer-events: auto;
  transition:
    max-width 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    top 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.65s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease,
    border-radius 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.3s ease,
    box-shadow 0.3s ease,
    backdrop-filter 0.3s ease;
}

.site-header.is-scrolled .header-inner {
  max-width: 52rem;
  height: 48px;
  top: 12px;
  padding: 0 6px 0 16px;
  border-color: var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--background) 60%, transparent);
  box-shadow:
    0 2px 16px -6px rgba(0, 0, 0, 0.18),
    0 0 0 0.5px rgba(0, 0, 0, 0.02);
  backdrop-filter: saturate(1.4) blur(24px);
  -webkit-backdrop-filter: saturate(1.4) blur(24px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--foreground);
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  filter: drop-shadow(0 6px 14px rgba(62, 164, 236, 0.28));
  transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    flex-basis 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-name {
  font-size: 17.5px;
  font-weight: 650;
  letter-spacing: -0.025em;
  white-space: nowrap;
  transition: font-size 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header.is-scrolled .brand-mark {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
}

.site-header.is-scrolled .brand-name {
  font-size: 16px;
}

.site-header.is-scrolled .ai-badge {
  max-width: 0;
  padding-inline: 0;
  margin-left: 0;
  border-width: 0;
  opacity: 0;
  pointer-events: none;
}

/* Ai Hub badge: rotating gradient ring + orbiting particles */
.ai-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 25px;
  padding: 0 10px;
  margin-left: 2px;
  border: 1px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(var(--background), var(--background)) padding-box,
    conic-gradient(
        from var(--angle),
        rgba(62, 164, 236, 0.15) 0deg,
        #3ea4ec 70deg,
        #8b5cf6 140deg,
        rgba(139, 92, 246, 0.12) 220deg,
        rgba(62, 164, 236, 0.12) 320deg,
        rgba(62, 164, 236, 0.15) 360deg
      )
      border-box;
  color: var(--foreground);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  animation: badge-spin 5.5s linear infinite;
  transition:
    max-width 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease,
    padding 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    margin 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    border-width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-badge::after {
  content: '';
  position: absolute;
  inset: -5px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from var(--angle), #3ea4ec, #8b5cf6, #3ea4ec);
  filter: blur(9px);
  opacity: 0.22;
  animation: badge-pulse 3.2s ease-in-out infinite;
}

.ai-badge__text {
  position: relative;
  z-index: 2;
  transform: translateY(0.5px);
}

.ai-badge__orbit {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}

.ai-badge__orbit i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #d7f0ff;
  box-shadow: 0 0 8px 1px rgba(62, 164, 236, 0.9);
  offset-path: rect(0 100% 100% 0 round 999px);
  offset-distance: 0%;
  animation: badge-orbit 6s linear infinite;
}

.ai-badge__orbit i:nth-child(2) {
  background: #e9dcff;
  box-shadow: 0 0 8px 1px rgba(139, 92, 246, 0.9);
  animation-delay: -2s;
}

.ai-badge__orbit i:nth-child(3) {
  width: 2px;
  height: 2px;
  animation-delay: -4s;
}

@supports (offset-path: rect(0 100% 100% 0 round 999px)) {
  .ai-badge__orbit {
    opacity: 1;
  }
}

@keyframes badge-spin {
  to {
    --angle: 360deg;
  }
}

@keyframes badge-pulse {
  0%,
  100% {
    opacity: 0.16;
  }
  50% {
    opacity: 0.38;
  }
}

@keyframes badge-orbit {
  to {
    offset-distance: 100%;
  }
}

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

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav a:hover {
  background: color-mix(in srgb, var(--muted) 65%, transparent);
  color: var(--foreground);
}

.nav a[aria-current='page'] {
  color: var(--foreground);
  font-weight: 600;
}

.nav a.nav-mobile-cta {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 22px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-foreground);
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--muted);
  color: var(--foreground);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.icon-moon {
  display: none;
}

[data-theme='light'] .icon-sun {
  display: none;
}

[data-theme='light'] .icon-moon {
  display: block;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 55%, transparent);
}

.lang-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.4;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-toggle button[data-lang-btn='km'] {
  min-width: 70px;
  padding-top: 2px;
  font-family: var(--font-khmer);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
}

.lang-toggle button[aria-pressed='true'] {
  background: var(--foreground);
  color: var(--background);
}

.header-cta {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

.menu-btn {
  display: none;
}

.menu-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
}

.menu-icon span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transition:
    top 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease;
}

.menu-icon span:nth-child(1) {
  top: 3px;
}

.menu-icon span:nth-child(2) {
  top: 7px;
}

.menu-icon span:nth-child(3) {
  top: 11px;
}

[data-nav-open='true'] .menu-icon span:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}

[data-nav-open='true'] .menu-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

[data-nav-open='true'] .menu-icon span:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

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

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 56px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 900px;
  background:
    radial-gradient(560px 380px at 18% 18%, var(--hero-glow-a), transparent 70%),
    radial-gradient(520px 360px at 82% 12%, var(--hero-glow-b), transparent 72%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(70% 60% at 50% 20%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 20%, #000 10%, transparent 75%);
  opacity: 0.55;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 56px;
  align-items: center;
}

.hero-title {
  font-size: clamp(40px, 5.3vw, 64px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.02;
  margin: 22px 0 20px;
}

html[lang='km'] .hero-title {
  font-size: clamp(34px, 4.2vw, 52px);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.hero-sub {
  max-width: 54ch;
  color: var(--muted-foreground);
  font-size: 16.5px;
  line-height: 1.68;
  margin-bottom: 26px;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-copy > * {
  animation: heroFadeUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.hero-copy > *:nth-child(1) { animation-delay: 0.04s; }
.hero-copy > *:nth-child(2) { animation-delay: 0.10s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.16s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.22s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.28s; }
.hero-copy > *:nth-child(6) { animation-delay: 0.34s; }

.base-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 560px;
  padding: 13px 14px 13px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.base-box:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
  box-shadow: 0 12px 28px -10px rgba(62, 164, 236, 0.22);
}

.base-box__label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-foreground);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.base-box code {
  display: block;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.trust {
  margin-top: 30px;
}

.trust-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted-foreground);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.trust-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-chips span {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.trust-chips span:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, var(--card));
  color: var(--foreground);
}

/* ---------------- terminal ---------------- */

.hero-visual {
  position: relative;
}

@keyframes ambientGlowPulse {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.05);
  }
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: 8% 6%;
  border-radius: 50%;
  background: linear-gradient(120deg, rgba(62, 164, 236, 0.28), rgba(139, 92, 246, 0.24));
  filter: blur(48px);
  z-index: 0;
  animation: ambientGlowPulse 6s ease-in-out infinite;
}

@keyframes terminalPopup {
  0% {
    opacity: 0;
    transform: translateY(32px) scale(0.94);
    filter: blur(6px);
  }
  60% {
    opacity: 1;
    transform: translateY(-4px) scale(1.008);
    filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
}

.terminal {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-xl);
  background: var(--code-bg);
  color: var(--code-fg);
  box-shadow: 0 40px 90px -38px rgba(0, 0, 0, 0.72);
  animation: terminalPopup 0.85s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: 0.15s;
}

.term-line {
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.term-line.is-typed {
  opacity: 1;
}

.term-cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--primary);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--primary);
  animation: termBlink 0.8s infinite;
}

@keyframes termBlink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.term-dots {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

.term-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff5f57;
}

.term-dots i:nth-child(2) {
  background: #febc2e;
}

.term-dots i:nth-child(3) {
  background: #28c840;
}

.term-tabs {
  display: flex;
  gap: 2px;
  margin-left: 4px;
}

.term-tab {
  height: 24px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8b98a9;
  font-family: var(--font-mono);
  font-size: 11px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.term-tab:hover {
  color: #d8e1ec;
}

.term-tab.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #f2f6fb;
}

.term-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #7ee2b8;
  font-family: var(--font-mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.term-status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

.term-pane {
  display: none;
  min-height: 215px;
  max-height: 260px;
  padding: 16px 18px 12px;
  overflow: hidden;
}

.term-pane.is-active {
  display: block;
}

.term-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre;
  word-break: normal;
  color: #c7d2de;
}

.term-code .c-com {
  color: #64748b;
}

.term-code .c-key {
  color: #7dd3fc;
}

.term-code .c-fn {
  color: #c4b5fd;
}

.term-code .c-str {
  color: #86efac;
}

.term-code .c-num {
  color: #fca5a5;
}

.term-code .c-tag {
  color: #fbbf24;
}

.term-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
  color: #7f8ea3;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.term-foot span:last-child {
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ---------------- marquee ---------------- */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 62%, transparent);
  padding: 12px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 34px;
  width: max-content;
  animation: marquee 52s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--muted-foreground);
  font-size: 12px;
}

.marquee-item::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.7;
}

.marquee-item code {
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
}

.marquee-item em {
  font-style: normal;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------------- stats ---------------- */

.stats {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 40%, transparent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 38px 0;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: clamp(27px, 3.1vw, 38px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.stat:first-child .stat-value {
  color: var(--primary);
}

.stat-label {
  display: block;
  margin-top: 5px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
}

/* ---------------- feature cards ---------------- */

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

.feature-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  box-shadow: var(--shadow-md);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--primary) 11%, transparent);
  color: var(--primary);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-card h3 {
  margin-bottom: 8px;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.feature-card p {
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.65;
}

/* ---------------- model strip ---------------- */

.model-strip {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}

.model-strip-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.model-strip-head h2 {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.model-strip-head p {
  margin-top: 8px;
  color: var(--muted-foreground);
  font-size: 14.5px;
  max-width: 58ch;
}

.active-models-panel {
  padding: 18px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card) 75%, transparent);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(8px);
}

.active-models-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.active-models-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
}

.active-models-stat {
  font-size: 12px;
  color: var(--muted-foreground);
}

.active-models-stat code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--primary);
}

.active-models-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.active-model-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 999px;
  background: var(--card);
  color: var(--foreground);
  font-size: 12.5px;
  text-decoration: none;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.active-model-chip:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: 0 4px 12px -3px color-mix(in srgb, var(--primary) 25%, transparent);
}

.active-model-title {
  font-weight: 500;
}

.active-model-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--muted) 70%, transparent);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.live-dot-pulse {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.live-dot-pulse::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #10b981;
  animation: pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.model-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 12px;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.model-chip code {
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.model-chip:hover {
  border-color: var(--border-strong);
  color: var(--foreground);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag--primary {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
}

.tag--violet {
  border-color: color-mix(in srgb, var(--grad-to) 32%, var(--border));
  background: color-mix(in srgb, var(--grad-to) 10%, transparent);
  color: var(--grad-to);
}

/* ---------------- pricing cards ---------------- */

.price-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 22px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.price-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.price-card.is-featured {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 22px 50px -30px color-mix(in srgb, var(--primary) 60%, transparent),
    var(--shadow-sm);
}

.price-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.price-name {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
}

.price-tokens {
  margin: 6px 0 2px;
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
}

.price-tokens-label {
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.price-amount {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 18px 0 16px;
}

.price-amount strong {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.price-amount span {
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.price-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 12.5px;
  color: var(--muted-foreground);
}

.price-features li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.5;
}

.price-features svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-top: 3px;
  color: var(--success);
}

.price-card .btn {
  margin-top: auto;
}

.price-note {
  margin-top: 10px;
  color: var(--muted-foreground);
  font-size: 10.5px;
  text-align: center;
}

html[lang='km'] .price-features,
html[lang='km'] .pricing-desc {
  font-size: 13.5px;
  line-height: 1.75;
}

html[lang='km'] .price-tokens-label,
html[lang='km'] .price-note {
  font-size: 12px;
}

html[lang='km'] .stat-label {
  font-size: 13px;
}

html[lang='km'] .model-meta {
  font-size: 11.5px;
}

/* Khmer does not use uppercase or tracking the way Latin does. */
html[lang='km'] .eyebrow,
html[lang='km'] .pill-label,
html[lang='km'] .trust-label,
html[lang='km'] .footer-col h3,
html[lang='km'] .price-badge,
html[lang='km'] .compare-table thead th {
  letter-spacing: 0;
  text-transform: none;
}

html[lang='km'] .trust-label {
  font-size: 12px;
  font-weight: 600;
}

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

.code-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
  box-shadow: var(--shadow-md);
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.code-tabs {
  display: flex;
  gap: 2px;
}

.code-tab {
  height: 27px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8b98a9;
  font-family: var(--font-mono);
  font-size: 11px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.code-tab.is-active {
  background: rgba(255, 255, 255, 0.09);
  color: #f2f6fb;
}

.code-copy {
  height: 27px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: transparent;
  color: #c7d2de;
  font-size: 11px;
  transition: background-color 0.15s ease;
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.08);
}

.code-card pre {
  display: none;
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.75;
  color: #c7d2de;
}

.code-card pre.is-active {
  display: block;
}

.code-card pre .c-com {
  color: #64748b;
}

.code-card pre .c-key {
  color: #7dd3fc;
}

.code-card pre .c-fn {
  color: #c4b5fd;
}

.code-card pre .c-str {
  color: #86efac;
}

.code-card pre .c-num {
  color: #fca5a5;
}

/* ---------------- CTA ---------------- */

.cta-wrap {
  padding: 0 0 92px;
}

.cta-band {
  position: relative;
  overflow: hidden;
  padding: 60px 32px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.4);
  background:
    radial-gradient(620px 320px at 15% 0%, rgba(62, 164, 236, 0.16), transparent 70%),
    radial-gradient(560px 320px at 85% 100%, rgba(139, 92, 246, 0.15), transparent 70%),
    var(--card);
  text-align: center;
}

.cta-band h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 12px;
}

.cta-band p {
  max-width: 55ch;
  margin: 0 auto 26px;
  color: var(--muted-foreground);
  font-size: 15px;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--card) 42%, transparent);
  padding: 52px 0 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
  gap: 40px;
  padding-bottom: 36px;
}

.footer-brand .brand {
  margin-bottom: 12px;
}

.footer-brand p {
  max-width: 34ch;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.6;
}

.footer-col h3 {
  margin-bottom: 14px;
  color: var(--foreground);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-col a {
  display: block;
  padding: 4px 0;
  color: var(--muted-foreground);
  font-size: 13.5px;
  transition: color 0.15s ease;
}

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

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.footer-bottom .mono {
  font-size: 10.5px;
}

/* ---------------- page hero (inner pages) ---------------- */

.page-hero {
  position: relative;
  overflow: hidden;
  padding: 66px 0 44px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: -40% 0 auto 0;
  height: 620px;
  background: radial-gradient(520px 300px at 50% 30%, var(--hero-glow-a), transparent 72%);
  pointer-events: none;
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(34px, 4.6vw, 54px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

html[lang='km'] .page-hero h1 {
  font-size: clamp(30px, 3.8vw, 44px);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.page-hero p {
  max-width: 62ch;
  margin: 0 auto;
  color: var(--muted-foreground);
  font-size: 15.5px;
  line-height: 1.65;
}

/* ---------------- models page ---------------- */

.models-section {
  padding: 36px 0 84px;
}

.models-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.search {
  position: relative;
  flex: 1 1 300px;
  max-width: 430px;
}

.search svg {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
  transform: translateY(-50%);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--foreground);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search input::placeholder {
  color: var(--muted-foreground);
}

.search input:focus {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent);
}

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

.filter-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.filter-btn:hover {
  color: var(--foreground);
}

.filter-btn[aria-pressed='true'] {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--background);
}

.filter-sep {
  width: 1px;
  height: 18px;
  margin: 0 5px;
  background: var(--border);
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.results-meta strong {
  color: var(--foreground);
  font-weight: 600;
}

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

.model-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease;
}

@keyframes shimmer {
  0% { opacity: 0.35; }
  50% { opacity: 0.8; }
  100% { opacity: 0.35; }
}

.model-card--skeleton {
  opacity: 0.85;
  pointer-events: none;
  background: var(--card);
  border: 1px solid var(--border);
}

.skeleton-shimmer {
  background: color-mix(in srgb, currentColor 10%, transparent);
  animation: shimmer 1.6s infinite ease-in-out;
}

[data-theme="light"] .model-card--skeleton {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .skeleton-shimmer {
  background: rgba(0, 0, 0, 0.075);
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
}
.skeleton-line--title {
  width: 65%;
  height: 16px;
  margin-bottom: 6px;
}
.skeleton-line--sub {
  width: 45%;
  height: 12px;
}
.skeleton-pill {
  width: 55px;
  height: 22px;
  border-radius: 6px;
}
.skeleton-pill--wide {
  width: 70px;
}
.skeleton-line--meta {
  width: 90px;
  height: 12px;
}
.skeleton-line--meta-sm {
  width: 50px;
  height: 12px;
}

@keyframes modelFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.model-card--fadein {
  animation: modelFadeIn 0.22s ease-out;
}

.model-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  box-shadow: var(--shadow-md);
}

.model-card-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.model-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
}

.model-icon svg {
  width: 19px;
  height: 19px;
}

.model-card[data-family='claude'] .model-icon {
  background: color-mix(in srgb, #d97757 12%, transparent);
  color: #d97757;
}

.model-card[data-family='unknown'] .model-icon,
.model-card[data-family='oss'] .model-icon {
  background: color-mix(in srgb, var(--muted-foreground) 12%, transparent);
  color: var(--muted-foreground);
}

.model-card-title {
  min-width: 0;
  flex: 1;
}

.model-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.model-id-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.model-id {
  overflow: hidden;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-mini {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-foreground);
}

.copy-mini:hover {
  background: var(--muted);
  color: var(--foreground);
}

.copy-mini svg {
  width: 12px;
  height: 12px;
}

.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 14px 0;
}

.model-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 10.5px;
}

.model-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.model-meta svg {
  width: 12px;
  height: 12px;
}

.models-empty {
  display: none;
  padding: 56px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted-foreground);
  text-align: center;
  font-size: 14px;
}

.models-empty.is-visible {
  display: block;
}

.models-note {
  margin-top: 26px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 60%, transparent);
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.6;
}

.models-note code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--foreground);
}

/* ---------------- pricing page ---------------- */

.pricing-section {
  padding: 40px 0 72px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 24px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}

.pricing-card.is-featured {
  border-color: color-mix(in srgb, var(--primary) 60%, var(--border));
  box-shadow: 0 26px 60px -34px color-mix(in srgb, var(--primary) 70%, transparent),
    var(--shadow-sm);
}

.pricing-card .price-tokens {
  font-size: 44px;
}

.pricing-card .price-amount {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.pricing-desc {
  min-height: 42px;
  margin-bottom: 16px;
  color: var(--muted-foreground);
  font-size: 12.5px;
  line-height: 1.55;
}

.pricing-card .price-features {
  margin-bottom: 24px;
}

.pricing-card .btn {
  margin-top: auto;
}

.pricing-card .price-note {
  margin-top: 9px;
}

.compare-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.compare-title {
  margin-top: 60px;
  margin-bottom: 4px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.compare-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.compare-table th,
.compare-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.compare-table thead th {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}

.compare-table tbody th {
  color: var(--muted-foreground);
  font-weight: 500;
  width: 26%;
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.compare-table td {
  font-weight: 500;
}

.compare-table td.is-muted {
  color: var(--muted-foreground);
}

.compare-table .is-featured-col {
  background: color-mix(in srgb, var(--primary) 5%, transparent);
}

.faq-wrap {
  max-width: 820px;
  margin: 64px auto 0;
}

.faq-wrap h2 {
  margin-bottom: 14px;
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 20px 2px;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 14.5px;
  font-weight: 500;
  text-align: left;
}

.faq-q svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--muted-foreground);
  transition: transform 0.2s ease;
}

.faq-q[aria-expanded='true'] svg {
  transform: rotate(45deg);
}

.faq-a {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s ease;
}

.faq-a p {
  padding: 0 2px 20px;
  color: var(--muted-foreground);
  font-size: 13.5px;
  line-height: 1.7;
}

.pricing-footnote {
  max-width: 820px;
  margin: 28px auto 0;
  color: var(--muted-foreground);
  font-size: 12px;
  text-align: center;
}

/* ---------------- docs ---------------- */

.docs-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 52px;
  padding: 40px 0 88px;
}

.docs-side {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
}

.docs-side h2 {
  margin-bottom: 12px;
  color: var(--muted-foreground);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.docs-side a {
  display: block;
  padding: 6px 0;
  color: var(--muted-foreground);
  font-size: 13.5px;
  transition: color 0.15s ease;
}

.docs-side a:hover,
.docs-side a.is-active {
  color: var(--foreground);
}

.docs-content {
  min-width: 0;
}

.docs-content section {
  padding-bottom: 44px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.docs-content section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.docs-content h2 {
  margin-bottom: 12px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.docs-content h3 {
  margin: 22px 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.docs-content p {
  margin-bottom: 14px;
  color: var(--muted-foreground);
  font-size: 14.5px;
  line-height: 1.7;
}

.docs-content p code,
.docs-content li code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--foreground);
}

.docs-content ul {
  margin: 0 0 16px 0;
  padding-left: 18px;
  list-style: disc;
  color: var(--muted-foreground);
  font-size: 14px;
}

.docs-content li {
  margin-bottom: 6px;
}

.docs-content .code-card {
  margin: 16px 0;
}

.docs-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.docs-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}

.docs-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-card code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary);
  overflow-wrap: anywhere;
}

.docs-card code.plain {
  color: var(--foreground);
}

.error-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.error-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  font-size: 13px;
  color: var(--muted-foreground);
}

.error-row b {
  color: var(--foreground);
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 22px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
}

.status-pill--danger {
  background: color-mix(in srgb, #ef4444 14%, transparent);
  color: #ef4444;
}

.status-pill--warn {
  background: color-mix(in srgb, #f59e0b 16%, transparent);
  color: #d97706;
}

[data-theme='dark'] .status-pill--warn {
  color: #fbbf24;
}

.status-pill--info {
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
}

/* ---------------- 404 ---------------- */

.error-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h) - 260px);
  padding: 80px 24px;
  text-align: center;
}

.error-page .code {
  font-size: clamp(72px, 12vw, 140px);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 1;
  background: linear-gradient(100deg, var(--grad-from), var(--grad-to));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page h1 {
  margin: 14px 0 10px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.error-page p {
  margin-bottom: 24px;
  color: var(--muted-foreground);
  font-size: 14.5px;
}

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

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 120;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--foreground);
  color: var(--background);
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

@media (max-width: 1080px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eyebrow [data-i18n='home.badge3'],
  .eyebrow .sep--last {
    display: none;
  }

  .docs-layout {
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 36px;
  }
}

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-copy {
    max-width: 720px;
    margin: 0 auto;
  }

  .hero-visual {
    max-width: 700px;
    margin: 0 auto;
  }

  .price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .site-header.is-scrolled .header-inner {
    max-width: var(--container);
    height: var(--header-h);
    top: 0;
    padding: 0 24px;
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .brand,
  .header-actions {
    position: relative;
    z-index: 3;
  }

  .nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin: 0;
    padding: calc(var(--header-h) + 22px) 24px max(24px, env(safe-area-inset-bottom));
    border: 0;
    background: color-mix(in srgb, var(--background) 98%, transparent);
    box-shadow: none;
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transition:
      opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
      visibility 0.4s;
  }

  [data-nav-open='true'] .nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav a {
    display: flex;
    width: 100%;
    padding: 14px 0;
    border-radius: 0;
    color: var(--muted-foreground);
    font-size: 17px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(14px);
    transition:
      opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
      color 0.15s ease;
  }

  [data-nav-open='true'] .nav a {
    opacity: 1;
    transform: translateY(0);
  }

  .nav a:nth-child(1) {
    transition-delay: 0.04s;
  }

  .nav a:nth-child(2) {
    transition-delay: 0.08s;
  }

  .nav a:nth-child(3) {
    transition-delay: 0.12s;
  }

  .nav a:nth-child(4) {
    transition-delay: 0.16s;
  }

  .nav a:hover {
    background: transparent;
    color: var(--foreground);
  }

  .nav a[aria-current='page'] {
    color: var(--foreground);
  }

  .nav a[aria-current='page']::after {
    display: none;
  }

  .nav a.nav-mobile-cta {
    display: inline-flex;
    width: 100%;
    height: 46px;
    margin-top: auto;
    justify-content: center;
    padding: 0 18px;
    color: var(--primary-foreground);
    font-size: 14px;
    opacity: 0;
    transform: translateY(14px);
    transition-delay: 0.22s;
  }

  .nav a.nav-mobile-cta:hover {
    color: var(--primary-foreground);
  }

  [data-nav-open='true'] .nav a.nav-mobile-cta {
    opacity: 1;
    transform: translateY(0);
  }

  .menu-btn {
    display: grid;
  }

  .header-cta {
    display: none;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-grid,
  .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 26px 16px;
  }

  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-side {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
  }

  .docs-side h2 {
    width: 100%;
    margin-bottom: 0;
  }

  .docs-side a {
    padding: 6px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 3.9rem;
  }

  .container {
    padding: 0 18px;
  }

  .site-header.is-scrolled .header-inner {
    padding: 0 18px;
  }

  .header-inner {
    gap: 16px;
  }

  .header-actions {
    gap: 6px;
  }

  .brand-name {
    font-size: 16px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .ai-badge {
    height: 22px;
    padding: 0 8px;
    font-size: 9px;
  }

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

  .lang-toggle button {
    padding: 0 7px;
  }

  .lang-toggle button[data-lang-btn='km'] {
    min-width: 36px;
    padding: 0 7px;
    font-family: var(--font-sans);
    font-size: 0;
  }

  .lang-toggle button[data-lang-btn='km']::after {
    content: 'KM';
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
  }

  .hero {
    padding: 52px 0 40px;
  }

  .eyebrow {
    max-width: 100%;
    padding: 6px 10px;
    font-size: 10px;
    letter-spacing: 0.03em;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 4px;
  }

  .eyebrow span {
    white-space: nowrap;
  }

  .eyebrow .sep,
  .eyebrow [data-i18n='home.badge3'] {
    display: none;
  }

  .hero-title {
    font-size: clamp(34px, 9.5vw, 46px);
  }

  html[lang='km'] .hero-title {
    font-size: clamp(30px, 8.2vw, 40px);
    line-height: 1.45;
  }

  .hero-sub {
    font-size: 15px;
  }

  .base-box {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .base-box .btn {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .term-pane {
    min-height: 300px;
    padding: 14px;
  }

  .term-code {
    font-size: 10.5px;
  }

  .section {
    padding: 64px 0;
  }

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

  .feature-card:last-child {
    grid-column: auto;
  }

  .section-head {
    margin-bottom: 34px;
  }

  .feature-card {
    padding: 22px;
  }

  .model-strip {
    padding: 48px 0;
  }

  .model-strip-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .price-grid,
  .pricing-grid,
  .model-grid {
    grid-template-columns: 1fr;
  }

  .price-card,
  .pricing-card {
    padding: 24px 20px 20px;
  }

  .price-tokens,
  .pricing-card .price-tokens {
    font-size: 36px;
  }

  .cta-wrap {
    padding-bottom: 64px;
  }

  .cta-band {
    padding: 44px 20px;
  }

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

  .page-hero {
    padding: 48px 0 34px;
  }

  .models-section {
    padding: 26px 0 60px;
  }

  .filters {
    gap: 5px;
  }

  .filter-btn {
    height: 30px;
    font-size: 11.5px;
    padding: 0 10px;
  }

  .filter-sep {
    display: none;
  }

  .docs-cards {
    grid-template-columns: 1fr;
  }

  .docs-content h2 {
    font-size: 22px;
  }
}

@media (max-width: 440px) {
  .container {
    padding: 0 16px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .brand-name {
    font-size: 15px;
  }

  .ai-badge {
    height: 21px;
    padding: 0 7px;
    margin-left: 0;
    font-size: 8.5px;
  }

  .header-actions {
    gap: 4px;
  }

  .header-actions .icon-btn {
    width: 34px;
    height: 34px;
  }

  .lang-toggle button {
    min-width: 32px;
    padding: 0 6px;
  }

  .lang-toggle button[data-lang-btn='km'] {
    min-width: 34px;
    padding: 0 6px;
  }
}

@media (max-width: 380px) {
  .ai-badge {
    display: none;
  }
}

@media (max-width: 400px) {
  .term-tabs {
    gap: 0;
  }

  .term-tab {
    padding: 0 6px;
    font-size: 10px;
  }

  .term-status {
    display: none;
  }
}

@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .marquee-track {
    animation: none;
  }
}

/* ---------------- health ---------------- */

.health-main {
  padding: 72px 0 90px;
  min-height: calc(100vh - 260px);
}

.health-wrap {
  max-width: 820px;
}

.health-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 18%, transparent);
}

.health-wrap h1 {
  margin: 16px 0 10px;
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.health-sub {
  max-width: 58ch;
  color: var(--muted-foreground);
  font-size: 15px;
  line-height: 1.65;
}

.health-panel {
  margin-top: 32px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.health-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--border);
}

.health-row:last-child {
  border-bottom: 0;
}

.health-name {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
}

.health-detail {
  display: block;
  margin-top: 2px;
  color: var(--muted-foreground);
  font-size: 11.5px;
}

.health-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.health-state::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.health-state--ok {
  border-color: color-mix(in srgb, var(--success) 26%, var(--border));
  background: color-mix(in srgb, var(--success) 9%, transparent);
  color: var(--success);
}

.health-state--warn {
  border-color: color-mix(in srgb, var(--warning) 30%, var(--border));
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  color: var(--warning);
}

.health-state--pending {
  color: var(--muted-foreground);
}

.health-state--external {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary);
}

.health-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 18px;
  color: var(--muted-foreground);
  font-size: 11px;
}

.health-meta strong {
  color: var(--foreground);
  font-weight: 600;
}

.health-meta a {
  color: var(--primary);
}

.health-note {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--muted) 40%, transparent);
  color: var(--muted-foreground);
  font-size: 11.5px;
  line-height: 1.65;
}

@media (max-width: 600px) {
  .health-main {
    padding: 48px 0 64px;
  }

  .health-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 15px 16px;
  }

  .health-state {
    margin-left: 0;
  }
}

/* ---------------- multi-page entrance & interactive animations ---------------- */

@keyframes pageHeroFadeIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-hero .pill-label {
  animation: pageHeroFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.page-hero h1 {
  animation: pageHeroFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.08s backwards;
}

.page-hero p {
  animation: pageHeroFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.16s backwards;
}

.pricing-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
  animation: pageHeroFadeIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.pricing-card:nth-child(1) { animation-delay: 0.10s; }
.pricing-card:nth-child(2) { animation-delay: 0.18s; }
.pricing-card:nth-child(3) { animation-delay: 0.26s; }
.pricing-card:nth-child(4) { animation-delay: 0.34s; }

.pricing-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 20px 42px -15px rgba(0, 0, 0, 0.55), 0 0 24px -6px color-mix(in srgb, var(--primary) 30%, transparent);
}

.model-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
  animation: pageHeroFadeIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.model-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.45);
}

.docs-nav {
  animation: pageHeroFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.docs-article {
  animation: pageHeroFadeIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.10s backwards;
}

.docs-article pre {
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.docs-article pre:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--code-border));
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy > *,
  .terminal,
  .hero-visual::before,
  .term-line,
  .term-cursor,
  .page-hero .pill-label,
  .page-hero h1,
  .page-hero p,
  .pricing-card,
  .model-card,
  .docs-nav,
  .docs-article {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
