/* ==========================================================================
   Nobregas.org, application styles
   Custom utilities and component polish that DaisyUI/Tailwind do not cover.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Brand themes.
   The Tailwind CSS browser CDN build does not support @plugin config blocks,
   so the DaisyUI themes are declared here as plain CSS custom properties.
   DaisyUI's component CSS reads these var(--color-*) tokens at runtime.
   -------------------------------------------------------------------------- */
[data-theme="nobregas"] {
  color-scheme: light;
  --color-base-100: #ffffff;
  --color-base-200: #f1f5f9;
  --color-base-300: #e2e8f0;
  --color-base-content: #0f172a;
  --color-primary: #3b82f6;
  --color-primary-content: #ffffff;
  --color-secondary: #6366f1;
  --color-secondary-content: #ffffff;
  --color-accent: #06b6d4;
  --color-accent-content: #ffffff;
  --color-neutral: #64748b;
  --color-neutral-content: #ffffff;
  --color-info: #3b82f6;
  --color-info-content: #ffffff;
  --color-success: #22c55e;
  --color-success-content: #ffffff;
  --color-warning: #f59e0b;
  --color-warning-content: #ffffff;
  --color-error: #ef4444;
  --color-error-content: #ffffff;
  --radius-selector: 1rem;
  --radius-field: 0.5rem;
  --radius-box: 1rem;
  --size-selector: 0.25rem;
  --size-field: 0.25rem;
  --border: 1px;
  --depth: 1;
  --noise: 0;
}

[data-theme="nobregas-dark"] {
  color-scheme: dark;
  --color-base-100: #0d1117;
  --color-base-200: #161b22;
  --color-base-300: #1c2128;
  --color-base-content: #f1f5f9;
  --color-primary: #3b82f6;
  --color-primary-content: #ffffff;
  --color-secondary: #6366f1;
  --color-secondary-content: #ffffff;
  --color-accent: #06b6d4;
  --color-accent-content: #ffffff;
  --color-neutral: #1e2530;
  --color-neutral-content: #94a3b8;
  --color-info: #3b82f6;
  --color-info-content: #ffffff;
  --color-success: #22c55e;
  --color-success-content: #ffffff;
  --color-warning: #f59e0b;
  --color-warning-content: #ffffff;
  --color-error: #ef4444;
  --color-error-content: #ffffff;
  --radius-selector: 1rem;
  --radius-field: 0.5rem;
  --radius-box: 1rem;
  --size-selector: 0.25rem;
  --size-field: 0.25rem;
  --border: 1px;
  --depth: 1;
  --noise: 0;
}

:root {
  --nb-shell-max: 80rem; /* 1280px content rail */
}

