/* ==========================================================================
   Koko — shared shell styles
   Tailwind (Play CDN) handles layout and typography. This file holds the
   design atoms Tailwind utilities express awkwardly: hairline bento grids,
   accordion motion, clipboard feedback and reveal transitions.
   ========================================================================== */

:root {
  color-scheme: dark;
  --ink: #080808;
  --surface: #111111;
  --elevated: #151515;
  --line: #1f1f1f;
  --line-strong: #262626;
  --fg: #ededed;
  --fg-muted: #888888;
  --fg-faint: #555555;
  --accent: #10b981;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  background: var(--ink);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--fg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "calt";
  text-rendering: optimizeLegibility;
}

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

::selection {
  background: rgba(16, 185, 129, 0.22);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid rgba(16, 185, 129, 0.6);
  outline-offset: 2px;
  border-radius: 6px;
}

[hidden] {
  display: none !important;
}

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

/* Scrollbar ---------------------------------------------------------------- */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--ink);
}

::-webkit-scrollbar-thumb {
  background: #1f1f1f;
  border: 2px solid var(--ink);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2c2c2c;
}

/* Skip link ---------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
  color: var(--fg);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Buttons ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 2.5rem;
  padding: 0 1.1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: #ededed;
  color: #080808;
}

.btn-primary:hover {
  background: #ffffff;
}

.btn-primary:active {
  background: #dcdcdc;
}

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

.btn-ghost:hover {
  background: #101010;
  border-color: var(--line);
  color: var(--fg);
}

.btn-outline {
  background: #0c0c0c;
  border-color: var(--line-strong);
  color: var(--fg);
}

.btn-outline:hover {
  background: var(--surface);
  border-color: #333333;
}

.btn-sm {
  height: 2.125rem;
  padding: 0 0.85rem;
  font-size: 12.5px;
}

/* Brand + navigation ------------------------------------------------------- */

.logo-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  overflow: hidden;
  border-radius: 0.4rem;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #191919, #0c0c0c);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.navlink {
  position: relative;
  font-size: 13.5px;
  color: var(--fg-muted);
  transition: color 0.15s ease;
}

.navlink:hover,
.navlink[aria-current="page"] {
  color: var(--fg);
}

.nav-toggle {
  display: grid;
  place-items: center;
  height: 2.25rem;
  width: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-toggle:hover {
  color: var(--fg);
  border-color: var(--line-strong);
}

.mobile-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.15rem;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--fg-muted);
  transition: color 0.15s ease;
}

.mobile-link:hover,
.mobile-link[aria-current="page"] {
  color: var(--fg);
}

/* Type atoms --------------------------------------------------------------- */

.eyebrow {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.cmd-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid #262626;
  background: #171717;
  color: #a3a3a3;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.15rem;
  white-space: nowrap;
}

/* Inputs ------------------------------------------------------------------- */

.input-field {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s ease, background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.input-field::placeholder {
  color: var(--fg-faint);
}

.input-field:hover {
  border-color: var(--line-strong);
}

.input-field:focus {
  outline: none;
  border-color: #3a3a3a;
  background: #141414;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
}

.kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 0.25rem;
  border: 1px solid var(--line-strong);
  background: var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-faint);
}

/* Segmented control -------------------------------------------------------- */

.seg {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 2px;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
  background: var(--surface);
}

.seg-btn {
  display: inline-grid;
  place-items: center;
  height: 2rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.seg-btn:hover {
  color: var(--fg);
}

.seg-btn[aria-pressed="true"] {
  background: #1c1c1c;
  color: var(--fg);
  box-shadow: inset 0 0 0 1px #2b2b2b;
}

/* Filter chips ------------------------------------------------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.9rem;
  padding: 0 0.7rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease,
    border-color 0.15s ease;
}

.chip:hover {
  color: var(--fg);
  background: #101010;
}

.chip[aria-pressed="true"] {
  background: #151515;
  border-color: var(--line-strong);
  color: var(--fg);
}

/* Cards -------------------------------------------------------------------- */

.card {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--surface);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.card-hover:hover {
  border-color: var(--line-strong);
  background: var(--elevated);
}

.cmd-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cmd-card:hover {
  border-color: var(--line-strong);
  background: var(--elevated);
}

.copy-label {
  flex: none;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-faint);
  transition: color 0.15s ease, border-color 0.15s ease,
    background-color 0.15s ease;
}

.cmd-card:hover .copy-label {
  border-color: var(--line-strong);
  color: var(--fg-muted);
}

.cmd-card[data-copied="true"] .copy-label,
.copy-btn[data-copied="true"] {
  border-color: rgba(16, 185, 129, 0.32);
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent);
}

/* Status ------------------------------------------------------------------- */

.status-dot {
  position: relative;
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 999px;
  animation: status-pulse 2.8s var(--ease) infinite;
}

@keyframes status-pulse {
  0% {
    opacity: 0.7;
    transform: scale(0.8);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.4);
  }
}

/* Hero backdrop ------------------------------------------------------------ */

.grid-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background-image: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(
    ellipse 65% 55% at 50% 0%,
    #000 25%,
    transparent 78%
  );
  mask-image: radial-gradient(
    ellipse 65% 55% at 50% 0%,
    #000 25%,
    transparent 78%
  );
}

/* Accordion ---------------------------------------------------------------- */

.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.24s var(--ease);
}

.faq-panel > div {
  overflow: hidden;
}

.faq-item[data-open="true"] .faq-panel {
  grid-template-rows: 1fr;
}

.faq-chevron {
  flex: none;
  color: var(--fg-faint);
  transition: transform 0.2s var(--ease), color 0.15s ease;
}

.faq-item[data-open="true"] .faq-chevron {
  transform: rotate(180deg);
  color: var(--fg-muted);
}

.faq-trigger:hover .faq-question {
  color: #ffffff;
}

/* Reveal ------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(8px);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

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

  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .status-dot::after {
    animation: none;
    opacity: 0.3;
  }

  .faq-panel,
  .faq-chevron {
    transition: none;
  }
}
