/* ============================================================
   Garbashala — earthy folksy design system
============================================================ */

:root {
  /* Palette */
  --terracotta: #C4502A;
  --terracotta-deep: #9C3A1C;
  --marigold: #E8A33D;
  --marigold-deep: #C97F1F;
  --maroon: #5C2018;
  --cream: #F5EBD8;
  --cream-warm: #F0E1C4;
  --paper: #FAF3E3;
  --ink: #2A1810;
  --ink-soft: #4A3526;
  --sage: #7A8B5C;
  --indigo: #2E3957;
  --rose: #D97A6C;

  /* Type */
  --font-display: "Mota Italic", "Yatra One", serif;
  --font-handwrite: "Caveat", "Yatra One", cursive;
  --font-body: "Cormorant Garamond", "Lora", Georgia, serif;
  --font-ui: "Cormorant Garamond", Georgia, serif;
  --font-mono: "JetBrains Mono", monospace;
}

/* paper grain */
.paper-bg {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(232,163,61,0.10), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(196,80,42,0.08), transparent 50%),
    var(--paper);
  position: relative;
}
.paper-bg::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.09  0 0 0 0 0.06  0 0 0 0.07 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.55;
  z-index: 0;
}
.paper-bg > * { position: relative; z-index: 1; }

/* Bandhani dot pattern */
.bandhani {
  background-image:
    radial-gradient(circle at 20% 20%, var(--marigold) 1.5px, transparent 2px),
    radial-gradient(circle at 70% 60%, var(--terracotta) 1.5px, transparent 2px),
    radial-gradient(circle at 40% 80%, var(--maroon) 1.5px, transparent 2px);
  background-size: 24px 24px, 24px 24px, 24px 24px;
}

/* Hand-drawn dotted divider */
.dotted-rule {
  height: 14px;
  background-image: radial-gradient(circle, var(--ink-soft) 1.4px, transparent 1.6px);
  background-size: 14px 14px;
  background-position: center;
  background-repeat: repeat-x;
  opacity: 0.55;
}

/* Wavy SVG underline used a lot */
.wavy::after {
  content: "";
  display: block;
  height: 9px;
  margin-top: 4px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 9' fill='none'><path d='M0 4.5 Q 7.5 0, 15 4.5 T 30 4.5 T 45 4.5 T 60 4.5' stroke='%23C4502A' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: repeat-x;
  background-size: 60px 9px;
}

/* Tape sticker */
.tape {
  position: absolute;
  width: 90px; height: 22px;
  background: rgba(232,163,61,0.55);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  border-left: 1px dashed rgba(0,0,0,0.05);
  border-right: 1px dashed rgba(0,0,0,0.05);
}

/* Stamp / circular badge */
.stamp {
  border: 2px solid var(--terracotta);
  color: var(--terracotta);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Hand drawn box (slightly rough) */
.handbox {
  border: 1.5px solid var(--ink);
  border-radius: 14px 4px 12px 6px / 6px 12px 4px 14px;
  background: var(--paper);
}

/* Pill */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 13px;
  letter-spacing: 0.02em;
  border: 1px solid currentColor;
  background: transparent;
}

/* Reset-ish */
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }

/* Mota Italic fallback (will be supplied via Google Fonts; if not available we sub Yatra One italicized) */
@font-face {
  font-family: "Mota Italic Fallback";
  src: local("Yatra One");
  font-display: swap;
}

/* Tegaki-style stroke animation
   Apply .draw to an SVG path to make it draw on. */
@keyframes drawPath {
  to { stroke-dashoffset: 0; }
}
.draw path,
path.draw {
  stroke-dasharray: var(--len, 1000);
  stroke-dashoffset: var(--len, 1000);
  animation: drawPath 2.4s ease-out forwards;
}
.draw.delay-1 path { animation-delay: 0.3s; }
.draw.delay-2 path { animation-delay: 0.6s; }