/* Smooth, accessible focus rings sitewide */
*:focus-visible {
  outline: 2px solid var(--color-primary, #3b82f6);
  outline-offset: 2px;
  border-radius: 4px;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Content rail helper, keeps every section aligned */
.nb-shell {
  width: 100%;
  max-width: var(--nb-shell-max);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* Gradient brand text (hero, section eyebrows) */
.nb-text-gradient {
  background-image: linear-gradient(120deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-block: 0.1em;
}

.nb-text-gradient-hero {
  background-image: linear-gradient(120deg, #0f172a, #475569);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-block: 0.12em;
  line-height: 1.1;
}
[data-theme="nobregas-dark"] .nb-text-gradient-hero {
  background-image: linear-gradient(120deg, #ffffff, #94a3b8);
}

/* Primary CTA gradient overlay (kept subtle, brand to secondary) */
.btn-brand {
  background-image: linear-gradient(120deg, var(--color-primary), var(--color-secondary));
  border: none;
  color: #fff;
  box-shadow: 0 10px 15px -3px color-mix(in oklch, var(--color-primary) 25%, transparent);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.btn-brand:hover {
  box-shadow: 0 20px 25px -5px color-mix(in oklch, var(--color-primary) 40%, transparent);
  transform: translateY(-1px);
}

/* Icon tile used on feature/category cards */
.nb-icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
  background: color-mix(in oklch, var(--color-primary) 10%, transparent);
  border: 1px solid color-mix(in oklch, var(--color-primary) 20%, transparent);
  color: var(--color-primary);
  flex: none;
}
.nb-icon-tile.is-accent {
  background: color-mix(in oklch, var(--color-accent) 12%, transparent);
  border-color: color-mix(in oklch, var(--color-accent) 22%, transparent);
  color: var(--color-accent);
}

/* Soft elevation for cards on hover */
.nb-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.nb-card:hover {
  transform: translateY(-4px);
}

/* Ambient background glows, dark mode only (per colouring rules) */
.nb-glow {
  position: absolute;
  border-radius: 9999px;
  filter: blur(120px);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}
[data-theme="nobregas-dark"] .nb-glow {
  opacity: 1;
  background: color-mix(in oklch, var(--color-primary) 18%, transparent);
}

/* Marquee-free logo strip, just muted */
.nb-logo-strip img,
.nb-logo-strip span {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.nb-logo-strip:hover img,
.nb-logo-strip:hover span {
  opacity: 1;
}

/* Phosphor spinner helper (web font has no spin by default) */
.ph-spin {
  animation: nb-spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes nb-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Navbar elevation when scrolled */
.nb-navbar {
  transition: box-shadow 0.2s ease, background-color 0.2s ease, backdrop-filter 0.2s ease;
}
.nb-navbar.is-scrolled {
  box-shadow: 0 8px 24px -12px rgba(15, 23, 42, 0.18);
}

/* Status pill dot pulse */
.nb-pulse {
  position: relative;
}
.nb-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: var(--color-success);
  animation: nb-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes nb-ping {
  75%,
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Reveal on scroll */
.nb-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.nb-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Gentle float for the hero illustration */
.nb-pulse-slow {
  animation: nb-float 6s ease-in-out infinite;
}
@keyframes nb-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* Pricing period helper */
.nb-price-annual,
[data-period="annual"] .nb-price-monthly {
  display: none;
}
[data-period="annual"] .nb-price-annual {
  display: inline;
}

/* --------------------------------------------------------------------------
   Hero entrance animations (run immediately on page load, no JS needed)
   -------------------------------------------------------------------------- */
@keyframes nb-fade-up {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nb-fade-left {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nb-anim-fade-up {
  animation: nb-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.nb-anim-fade-left {
  animation: nb-fade-left 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Staggered delay helpers */
.nb-anim-d1 { animation-delay: 0.08s; }
.nb-anim-d2 { animation-delay: 0.18s; }
.nb-anim-d3 { animation-delay: 0.28s; }
.nb-anim-d4 { animation-delay: 0.38s; }
.nb-anim-d5 { animation-delay: 0.48s; }
.nb-anim-d6 { animation-delay: 0.58s; }

/* --------------------------------------------------------------------------
   Scroll-reveal (IntersectionObserver adds .nb-in via main.js)
   -------------------------------------------------------------------------- */
[data-nb-animate] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-nb-animate].nb-in {
  opacity: 1;
  transform: none;
}

/* Stagger children when parent is animated */
[data-nb-animate][data-nb-stagger] > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-nb-animate][data-nb-stagger].nb-in > *:nth-child(1)  { opacity: 1; transform: none; transition-delay: 0.05s; }
[data-nb-animate][data-nb-stagger].nb-in > *:nth-child(2)  { opacity: 1; transform: none; transition-delay: 0.12s; }
[data-nb-animate][data-nb-stagger].nb-in > *:nth-child(3)  { opacity: 1; transform: none; transition-delay: 0.19s; }
[data-nb-animate][data-nb-stagger].nb-in > *:nth-child(4)  { opacity: 1; transform: none; transition-delay: 0.26s; }
[data-nb-animate][data-nb-stagger].nb-in > *:nth-child(5)  { opacity: 1; transform: none; transition-delay: 0.33s; }
[data-nb-animate][data-nb-stagger].nb-in > *:nth-child(6)  { opacity: 1; transform: none; transition-delay: 0.40s; }
[data-nb-animate][data-nb-stagger].nb-in > *:nth-child(7)  { opacity: 1; transform: none; transition-delay: 0.47s; }
[data-nb-animate][data-nb-stagger].nb-in > *:nth-child(8)  { opacity: 1; transform: none; transition-delay: 0.54s; }

/* Honor reduced-motion — hide elements immediately (already handled globally, belt-and-suspenders) */
@media (prefers-reduced-motion: reduce) {
  [data-nb-animate],
  [data-nb-animate][data-nb-stagger] > *,
  .nb-anim-fade-up,
  .nb-anim-fade-left {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }
}
