/* Gistrel — shared styles (on top of Tailwind CDN utilities) */

:root {
  --ink: #14110f;
  --rust: #d0612f;
  --slate: #4a6589;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection {
  background: rgba(208, 97, 47, 0.22);
}

/* ---------- Type helpers ---------- */
.display {
  letter-spacing: -0.045em;
  line-height: 0.98;
  font-weight: 800;
}
.text-gradient {
  background: linear-gradient(100deg, #e07c48 0%, #d0612f 40%, #4a6589 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.serif-italic {
  font-family: Newsreader, Georgia, serif;
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* ---------- Header ---------- */
.site-header {
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}

/* ---------- Backgrounds ---------- */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(20, 17, 15, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 17, 15, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}
.bg-grid-dark {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 20%, transparent 75%);
}
.blob {
  position: absolute;
  border-radius: 9999px;
  filter: blur(70px);
  opacity: 0.55;
  pointer-events: none;
}
.noise::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- App window mockups ---------- */
.app-window {
  position: relative;
  background: #fff;
  border-radius: 1.1rem;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(20, 17, 15, 0.07),
    0 40px 80px -30px rgba(143, 59, 28, 0.3),
    0 20px 40px -20px rgba(20, 17, 15, 0.22);
}
.app-window .tl {
  display: flex;
  gap: 6px;
}
.app-window .tl span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

/* Annotated reader */
.reader {
  font-family: Newsreader, Georgia, serif;
}
.mark-new {
  background: linear-gradient(transparent 55%, rgba(208, 97, 47, 0.22) 55%);
}
.mark-known {
  color: #9a918a;
  text-decoration: line-through;
  text-decoration-color: rgba(154, 145, 138, 0.5);
}
.mark-twist {
  background: linear-gradient(transparent 55%, rgba(74, 101, 137, 0.2) 55%);
}

/* Video timeline */
.timeline {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: #ece6df;
  overflow: hidden;
}
.timeline > span {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

/* UI-inspiration thumbnails (pure CSS, no media) */
.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 0.9rem;
  overflow: hidden;
}
.thumb .pill {
  position: absolute;
  left: 18%;
  right: 18%;
  height: 14%;
  border-radius: 999px;
}
.thumb .field {
  position: absolute;
  left: 18%;
  right: 18%;
  height: 11%;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.85);
}
.shimmer {
  animation: shimmer 2.8s ease-in-out infinite;
}
@keyframes shimmer {
  0%,
  100% {
    transform: scaleX(0.92);
    opacity: 0.85;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* Processing state dots */
.processing::after {
  content: '…';
  display: inline-block;
  width: 1em;
  animation: dots 1.4s steps(4) infinite;
  overflow: hidden;
  vertical-align: bottom;
}
@keyframes dots {
  from {
    width: 0;
  }
  to {
    width: 1em;
  }
}

/* ---------- Floating / reveal animations ---------- */
.float-slow {
  animation: floaty 7s ease-in-out infinite;
}
.float-slower {
  animation: floaty 9s ease-in-out infinite;
  animation-delay: -3s;
}
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal-d1 {
  transition-delay: 0.08s;
}
.reveal-d2 {
  transition-delay: 0.16s;
}
.reveal-d3 {
  transition-delay: 0.24s;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .float-slow,
  .float-slower,
  .shimmer,
  .processing::after,
  .pulse-dot::after {
    animation: none !important;
  }
}

/* ---------- Status dot ---------- */
.pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e07c48;
}
.pulse-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  75%,
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* ---------- Legal pages ---------- */
.prose-legal h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.75rem;
  color: #14110f;
  scroll-margin-top: 6rem;
}
.prose-legal h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: #14110f;
}
.prose-legal p,
.prose-legal li {
  color: #4a423b;
  line-height: 1.75;
}
.prose-legal p {
  margin: 0.75rem 0;
}
.prose-legal ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0.75rem 0;
}
.prose-legal li {
  margin: 0.35rem 0;
}
.prose-legal a {
  color: #b34c22;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose-legal strong {
  color: #1d1916;
}

/* ---------- Details / FAQ ---------- */
details > summary {
  list-style: none;
  cursor: pointer;
}
details > summary::-webkit-details-marker {
  display: none;
}
details[open] .faq-plus {
  transform: rotate(45deg);
}
.faq-plus {
  transition: transform 0.2s ease;
}
