/* ============================================
   Bonevil — Custom Styles
   ============================================ */

/* Text gradient */
.text-gradient {
  background: linear-gradient(135deg, #06b6d4, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hero gradient background */
.hero-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 30% 60%, rgba(168, 85, 247, 0.05) 0%, transparent 50%);
}

/* Subtle grid pattern */
.hero-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* Section dividers */
.section-divider {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 72rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08) 50%, transparent);
}

/* Navigation */
.nav-scrolled {
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(255,255,255,0.1);
}

/* Primary button */
.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: #fff;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.35);
  transform: translateY(-1px);
}

/* macOS download button — replaces App Store badge */
.btn-download-mac {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1.125rem 0.75rem 0.75rem;
  border-radius: 1rem;
  background: #0c0d10;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  transition: background 280ms ease, border-color 280ms ease, box-shadow 280ms ease, transform 280ms ease;
}

.btn-download-mac:hover,
.btn-download-mac:focus-visible {
  background: linear-gradient(95deg, #6ea8d6 0%, #5fc6ad 100%);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow:
    0 18px 36px rgba(6, 182, 212, 0.32),
    0 0 28px rgba(6, 182, 212, 0.35);
  transform: translateY(-1px);
}

.btn-download-mac[aria-disabled="true"] {
  cursor: default;
}

/* Icon container — pure 3D perspective stage, no background/border */
.btn-download-mac__icon {
  position: relative;
  flex-shrink: 0;
  width: 2.625rem;
  height: 2.625rem;
  perspective: 760px;
  transform-style: preserve-3d;
}

/* Icon faces — Apple flips away, white-tile-with-arrow flips in */
.btn-download-mac__icon-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  transition: transform 420ms cubic-bezier(0.2, 0.86, 0.24, 1), opacity 280ms ease;
  will-change: transform, opacity;
}

/* Default: large free-standing Apple logo, no tile */
.btn-download-mac__icon-apple {
  color: #fff;
  opacity: 1;
  transform-origin: center bottom;
  transform: translateY(0) rotateX(0deg) scaleY(1);
}

.btn-download-mac__icon-apple svg {
  width: 88%;
  height: 88%;
}

/* Hover: this face brings its own white rounded tile + dark arrow */
.btn-download-mac__icon-arrow {
  background: #ffffff;
  border-radius: 0.625rem;
  opacity: 0;
  transform-origin: center top;
  transform: translateY(-42%) rotateX(-92deg) scaleY(0.58);
}

.btn-download-mac__icon-arrow svg {
  width: 56%;
  height: 56%;
  color: #0c0d10;
}

.btn-download-mac:hover .btn-download-mac__icon-apple,
.btn-download-mac:focus-visible .btn-download-mac__icon-apple {
  opacity: 0;
  transform: translateY(36%) rotateX(88deg) scaleY(0.56);
}

.btn-download-mac:hover .btn-download-mac__icon-arrow,
.btn-download-mac:focus-visible .btn-download-mac__icon-arrow {
  opacity: 1;
  transform: translateY(0) rotateX(0deg) scaleY(1);
}

/* Two-line, right-aligned label */
.btn-download-mac__text {
  display: grid;
  justify-items: end;
  text-align: right;
  line-height: 1;
  color: #fff;
}

.btn-download-mac__text-top {
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.005em;
  color: rgba(249, 251, 255, 0.95);
}

.btn-download-mac__text-bottom {
  margin-top: 0.2rem;
  font-weight: 600;
  font-size: 1.625rem;
  letter-spacing: -0.025em;
  line-height: 0.9;
  color: rgba(243, 246, 251, 0.97);
}

@media (prefers-reduced-motion: reduce) {
  .btn-download-mac,
  .btn-download-mac__icon,
  .btn-download-mac__icon-face {
    transition: background 200ms ease, border-color 200ms ease, opacity 200ms ease;
  }
  .btn-download-mac:hover,
  .btn-download-mac:focus-visible { transform: none; }
  .btn-download-mac__icon-face { transform: none !important; }
  .btn-download-mac__icon-arrow { opacity: 0; }
  .btn-download-mac:hover .btn-download-mac__icon-apple,
  .btn-download-mac:focus-visible .btn-download-mac__icon-apple { opacity: 0; }
  .btn-download-mac:hover .btn-download-mac__icon-arrow,
  .btn-download-mac:focus-visible .btn-download-mac__icon-arrow { opacity: 1; }
}

/* "Coming soon" caption with pulsing dot — sits beneath the download button */
.coming-soon-caption {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #94a3b8;
}

.coming-soon-caption::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #06b6d4;
  box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.6);
  animation: coming-soon-pulse 2s infinite;
}

@keyframes coming-soon-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(6, 182, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .coming-soon-caption::before { animation: none; }
}

