/* =============================================================
   FrogPaper — styles.css
   Custom design tokens, animations, and overrides on top of Tailwind.
   ============================================================= */

:root {
  /* Color tokens (HSL channels, used via Tailwind config) */
  --background: 220 49% 8%;
  --foreground: 214 40% 94%;
  --paper: 214 40% 94%;
  --paper-foreground: 220 49% 8%;
  --paper-muted: 213 26% 65%;
  --primary: 158 62% 52%;
  --secondary: 218 42% 19%;
  --muted: 218 47% 11%;
  --muted-foreground: 213 26% 65%;
  --accent: 158 62% 52%;
  --copper: 160 84% 39%;
  --card: 218 45% 13%;
  --card-foreground: 214 40% 94%;
  --border: 217 40% 21%;
  --destructive: 0 84% 71%;
  --radius: 0.75rem;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  /* Layered ambient gradients matching the original */
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(11, 18, 32, 0.92), rgba(0, 0, 0, 0) 60%),
    radial-gradient(80% 60% at 90% 10%, rgba(52, 211, 153, 0.07), rgba(0, 0, 0, 0) 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Heading font with optical sizing */
.font-heading {
  font-family: ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-optical-sizing: auto;
}

/* Smooth focus outlines */
*:focus-visible {
  outline: 2px solid hsl(var(--copper));
  outline-offset: 2px;
  border-radius: 4px;
}

/* =============================================================
   ANIMATIONS — mirror the original @keyframes set
   ============================================================= */

/* Sheen sweeps across gallery cards on hover */
.sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}
.sheen::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent,
    rgba(255, 255, 255, 0.18) 50%,
    transparent
  );
  transform: skewX(-18deg);
  transition: left 0.7s ease;
}
article:hover .sheen::before {
  left: 130%;
}

/* Floating decor — slow vertical drift */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(1deg); }
}
.float-slow {
  animation: float-slow 7s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(8px, -6px); }
  50% { transform: translate(-4px, 8px); }
  75% { transform: translate(-8px, -4px); }
}

/* Pulse — version pill / status dots */
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Spin — reserved for loading indicators */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Accordion expansion (CSS-only fallback) */
@keyframes accordion-down {
  from { height: 0; opacity: 0; }
  to { height: var(--radix-accordion-content-height, auto); opacity: 1; }
}
@keyframes accordion-up {
  from { height: var(--radix-accordion-content-height, auto); opacity: 1; }
  to { height: 0; opacity: 0; }
}

/* Enter / exit — used by IntersectionObserver fades */
@keyframes enter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes exit {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-20px); }
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================================
   GALLERY — drag-to-scroll + snap-x carousel
   ============================================================= */
#galleryTrack,
#madeTrack {
  cursor: grab;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  user-select: none;
  will-change: transform;
}
#galleryTrack.is-dragging,
#madeTrack.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
}
#galleryTrack > article,
#madeTrack > figure {
  scroll-snap-align: start;
}
/* Stop the browser's native image-drag from hijacking the pointer drag */
#galleryTrack img,
#madeTrack img {
  -webkit-user-drag: none;
  user-drag: none;
}

/* =============================================================
   COMPARISON TABLE — responsive tweaks
   ============================================================= */
@media (max-width: 640px) {
  section#compare .grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    font-size: 0.78rem;
    gap: 4px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* =============================================================
   ACCORDION (details/summary) — polish the default marker
   ============================================================= */
details > summary {
  list-style: none;
}
details > summary::-webkit-details-marker {
  display: none;
}
details[open] > summary span {
  transform: rotate(45deg);
}
details[open] summary + p {
  animation: enter 0.3s ease both;
}

/* =============================================================
   SCROLLBAR — subtle, themed
   ============================================================= */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: hsl(var(--background));
}
::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--copper) / 0.5);
}

/* =============================================================
   SELECTION
   ============================================================= */
::selection {
  background: hsl(var(--copper) / 0.3);
  color: hsl(var(--paper));
}

/* =============================================================
   REDUCED MOTION
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .float-slow { animation: none; }
  .pumpkin-bob { animation: none; }
}

/* =============================================================
   HALLOWEEN EDITION (v1.7.0) — seasonal accents
   ============================================================= */
@keyframes pumpkin-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}
.pumpkin-bob {
  display: inline-block;
  animation: pumpkin-bob 3.5s ease-in-out infinite;
}

/* =============================================================
   HERO FOOTER — "Est. 2026 / Scroll to unfold"
   Hidden by default (display:none) to prevent overlap with the
   button row on short viewports. Shown via flex on viewports
   >= 1000px tall, where there's room for both the centered
   content stack AND the absolute-positioned bottom footer.
   1000px was chosen empirically: at 900px the buttons still
   overlapped the footer by ~38px; at 1000px there's clear space.
   ============================================================= */
.hero-footer {
  display: none;
}
@media (min-height: 1000px) {
  .hero-footer {
    display: flex;
  }
}

/* =============================================================
   HERO MASCOT — pirate Halloween frog
   The prebuilt output.css doesn't include arbitrary Tailwind
   h-[Npx] classes, so we drive the height directly from here.
   Inline `style="height: 140px"` provides the mobile default;
   media queries override at each breakpoint.
   ============================================================= */
.hero-mascot {
  display: block;
  width: auto;
}
@media (min-width: 640px)  { .hero-mascot { height: 165px !important; } }
@media (min-width: 768px)  { .hero-mascot { height: 185px !important; } }
@media (min-width: 1280px) { .hero-mascot { height: 210px !important; } }
@media (min-width: 1536px) { .hero-mascot { height: 230px !important; } }
