/* Meus Catalogos — Design System
 * Source of truth for tokens, components and animations.
 * See STYLEGUIDE.md for usage rules.
 */

:root {
  --coral:        oklch(0.68 0.17 38);
  --coral-deep:   oklch(0.58 0.18 35);
  --coral-soft:   oklch(0.95 0.04 50);
  --coral-tint:   oklch(0.985 0.012 60);
  --ink:          oklch(0.22 0.01 60);
  --ink-2:        oklch(0.38 0.01 60);
  --ink-3:        oklch(0.58 0.008 60);
  --line:         oklch(0.92 0.005 60);
  --line-soft:    oklch(0.96 0.004 60);
  --warm:         oklch(0.985 0.008 70);

  /* Motion tokens — see STYLEGUIDE.md §5.1 */
  --motion-fast:     150ms;
  --motion-base:     220ms;
  --motion-slow:     360ms;
  --motion-entrance: 480ms;
  --ease-out:        cubic-bezier(.2, .8, .2, 1);
  --ease-in-out:     cubic-bezier(.4, 0, .2, 1);
  --ease-spring:     cubic-bezier(.34, 1.3, .64, 1);
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ============== Typography ============== */

.h1 { font-size: 64px; line-height: 1.02; letter-spacing: -2.2px; font-weight: 700; text-wrap: balance; }
.h2 { font-size: 44px; line-height: 1.05; letter-spacing: -1.4px; font-weight: 700; }
.h3 { font-size: 36px; line-height: 1.10; letter-spacing: -1px;   font-weight: 700; }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--coral);
}
.body-lg { font-size: 18px; line-height: 1.55; text-wrap: pretty; }
.meta-mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

@media (max-width: 1024px) {
  .h1 { font-size: 44px; letter-spacing: -1.4px; }
  .h2 { font-size: 34px; letter-spacing: -1px; }
  .h3 { font-size: 28px; letter-spacing: -0.6px; }
}

/* ============== Buttons ============== */

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--coral); color: #fff; font-weight: 600;
  border-radius: 7px; border: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 -1px 0 var(--coral-deep);
  transition: filter 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; filter: none; transform: none; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: 7px; font-weight: 500;
  transition: background-color 0.15s ease;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--warm); }

/* ============== Card ============== */

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}

.card--interactive {
  display: block; width: 100%; cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card--interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
}

.card--interactive[aria-pressed="true"],
.card--interactive[data-selected="true"] {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}

/* ============== Input ============== */

.input {
  display: block; width: 100%;
  padding: 10px 14px; font-size: 14px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 7px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: var(--ink-3); }
.input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}
.input:disabled { background: var(--warm); color: var(--ink-3); cursor: not-allowed; }

/* Fallback for inputs without explicit class (e.g. Django password reset built-ins). */
input:not([class]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  display: block; width: 100%;
  padding: 10px 14px; font-size: 14px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 7px;
  outline: none;
}
input:not([class]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}

/* ============== Focus ring ============== */

.ring-coral-focus:focus,
.ring-coral-focus:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

/* ============== Nav ============== */

.nav-blur {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ============== Modal ============== */

.modal {
  position: fixed; inset: 0; z-index: 50;
  display: none; align-items: center; justify-content: center;
}
.modal[data-open="true"] { display: flex; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 20, 20, 0.55);
  backdrop-filter: blur(4px);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.modal[data-open="true"] .modal-card { animation: modalIn 0.18s ease-out; }

/* ============== FAQ accordion ============== */

.faq-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-item[data-open="true"] .faq-body { max-height: 240px; }
.faq-item[data-open="true"] .faq-chevron { transform: rotate(180deg); }

/* ============== Placeholder stripes (for image mocks) ============== */

.placeholder-stripe {
  background: repeating-linear-gradient(
    135deg,
    var(--line-soft) 0 6px,
    var(--line) 6px 7px
  );
}
.placeholder-stripe-sm {
  background: repeating-linear-gradient(
    135deg,
    var(--line-soft) 0 4px,
    var(--line) 4px 5px
  );
}

/* ============== Motion utilities ============== */
/* See STYLEGUIDE.md §5.2. Use tokens from :root for duration/easing. */

@keyframes entranceUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.motion-entrance {
  animation: entranceUp var(--motion-entrance) var(--ease-out) both;
}

.motion-entrance--spring {
  animation-timing-function: var(--ease-spring);
}

/* Stagger for lists — apply to a parent; children inherit the entrance and
   get incremental delays. Covers up to 6 items; anything past that enters
   together (intentional, per styleguide §5.2.2). */
.motion-stagger > * {
  animation: entranceUp var(--motion-entrance) var(--ease-out) both;
}
.motion-stagger > *:nth-child(1) { animation-delay: 0ms; }
.motion-stagger > *:nth-child(2) { animation-delay: 60ms; }
.motion-stagger > *:nth-child(3) { animation-delay: 120ms; }
.motion-stagger > *:nth-child(4) { animation-delay: 180ms; }
.motion-stagger > *:nth-child(5) { animation-delay: 240ms; }
.motion-stagger > *:nth-child(n + 6) { animation-delay: 300ms; }

/* ============== Reduced motion ============== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