/* Runyard hero icon — dual-tone (cyan + purple) ambient halo */
.runyard-hero-icon {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.runyard-hero-icon::before {
  content: '';
  position: absolute;
  inset: -55%;
  background:
    radial-gradient(circle at 30% 50%, rgba(6, 182, 212, 0.32), transparent 55%),
    radial-gradient(circle at 70% 50%, rgba(168, 85, 247, 0.28), transparent 55%);
  filter: blur(28px);
  z-index: -1;
  pointer-events: none;
  animation: runyard-hero-glow 6s ease-in-out infinite;
}

@keyframes runyard-hero-glow {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .runyard-hero-icon::before { animation: none; opacity: 0.9; }
}

/* User Guide CTA — refined bordered pill with cyan-glow hover */
.btn-user-guide {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.375rem;
  border-radius: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: rgba(229, 231, 235, 0.9);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.btn-user-guide:hover,
.btn-user-guide:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.18);
  transform: translateY(-1px);
}

.btn-user-guide__arrow {
  display: inline-block;
  transition: transform 200ms ease;
}

.btn-user-guide:hover .btn-user-guide__arrow,
.btn-user-guide:focus-visible .btn-user-guide__arrow {
  transform: translateX(3px);
}

/* Feature cards */
.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.25s ease;
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(6, 182, 212, 0.2);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.05);
  transform: translateY(-2px);
}

/* Screenshot showcase — staggered rows */
.screenshot-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 4.5rem;
}

.screenshot-row:last-child {
  margin-bottom: 0;
}

.screenshot-row.reverse {
  flex-direction: row-reverse;
}

.screenshot-text {
  flex: 0 0 280px;
  min-width: 0;
}

.screenshot-text h3 {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.screenshot-text p {
  color: #8b949e;
  font-size: 0.95rem;
  line-height: 1.6;
}

.screenshot-image {
  min-width: 0;
}

.screenshot-image picture {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
}

.screenshot-image img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 28rem;
  display: block;
  border-radius: 0.75rem;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.3),
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  cursor: pointer;
}

.screenshot-image img:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.4),
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(6, 182, 212, 0.4),
    0 0 50px rgba(6, 182, 212, 0.15),
    0 0 0 1px rgba(6, 182, 212, 0.3);
}

/* Cyan glow behind image on hover */
.screenshot-image picture::before {
  content: '';
  position: absolute;
  inset: 15% 10%;
  background: radial-gradient(ellipse, rgba(6, 182, 212, 0.45) 0%, transparent 70%);
  filter: blur(20px);
  z-index: -1;
  transition: opacity 0.35s ease;
  opacity: 0;
}

.screenshot-image picture:hover::before {
  opacity: 1;
}

/* Gradient divider between screenshot rows */
.screenshot-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
  margin-bottom: 4.5rem;
}

/* Responsive: stack on mobile */
@media (max-width: 767px) {
  .screenshot-row,
  .screenshot-row.reverse {
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
  }

  .screenshot-text {
    flex: none;
    width: 100%;
  }

  .screenshot-divider {
    margin-bottom: 3rem;
  }
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 0.75rem;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  opacity: 1;
  transition: opacity 0.2s ease;
}

.lightbox-overlay.loading img {
  opacity: 0;
  transition: none;
}

.lightbox-spinner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #06b6d4;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  animation: lightbox-spin 0.8s linear infinite;
}

.lightbox-overlay.loading .lightbox-spinner {
  opacity: 1;
  transition-delay: 0.15s;
}

@keyframes lightbox-spin {
  to { transform: rotate(360deg); }
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
  background: none;
  border: none;
  padding: 0.5rem;
}

.lightbox-close:hover {
  color: #fff;
}

/* Smooth scrolling handled by Tailwind's scroll-smooth on html */

/* Selection color */
::selection {
  background: rgba(6, 182, 212, 0.3);
  color: #fff;
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #06b6d4;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbar (webkit) */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0e1a;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Docs (Runyard User Guide)
   ============================================ */

.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 767px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .docs-sidebar { display: none; }
}

.docs-sidebar {
  position: sticky;
  top: 6rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  font-size: 0.9rem;
}

