/* Bitaloka — design system (Akaloka brand language) */

/* ------------------------------------------------------------------ *
 * Brand spectrum
 * ------------------------------------------------------------------ */
:root {
  --brand-1: #f2622a;
  --brand-2: #f5a03c;
  --brand-3: #7bc74d;
  --brand-4: #3ec5a8;
  --brand-5: #35c7d9;
  --brand-6: #3b82f6;
  --brand-7: #6a6bf5;
  --brand-8: #9b5cf6;
  --brand-9: #d9508a;

  --spectrum: linear-gradient(
    90deg,
    var(--brand-1),
    var(--brand-2),
    var(--brand-3),
    var(--brand-4),
    var(--brand-5),
    var(--brand-6),
    var(--brand-7),
    var(--brand-8),
    var(--brand-9)
  );

  --font-sans: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
}

/* ------------------------------------------------------------------ *
 * Theme tokens — light (default)
 * ------------------------------------------------------------------ */
:root {
  color-scheme: light;

  --page: #ffffff;
  --page-glass: rgba(255, 255, 255, 0.78);
  --ink: #000000;
  --body: #3f3f46;
  --muted: #71717a;
  --line: #e8e8ec;
  --line-strong: #d6d6dc;

  --surface: #ffffff;
  --surface-soft: #f6f6f7;
  --card: #ffffff;
  --card-border: #ececf0;

  --code-bg: #0b0d12;
  --code-ink: #e6e9f0;

  --cta-bg: #0b0d12;
  --cta-ink: #ffffff;
  --cta-hover: #1c2029;

  --shadow-card: 0 1px 2px rgba(15, 17, 24, 0.04), 0 8px 24px -12px rgba(15, 17, 24, 0.12);
}

/* ------------------------------------------------------------------ *
 * Theme tokens — dark
 * ------------------------------------------------------------------ */
:root[data-theme='dark'] {
  color-scheme: dark;

  --page: #000000;
  --page-glass: rgba(0, 0, 0, 0.78);
  --ink: #ffffff;
  --body: #d4d4d4;
  --muted: #999999;
  --line: #1f1f1f;
  --line-strong: #333333;

  --surface: #0a0a0a;
  --surface-soft: #141414;
  --card: #0f0f0f;
  --card-border: #1f1f1f;

  --code-bg: #0b0d12;
  --code-ink: #e6e9f0;

  --cta-bg: #ffffff;
  --cta-ink: #000000;
  --cta-hover: #e6e6e6;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -20px rgba(0, 0, 0, 0.8);
}

/* ------------------------------------------------------------------ *
 * Base
 * ------------------------------------------------------------------ */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.2s ease, color 0.2s ease;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

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

p {
  margin: 0;
}

code,
pre {
  font-family: var(--font-mono);
}

::selection {
  background: color-mix(in srgb, var(--brand-6) 28%, transparent);
}

/* ------------------------------------------------------------------ *
 * Layout shell
 * ------------------------------------------------------------------ */
.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ------------------------------------------------------------------ *
 * Header
 * ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--page-glass);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-size: 17px;
}

.brand-lockup__mark {
  width: 24px;
  height: 24px;
  display: block;
}

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

.site-nav a {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

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

/* ------------------------------------------------------------------ *
 * Buttons
 * ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease;
}

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

.btn--primary {
  background: var(--cta-bg);
  color: var(--cta-ink);
  border-color: var(--cta-bg);
}

.btn--primary:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  background: var(--surface-soft);
}

.btn--sm {
  padding: 8px 14px;
  font-size: 13.5px;
}

/* Spectrum "gradient border" primary on hero */
.btn--spectrum {
  position: relative;
  background: var(--cta-bg);
  color: var(--cta-ink);
}

.btn--spectrum:hover {
  box-shadow: 0 8px 30px -8px color-mix(in srgb, var(--brand-6) 55%, transparent);
}

/* ------------------------------------------------------------------ *
 * Theme toggle
 * ------------------------------------------------------------------ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon--moon {
  display: none;
}

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

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

/* ------------------------------------------------------------------ *
 * Hero
 * ------------------------------------------------------------------ */
.hero {
  position: relative;
  padding: 96px 0 72px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto;
  height: 560px;
  background:
    radial-gradient(600px 320px at 30% 0%, color-mix(in srgb, var(--brand-6) 22%, transparent), transparent 70%),
    radial-gradient(600px 320px at 70% 10%, color-mix(in srgb, var(--brand-8) 20%, transparent), transparent 70%),
    radial-gradient(500px 280px at 50% 0%, color-mix(in srgb, var(--brand-4) 14%, transparent), transparent 70%);
  pointer-events: none;
}

.hero .container {
  position: relative;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  margin-bottom: 28px;
}

.kicker__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--spectrum);
}

.hero__title {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 650;
  letter-spacing: -0.03em;
  max-width: 15ch;
  margin: 0 auto;
}

.hero__title .grad {
  background: var(--spectrum);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  max-width: 46ch;
  margin: 24px auto 0;
  font-size: 18px;
  color: var(--body);
}

.hero__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 36px;
}

/* ------------------------------------------------------------------ *
 * Terminal mockup
 * ------------------------------------------------------------------ */