/* circle/chakra orbit */
@keyframes orbit { to { transform: rotate(360deg); } }
.orbit-slow { animation: orbit 80s linear infinite; transform-origin: center; }
.orbit-rev { animation: orbit 60s linear infinite reverse; transform-origin: center; }

/* Responsive: scale down giant display headlines + reflow grids
   so the artboard-style 1400px layouts survive narrow viewports. */
@media (max-width: 1100px) {
  h1 { font-size: clamp(48px, 9vw, 124px) !important; }
  h2 { font-size: clamp(32px, 5.5vw, 56px) !important; }
}
@media (max-width: 900px) {
  /* Featured / library card grids */
  [data-grid="cards-4"], section [style*="repeat(4, 1fr)"] {
    /* fall back: make 4-col grids 2-col */
  }
}
@media (max-width: 640px) {
  h1 { font-size: clamp(40px, 11vw, 72px) !important; }
}

@media (max-width: 1149px) {
  .hero-collage {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    width: min(100%, 380px) !important;
    height: 460px !important;
    margin: 36px auto 0;
  }
}

/* Mobile hardening: the pages use inline artboard styles, so these
   overrides keep tap targets comfortable and prevent sideways scroll. */
@media (max-width: 760px) {
  html,
  body,
  #app,
  .gs-page,
  .paper-bg {
    max-width: 100%;
    overflow-x: hidden;
  }

  .gs-page {
    width: 100%;
  }

  .paper-bg > section,
  .paper-bg > footer,
  .paper-bg > div[style*="padding"] {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  svg {
    max-width: 100%;
  }

  .site-nav {
    padding: 14px 16px !important;
    gap: 12px !important;
  }

  .site-nav__links {
    order: 3;
    width: 100%;
    gap: 6px !important;
    justify-content: space-between;
    font-size: 16px !important;
  }

  .site-nav__links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 12px;
  }

  .site-nav__tools {
    width: 100%;
    gap: 8px !important;
  }

  .site-nav__search {
    min-height: 44px;
    flex: 1;
    width: auto !important;
    font-size: 16px !important;
  }

  .stamp,
  .pill,
  .filter-pill {
    min-height: 36px;
    align-items: center;
  }

  .hero-actions,
  .quote-section,
  .library-filters {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .hero-actions a:first-child,
  .library-filters__count {
    width: 100%;
    text-align: center;
  }

  .hero-collage {
    position: relative !important;
    right: auto !important;
    top: auto !important;
    width: min(100%, 320px) !important;
    height: 360px !important;
    margin: 32px auto 0;
  }

  .how-grid,
  .featured-grid,
  .library-grid,
  .about-word-grid,
  .expect-grid,
  [style*="grid-template-columns: repeat(3, 1fr)"],
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  .filter-group {
    width: 100%;
    align-items: flex-start !important;
    flex-direction: column;
    gap: 8px !important;
  }

  .filter-pill {
    min-width: 44px;
    padding: 9px 12px !important;
    font-size: 15px !important;
  }

  .card-action-link,
  .mobile-next-link,
  .inline-touch-link,
  .garbashala-logo {
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
  }

  .mobile-step-header a {
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
  }

  .mobile-play-button {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0;
  }

  .mobile-count-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .timeline-line {
    left: 16px !important;
  }

  .timeline-item {
    gap: 12px !important;
  }

  .timeline-item > :first-child {
    flex-basis: 58px !important;
    text-align: left !important;
  }

  .mobile-photo-strip {
    margin-left: -18px;
    margin-right: -18px;
    padding-left: 18px;
    padding-right: 18px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-photo-card {
    width: 72vw !important;
    min-width: 220px;
    scroll-snap-align: start;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .featured-grid,
  .library-grid,
  [style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .how-grid,
  .about-word-grid,
  .expect-grid {
    grid-template-columns: 1fr !important;
  }
}