.docs-sidebar-heading {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

.docs-sidebar-heading a {
  color: #06b6d4;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.docs-sidebar-heading a:hover {
  color: #22d3ee;
}

.docs-sidebar-heading.active a {
  opacity: 0.6;
  cursor: default;
}

.docs-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.docs-sidebar-list > li > a {
  display: block;
  padding: 0.4rem 0.6rem;
  color: #9ca3af;
  border-radius: 0.375rem;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.docs-sidebar-list > li > a:hover {
  color: #fff;
}

.docs-sidebar-list > li > a.active {
  color: #fff;
  border-left-color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
}

.on-this-page {
  list-style: none;
  padding: 0.25rem 0 0.25rem 0.9rem;
  margin: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  margin-left: 0.6rem;
}

.on-this-page li a {
  display: block;
  padding: 0.2rem 0.5rem;
  font-size: 0.82rem;
  color: #6b7280;
  text-decoration: none;
}

.on-this-page li a:hover { color: #d1d5db; }

.docs-mobile-toc {
  display: none;
}

@media (max-width: 767px) {
  .docs-mobile-toc {
    display: block;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
  }
  .docs-mobile-toc > summary {
    cursor: pointer;
    color: #d1d5db;
    font-weight: 600;
    font-size: 0.9rem;
  }
  .docs-mobile-toc[open] { padding-bottom: 1rem; }
}

/* Index landing cards */
.docs-index-lead {
  color: #9ca3af;
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.prose-doc .docs-index-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.prose-doc .docs-index-cards > li {
  margin: 0;
}

.prose-doc .docs-index-cards > li > a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.5rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.prose-doc .docs-index-cards > li > a:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(6, 182, 212, 0.25);
}

.docs-index-card-text { flex: 1; min-width: 0; }

.prose-doc .docs-index-cards > li > a::after {
  content: "\203a";
  color: rgba(6, 182, 212, 0.5);
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.prose-doc .docs-index-cards > li > a:hover::after {
  transform: translateX(4px);
  color: rgba(6, 182, 212, 0.9);
}

.prose-doc .docs-index-cards h3 {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
}

.prose-doc .docs-index-cards p {
  color: #9ca3af;
  font-size: 0.9rem;
  margin: 0;
}

/* Prose */
.prose-doc {
  max-width: 760px;
  color: #d1d5db;
  font-size: 1rem;
  line-height: 1.7;
}

.prose-doc h1 {
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem 0;
}

.prose-doc h2 {
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  scroll-margin-top: 5rem;
}

.prose-doc h3 {
  color: #e5e7eb;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
  scroll-margin-top: 5rem;
}

.prose-doc p { margin: 0 0 1rem; }

.prose-doc a {
  color: #22d3ee;
  text-decoration: underline;
  text-decoration-color: rgba(34, 211, 238, 0.35);
  text-underline-offset: 2px;
}

.prose-doc a:hover {
  color: #06b6d4;
  text-decoration-color: #06b6d4;
}

.prose-doc ul, .prose-doc ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.prose-doc ul:not(.docs-index-cards) { list-style: disc; }
.prose-doc ul:not(.docs-index-cards) ul { list-style: circle; }
.prose-doc ul:not(.docs-index-cards) ul ul { list-style: square; }
.prose-doc ol { list-style: decimal; }
.prose-doc li { margin: 0.25rem 0; }
.prose-doc li::marker { color: rgba(148, 163, 184, 0.7); }
.prose-doc li > p { margin: 0 0 0.5rem; }
.prose-doc li > ul, .prose-doc li > ol { margin: 0.25rem 0 0.5rem; }

.prose-doc strong { color: #fff; }

.prose-doc code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
  color: #e5e7eb;
}

.prose-doc pre {
  background: #0f1629;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.prose-doc pre code {
  background: none;
  padding: 0;
  color: #e5e7eb;
  font-size: 0.875rem;
}

/* Tables */
.prose-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.92rem;
}

.prose-doc thead {
  background: rgba(255, 255, 255, 0.04);
}

.prose-doc th, .prose-doc td {
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: top;
}

.prose-doc th { color: #fff; font-weight: 600; }

.prose-doc tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.prose-doc blockquote {
  border-left: 3px solid #06b6d4;
  padding: 0.5rem 1rem;
  background: rgba(6, 182, 212, 0.04);
  margin: 1rem 0;
  color: #d1d5db;
}

/* Pygments codehilite tokens (monokai-ish, tuned to navy palette) */
.codehilite .k, .codehilite .kn, .codehilite .kd, .codehilite .kr, .codehilite .kt { color: #06b6d4; }       /* keyword */
.codehilite .nf, .codehilite .nc, .codehilite .nb { color: #22d3ee; }                                      /* function/class/builtin */
.codehilite .s, .codehilite .s1, .codehilite .s2, .codehilite .se, .codehilite .sb { color: #a855f7; }     /* strings */
.codehilite .mi, .codehilite .mf, .codehilite .mh, .codehilite .m { color: #f59e0b; }                      /* numbers */
.codehilite .c, .codehilite .c1, .codehilite .cm, .codehilite .cp { color: #6b7280; font-style: italic; }  /* comments */
.codehilite .o { color: #d1d5db; }                                                                         /* operators */
.codehilite .nt { color: #06b6d4; }                                                                        /* HTML tag */
.codehilite .na { color: #22d3ee; }                                                                        /* attribute */
.codehilite .err { color: #f87171; }                                                                       /* error */