.terminal {
  max-width: 760px;
  margin: 64px auto 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: var(--code-bg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  text-align: left;
}

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal__bar::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-1);
  box-shadow: 16px 0 0 var(--brand-2), 32px 0 0 var(--brand-3);
}

.terminal__bar span {
  margin-left: 34px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #8a93a6;
}

.terminal__body {
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--code-ink);
  overflow-x: auto;
}

.terminal__body .c {
  color: #7ee0a3;
}

.terminal__body .k {
  color: #8ab4ff;
}

.terminal__body .s {
  color: #d7a2ff;
}

.terminal__body .dim {
  color: #667085;
}

/* ------------------------------------------------------------------ *
 * Sections
 * ------------------------------------------------------------------ */
.section {
  padding: 88px 0;
}

.section--soft {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.section__head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 52px;
}

.section__title {
  font-size: clamp(28px, 4.5vw, 42px);
  letter-spacing: -0.02em;
}

.section__sub {
  margin-top: 14px;
  font-size: 16.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ *
 * Card grid
 * ------------------------------------------------------------------ */
.grid {
  display: grid;
  gap: 16px;
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

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

@media (max-width: 840px) {
  .grid--3,
  .grid--2 {
    grid-template-columns: 1fr;
  }
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.card__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-bottom: 18px;
}

.card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.card p {
  font-size: 15px;
  color: var(--muted);
}

.card .mono {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

/* ------------------------------------------------------------------ *
 * Interface strip (API / MCP / Playground)
 * ------------------------------------------------------------------ */
.interface {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 28px;
}

.interface__icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 15px;
}

/* ------------------------------------------------------------------ *
 * FAQ
 * ------------------------------------------------------------------ */
.faq {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  font-weight: 600;
  color: var(--ink);
  font-size: 15.5px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  font-size: 20px;
  color: var(--muted);
  font-weight: 400;
  transition: transform 0.15s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq .faq__body {
  padding: 0 22px 20px;
  color: var(--muted);
  font-size: 15px;
}

/* ------------------------------------------------------------------ *
 * CTA band
 * ------------------------------------------------------------------ */
.cta {
  text-align: center;
  padding: 96px 0;
}

.cta h2 {
  font-size: clamp(28px, 4.5vw, 44px);
}

.cta p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
}

.cta__actions {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ *
 * Footer
 * ------------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 40px;
  background: var(--surface-soft);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 720px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

.site-footer__brand p {
  margin-top: 12px;
  max-width: 34ch;
  color: var(--muted);
  font-size: 14px;
}

.site-footer h4 {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

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

.site-footer ul a {
  color: var(--body);
  font-size: 14.5px;
  transition: color 0.15s ease;
}

.site-footer ul a:hover {
  color: var(--ink);
}

.site-footer__legal {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ *
 * Docs / prose pages
 * ------------------------------------------------------------------ */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 0 96px;
}

.prose h1 {
  font-size: clamp(32px, 5vw, 44px);
  margin-bottom: 20px;
}

.prose h2 {
  font-size: 22px;
  margin-top: 44px;
  margin-bottom: 12px;
}

.prose p {
  margin-bottom: 16px;
}

.prose ul,
.prose ol {
  margin: 0 0 20px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 8px;
}

.prose pre {
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 20px;
}

.prose code {
  font-size: 0.9em;
}

.prose :not(pre) > code {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ------------------------------------------------------------------ *
 * Playground
 * ------------------------------------------------------------------ */
.playground {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 0 96px;
}

.playground h1 {
  font-size: clamp(32px, 5vw, 44px);
  margin-bottom: 8px;
}

.playground .muted {
  color: var(--muted);
  margin-bottom: 32px;
}

.pg-form {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.pg-form select {
  flex: 0 0 auto;
  appearance: none;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 38px 12px 16px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.pg-form input {
  flex: 1 1 auto;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 0;
}

.pg-form input:focus,
.pg-form select:focus {
  outline: none;
  border-color: var(--brand-6);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-6) 20%, transparent);
}

.pg-output {
  background: var(--code-bg);
  color: var(--code-ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 140px;
  overflow-x: auto;
}

.pg-output .dim {
  color: #667085;
}

/* ------------------------------------------------------------------ *
 * Playground advanced config
 * ------------------------------------------------------------------ */
.pg-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .pg-config {
    grid-template-columns: 1fr;
  }
}

.pg-config label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.pg-config input {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

.pg-config input:focus {
  outline: none;
  border-color: var(--brand-6);
}

/* ------------------------------------------------------------------ *
 * Language switcher (header)
 * ------------------------------------------------------------------ */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 10px 0 12px;
  height: 38px;
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lang-switcher:hover {
  color: var(--ink);
}

.lang-switcher__icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.lang-switcher select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px 0 0;
}

.lang-switcher select:focus {
  outline: none;
}

/* ------------------------------------------------------------------ *
 * Footer languages
 * ------------------------------------------------------------------ */
.site-footer__languages {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.site-footer__languages a {
  color: var(--muted);
  font-size: 13px;
  transition: color 0.15s ease;
}

.site-footer__languages a:hover,
.site-footer__languages a.is-current {
  color: var(--ink);
}

.site-footer__languages a.is-current {
  font-weight: 600;
}
