/* Reusable component styles */

/* ───── Buttons ───── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
  position: relative;
  border: 1px solid transparent;
}
.btn svg { width: 14px; height: 14px; }

.btn-primary {
  background: var(--ink-0);
  color: var(--bg-0);
  border-color: var(--ink-0);
}
.btn-primary:hover {
  background: var(--ink-1);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3), 0 0 24px var(--accent-glow);
}

.btn-accent {
  background: var(--accent);
  color: #0A0E1A;
  border-color: var(--accent);
}
.btn-accent:hover {
  box-shadow: 0 0 0 4px var(--accent-soft);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--ink-1);
  border-color: var(--line-2);
  background: transparent;
}
.btn-ghost:hover {
  background: var(--bg-2);
  border-color: var(--line-3);
  color: var(--ink-0);
}

.btn-link {
  color: var(--ink-1);
  height: auto;
  padding: 0;
  border: none;
}
.btn-link:hover {
  color: var(--accent);
}

.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }

/* ───── Chips / tags ───── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  font-size: 11px;
  font-family: var(--f-mono);
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.chip-accent { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }
.chip-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ───── Cards ───── */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-lg);
  transition: border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.card-hover:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Fine 1px divider with gradient */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  width: 100%;
}

/* ───── Titles ───── */
.h-display {
  font-size: clamp(40px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin: 0;
}
.h-section {
  font-size: clamp(32px, 4.2vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin: 0;
}
.h-sub {
  font-size: clamp(18px, 1.6vw, 22px);
  color: var(--ink-2);
  line-height: 1.5;
  font-weight: 400;
  max-width: 56ch;
  margin: 16px 0 0;
}

/* Gradient ink on a word */
.ink-gradient {
  background: linear-gradient(180deg, var(--ink-0), var(--ink-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.ink-accent {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ───── Nav ───── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in oklch, var(--bg-0) 72%, transparent);
  border-bottom: 1px solid var(--line-0);
  transition: all var(--dur-med) var(--ease-out);
}
.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--ink-2);
}
.nav-links a { transition: color var(--dur-fast); position: relative; }
.nav-links a:hover { color: var(--ink-0); }
.nav-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 22px;
  height: 22px;
  position: relative;
  border-radius: 6px;
  background: radial-gradient(circle at 30% 30%, var(--accent), color-mix(in oklch, var(--accent) 40%, var(--bg-0)));
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--accent) 50%, transparent), 0 0 16px var(--accent-glow);
}
.logo-mark::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.6);
  border-bottom: none;
  border-right: none;
  transform: rotate(45deg);
}

/* ───── Footer ───── */
.footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--line-1);
  position: relative;
  overflow: hidden;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer h4 {
  font-size: 11px;
  font-family: var(--f-mono);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 16px;
  font-weight: 500;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer a { color: var(--ink-1); font-size: 14px; transition: color var(--dur-fast); }
.footer a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--line-1);
  display: flex;
  justify-content: space-between;
  color: var(--ink-3);
  font-size: 12px;
  font-family: var(--f-mono);
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ───── Tweaks panel ───── */
.tweaks-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99;
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in oklch, var(--bg-1) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line-2);
  color: var(--ink-1);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--dur-med) var(--ease-spring),
              color var(--dur-fast), border-color var(--dur-fast),
              box-shadow var(--dur-fast);
}
.tweaks-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-md);
  transform: rotate(45deg);
}
.tweaks-toggle[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.tweaks {
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: 100;
  width: 300px;
  background: color-mix(in oklch, var(--bg-1) 92%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-spring);
}
.tweaks.on { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.tweaks-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-1);
}
.tweaks-head b { font-weight: 600; letter-spacing: -0.01em; }
.tweaks-body { padding: 8px 6px 12px; }
.tweak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px;
  gap: 12px;
}
.tweak-row > span:first-child {
  color: var(--ink-2);
  font-size: 12px;
}
.tweak-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.tweak-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--f-mono);
  transition: all var(--dur-fast);
}
.tweak-pill:hover { border-color: var(--line-2); color: var(--ink-0); }
.tweak-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.tweak-swatch {
  width: 22px; height: 22px;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  border: 1px solid var(--line-2);
}
.tweak-swatch.active::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
}

/* ───── Table ───── */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl th, .tbl td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line-1);
}
.tbl th {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 12px;
  font-family: var(--f-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tbl td { color: var(--ink-1); }

/* code block */
.code {
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  padding: 20px 22px;
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-1);
  overflow-x: auto;
}
.code .k { color: var(--accent); }
.code .s { color: var(--accent-3); }
.code .c { color: var(--ink-3); font-style: italic; }
.code .n { color: var(--accent-2); }
.code .f { color: #FFE08A; }

/* link with arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  transition: gap var(--dur-fast) var(--ease-out);
}
.link-arrow:hover { gap: 10px; }
.link-arrow::after {
  content: '→';
  font-family: var(--f-mono);
}

/* Badge row */
.logos-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 40px;
  align-items: center;
  opacity: 0.55;
}
.logos-row > div {
  text-align: center;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-transform: uppercase;
}
@media (max-width: 900px) {
  .logos-row { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
