/* Sanctuary marketing site — custom styles layered on top of Tailwind */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  font-family: 'General Sans', 'Inter', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, pre, kbd, samp {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Hide content until the dark-mode class has been resolved to prevent a flash */
.no-fouc body { visibility: hidden; }

/* Skip-to-content link reveals on focus */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: #fdfbf7;
  color: #1c1c1e;
  border-radius: 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: top 0.15s ease-out;
}
.skip-link:focus { top: 1rem; }

/* Subtle hero gradient (zen-gold glow in dark mode, warm sand in light) */
.hero-glow {
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(212, 180, 131, 0.18), transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(132, 169, 140, 0.12), transparent 70%);
}

/* Fade-in-up animation matching the app's utility */
@keyframes fadeInUp {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up { animation: fadeInUp 0.6s ease-out both; }
.animate-fade-in-up-1 { animation: fadeInUp 0.6s ease-out 0.08s both; }
.animate-fade-in-up-2 { animation: fadeInUp 0.6s ease-out 0.16s both; }
.animate-fade-in-up-3 { animation: fadeInUp 0.6s ease-out 0.24s both; }
.animate-fade-in-up-4 { animation: fadeInUp 0.6s ease-out 0.32s both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .animate-fade-in-up,
  .animate-fade-in-up-1,
  .animate-fade-in-up-2,
  .animate-fade-in-up-3,
  .animate-fade-in-up-4 { animation: none; }
}

/* Screenshot lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(100%, 1280px);
  max-height: 90vh;
  border-radius: 0.75rem;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

/* Screenshot thumbnails: zoom cursor + subtle hover lift */
.screenshot-thumb {
  cursor: zoom-in;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}
.screenshot-thumb:hover { transform: translateY(-2px); }

/* Mobile nav drawer */
.mobile-nav { display: none; }
.mobile-nav.open { display: block; }

/* Install-tabs: show only the active panel */
.install-panel { display: none; }
.install-panel.active { display: block; }
.install-tab[aria-selected='true'] {
  color: var(--tab-active-color, #45423e);
  border-bottom-color: currentColor;
}
.dark .install-tab[aria-selected='true'] { --tab-active-color: #f2efe9; }

/* Pre/code blocks — terminal feel */
pre.terminal {
  background: #0f0f10;
  color: #e6e0d4;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  overflow-x: auto;
  border: 1px solid #27272a;
}
pre.terminal .prompt { color: #84a98c; user-select: none; }

/* Card hover */
.card-hover {
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out;
}
.card-hover:hover { transform: translateY(-2px); }

/* ===========================================================
   Decorative section divider
   Two fading horizontal rules meet a small chop-mark of three
   zen-gold diamonds (center diamond larger than its neighbours).
   The visual echoes the isometric-cube glyph in the logo and
   deliberately avoids curves.
   =========================================================== */
.section-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 88px;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  color: #d4b483; /* zen-gold */
}
.section-rule::before,
.section-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  min-width: 1.5rem;
}
.section-rule::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(24, 24, 27, 0.10) 55%,
    rgba(212, 180, 131, 0.55) 100%
  );
}
.section-rule::after {
  background: linear-gradient(
    90deg,
    rgba(212, 180, 131, 0.55) 0%,
    rgba(24, 24, 27, 0.10) 45%,
    transparent 100%
  );
}
.dark .section-rule::before {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(244, 244, 245, 0.10) 55%,
    rgba(212, 180, 131, 0.55) 100%
  );
}
.dark .section-rule::after {
  background: linear-gradient(
    90deg,
    rgba(212, 180, 131, 0.55) 0%,
    rgba(244, 244, 245, 0.10) 45%,
    transparent 100%
  );
}
.section-rule .diamond {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: currentColor;
  transform: rotate(45deg);
  flex-shrink: 0;
}
.section-rule .diamond.sm {
  width: 5px;
  height: 5px;
  opacity: 0.55;
}
.section-rule .label {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #71717a; /* sanctuary-500 */
  white-space: nowrap;
}
.dark .section-rule .label { color: #a1a1aa; /* sanctuary-400 */ }

@media (max-width: 640px) {
  .section-rule { height: 64px; gap: 0.75rem; }
  .section-rule .label { font-size: 0.625rem; letter-spacing: 0.2em; }
}

/* ===========================================================
   Built-so-far timeline
   Horizontal release track with major (always-labelled) and
   minor (hover/focus-labelled) milestone points. Tap any to
   expand its detail panel below. The line fills in once when
   the section first scrolls into view; the active dot pulses.
   Falls back to a vertical layout under 640px.
   =========================================================== */

.timeline-track {
  position: relative;
  height: 170px;
  padding: 0 1rem;
}

.timeline-line {
  position: absolute;
  top: 50%;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: rgba(212, 180, 131, 0.22);
  border-radius: 9999px;
  transform: translateY(-50%);
  overflow: hidden;
}
.dark .timeline-line { background: rgba(212, 180, 131, 0.30); }

.timeline-line-fill {
  position: absolute;
  inset: 0 100% 0 0;
  background: linear-gradient(90deg, #d4b483 0%, #84a98c 100%);
  border-radius: 9999px;
  transition: right 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.timeline.is-revealed .timeline-line-fill { right: 0; }

.timeline-point {
  position: absolute;
  top: 50%;
  left: var(--pos);
  transform: translate(-50%, -50%);
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timeline-point:focus { outline: none; }
.timeline-point:focus-visible {
  outline: 2px solid #d4b483;
  outline-offset: 2px;
  border-radius: 9999px;
}

/* Hovered/focused/active points layer above neighbours so their tooltips
   and labels don't get hidden behind sibling dots and labels. */
.timeline-point:hover,
.timeline-point:focus-visible,
.timeline-point[aria-selected="true"] {
  z-index: 3;
}

.timeline-dot {
  display: block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  background: #a39e93;
  box-shadow: 0 0 0 4px #fafafa;
  transition: transform 0.18s ease-out, background 0.18s ease-out;
}
.dark .timeline-dot {
  box-shadow: 0 0 0 4px #09090b;
}

.timeline-point[data-major="true"] .timeline-dot {
  width: 0.95rem;
  height: 0.95rem;
  background: #d4b483;
}

.timeline-point:hover .timeline-dot,
.timeline-point:focus-visible .timeline-dot {
  transform: scale(1.25);
}

.timeline-point[aria-selected="true"] .timeline-dot {
  background: #45423e;
  transform: scale(1.4);
  animation: timelinePulse 2.6s ease-in-out infinite;
}
.dark .timeline-point[aria-selected="true"] .timeline-dot {
  background: #e6dcc8;
}

@keyframes timelinePulse {
  0%, 100% { box-shadow: 0 0 0 4px #fafafa, 0 0 0 5px rgba(212, 180, 131, 0); }
  50%      { box-shadow: 0 0 0 4px #fafafa, 0 0 0 10px rgba(212, 180, 131, 0.32); }
}
@keyframes timelinePulseDark {
  0%, 100% { box-shadow: 0 0 0 4px #09090b, 0 0 0 5px rgba(212, 180, 131, 0); }
  50%      { box-shadow: 0 0 0 4px #09090b, 0 0 0 10px rgba(212, 180, 131, 0.40); }
}
.dark .timeline-point[aria-selected="true"] .timeline-dot {
  animation-name: timelinePulseDark;
}

.timeline-label {
  position: absolute;
  top: calc(50% + 0.95rem);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
}

/* Major labels can opt in to render above the line via data-side="up". */
.timeline-point[data-major="true"][data-side="up"] .timeline-label {
  top: auto;
  bottom: calc(50% + 0.95rem);
}

.timeline-label-date {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #71717a;
}
.dark .timeline-label-date { color: #a1a1aa; }

.timeline-label-title {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #18181b;
  line-height: 1.2;
}
.dark .timeline-label-title { color: #fafafa; }

/* Minor points: hide label by default; reveal on hover/focus/active as a tooltip */
.timeline-point[data-major="false"] .timeline-label {
  opacity: 0;
  transform: translate(-50%, -4px);
  background: #18181b;
  color: #fafafa;
  padding: 0.4rem 0.6rem;
  border-radius: 0.375rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}
.dark .timeline-point[data-major="false"] .timeline-label {
  background: #fafafa;
  color: #18181b;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.timeline-point[data-major="false"] .timeline-label-date,
.timeline-point[data-major="false"] .timeline-label-title {
  color: inherit;
}

.timeline-point[data-major="false"]:hover .timeline-label,
.timeline-point[data-major="false"]:focus-visible .timeline-label,
.timeline-point[data-major="false"][aria-selected="true"] .timeline-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Detail panel container */
.timeline-details {
  padding: 1.25rem 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid #e4e4e7;
  background: #ffffff;
  min-height: 14rem;
}
.dark .timeline-details {
  border-color: #27272a;
  background: #18181b;
}

.timeline-detail { display: none; }
.timeline-detail[data-active] {
  display: block;
  animation: fadeInUp 0.32s ease-out both;
}

/* Mobile: vertical stack */
@media (max-width: 640px) {
  .timeline-track {
    height: auto;
    padding: 0 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .timeline-line {
    top: 0;
    bottom: 0;
    left: 0.6rem;
    right: auto;
    width: 2px;
    height: auto;
    transform: none;
  }
  .timeline-line-fill {
    inset: 100% 0 0 0;
    background: linear-gradient(180deg, #d4b483 0%, #84a98c 100%);
    transition: inset 1.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .timeline.is-revealed .timeline-line-fill { inset: 0; }

  .timeline-point {
    position: relative;
    top: auto;
    left: -0.65rem;
    transform: none;
    width: auto;
    height: auto;
    min-height: 2.5rem;
    padding: 0.5rem 0 0.5rem 1.6rem;
    justify-content: flex-start;
    text-align: left;
  }
  .timeline-dot {
    position: absolute;
    top: 0.85rem;
    left: 0;
    box-shadow: 0 0 0 4px #fafafa;
  }
  .dark .timeline-dot { box-shadow: 0 0 0 4px #09090b; }

  /* Reset every label to inline, always-visible on mobile (tooltip popovers
     don't make sense on touch, and above/below alternation is moot in a
     vertical layout). */
  .timeline-label,
  .timeline-point[data-major="false"] .timeline-label,
  .timeline-point[data-major="true"][data-side="up"] .timeline-label {
    position: static;
    top: auto;
    bottom: auto;
    transform: none;
    opacity: 1;
    background: transparent;
    color: #52525b;
    padding: 0;
    box-shadow: none;
    text-align: left;
    white-space: normal;
  }
  .dark .timeline-label,
  .dark .timeline-point[data-major="false"] .timeline-label {
    color: #a1a1aa;
  }
  .timeline-point[data-major="false"] .timeline-label-title {
    color: #18181b;
  }
  .dark .timeline-point[data-major="false"] .timeline-label-title {
    color: #fafafa;
  }

  /* Active point on mobile gets a left border accent instead of a pulse */
  .timeline-point[aria-selected="true"] .timeline-dot {
    animation: none;
  }
  .timeline-point[aria-selected="true"] .timeline-label-title::after {
    content: " ←";
    color: #d4b483;
  }
}

@media (prefers-reduced-motion: reduce) {
  .timeline-line-fill { transition: none; }
  .timeline-point[aria-selected="true"] .timeline-dot { animation: none; }
  .timeline-detail[data-active] { animation: none; }
}
