/* =============================================================
   Global Styles — Sprout & Co.
   ============================================================= */

/* TODO: Update these tokens to match your brand colour palette */
:root {
  --bg: #fdfbf7;
  --surface: #f4f1eb;
  --primary: #c57d5c;
  --text-main: #1c1e21;
  --text-muted: #5a5d64; /* Contrast ratio meets WCAG AA; original #6b6e75 did not */
}

/* Dark mode overrides are in dark-mode.css */

/* =============================================================
   Smooth Scroll (Lenis)
   ============================================================= */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* =============================================================
   Base Body
   ============================================================= */
body {
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
  overflow-x: hidden;
}

/* =============================================================
   Form Inputs
   ============================================================= */
.form-input {
  width: 100%;
  background-color: var(--surface);
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(212, 154, 128, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

/* =============================================================
   Scrollbar
   ============================================================= */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  opacity: 0.2;
  border-radius: 10px;
}

/* Hides scrollbar on horizontal scroll containers */
.hide-scroll::-webkit-scrollbar {
  display: none;
}

.hide-scroll {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* =============================================================
   Details / Summary Accordion
   ============================================================= */
details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

/* =============================================================
   Custom Checkbox
   ============================================================= */
input[type="checkbox"] {
  appearance: none;
  background-color: transparent;
  margin: 0;
  font: inherit;
  color: currentColor;
  width: 1.15em;
  height: 1.15em;
  border: 1.5px solid var(--text-muted);
  border-radius: 0.25em;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

input[type="checkbox"]::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--background);
  background-color: var(--background);
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked {
  background-color: var(--text-main);
  border-color: var(--text-main);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

/* =============================================================
   Marquee Auto-scroll Animation
   ============================================================= */
@keyframes scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-50% - 0.75rem));
  }
}

.marquee-content {
  animation: scroll 20s linear infinite;
}

.marquee-container:hover .marquee-content {
  animation-play-state: paused;
}

[dir="rtl"] .marquee-content {
  animation-direction: reverse;
}

/* =============================================================
   Sticky Navigation
   ============================================================= */
nav {
  transition:
    background-color 0.3s ease,
    backdrop-filter 0.3s ease,
    border-bottom 0.3s ease,
    padding 0.3s ease,
    color 0.3s ease;
}

nav.nav-scrolled {
  background-color: var(--bg) !important;
  border-bottom: 1px solid rgba(107, 110, 117, 0.1);
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

/* Hero-aware nav: transparent over the hero section (index.html) */
nav.nav-over-hero {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}

nav.nav-over-hero .nav-brand,
nav.nav-over-hero .nav-links a {
  color: #ffffff;
}

/* Hero-aware nav: solid background once user scrolls past hero (index.html) */
[data-theme="dark"] nav.nav-past-hero {
  background: rgba(28, 30, 33, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] nav.nav-past-hero {
  background: rgba(250, 247, 244, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] nav.nav-past-hero .nav-brand,
[data-theme="dark"] nav.nav-past-hero .nav-links a {
  color: #ffffff;
}

[data-theme="light"] nav.nav-past-hero .nav-brand,
[data-theme="light"] nav.nav-past-hero .nav-links a {
  color: #1c1e21;
}

/* =============================================================
   Mobile Touch Targets (min 44px per WCAG 2.5.5)
   ============================================================= */
@media (max-width: 640px) {

  button,
  a,
  select,
  [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }

  input,
  textarea {
    min-height: 44px;
  }

  nav a {
    min-height: auto;
    min-width: auto;
  }
}

/* =============================================================
   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;
  }

  .marquee-content {
    animation: none !important;
  }
}

/* =============================================================
   Utility Classes
   ============================================================= */

/* Hero image overlay layers (index.html) */
.hero-overlay-base {
  background: rgba(0, 0, 0, 0.45);
}

.hero-overlay-gradient {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.55) 55%,
    rgba(0, 0, 0, 0.92) 100%
  );
}

.hero-overlay-top {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.55) 0%,
    transparent 25%
  );
}

/* Hero description text color */
.hero-desc {
  color: rgba(255, 255, 255, 0.75);
}

/* Stacked sticky philosophy cards (index.html) */
.phil-card-1 {
  z-index: 1;
}

.phil-card-2 {
  z-index: 2;
}

.phil-card-3 {
  z-index: 3;
}

/* Auth page image panel overlays (login.html / signup.html) */
.auth-overlay-login {
  background: linear-gradient(
    135deg,
    rgba(197, 125, 92, 0.4) 0%,
    rgba(20, 20, 20, 0.8) 100%
  );
  mix-blend-mode: multiply;
}

.auth-overlay-signup {
  background: linear-gradient(
    135deg,
    rgba(80, 125, 92, 0.4) 0%,
    rgba(20, 20, 20, 0.8) 100%
  );
  mix-blend-mode: multiply;
}

/* Horizontal mirror flip */
.img-flip-x {
  transform: scaleX(-1);
}

/* CSS grid line background pattern (index2.html) */
.grid-pattern {
  background-image:
    linear-gradient(var(--text-main) 1px, transparent 1px),
    linear-gradient(90deg, var(--text-main) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* CSS radial dot background pattern (contact.html) */
.dot-pattern {
  background-image: radial-gradient(
    var(--text-main) 1px,
    transparent 1px
  );
  background-size: 20px 20px;
}