/* ShotPro — Public (pre-login) marketing brand layer.
 *
 * "Restrained Editorial Ink-Violet." This file is loaded ONLY by the public
 * marketing layout (templates/layouts/public.templ). Every brand token is
 * scoped under `.sp-public`, so the authenticated app shell keeps its own
 * steel-blue/Inter chrome untouched.
 *
 * Three faces carry the register: Prata (display serif), Inter (UI sans),
 * JetBrains Mono (eyebrows / metadata / crop-mark captions).
 *
 * Named rules:
 *  - THE RARE ACCENT RULE: --brand marks decisions and state, never decorated
 *    surfaces. If every card is violet, nothing is important.
 *  - THE LOW-CHROMA RULE: no saturated gradients, no neon glow.
 */

/* ============================================================
   1. Scoped tokens
   ============================================================ */
.sp-public {
  /* Brand: Editorial Ink-Violet */
  --brand: oklch(52% 0.08 282);
  --brand-hover: oklch(45% 0.08 282);
  --brand-wash: oklch(52% 0.08 282 / 0.08);

  /* Accent: Slate Cyan — secondary, never competes with brand */
  --accent: oklch(70% 0.06 185);
  --accent-hover: oklch(63% 0.06 185);

  /* Tinted neutrals (violet-leaning, never sterile gray/black) */
  --text: oklch(18% 0.01 280);
  --text-muted: oklch(45% 0.02 280);
  --surface: oklch(99% 0.005 280);
  --surface-elevated: oklch(100% 0 0);
  --border: oklch(0% 0 0 / 0.08);
  --border-strong: oklch(0% 0 0 / 0.15);

  /* Semantic (low-chroma, functional) */
  --destructive: oklch(58% 0.10 25);
  --success: oklch(60% 0.08 145);
  --warning: oklch(70% 0.07 85);

  --ring-brand: oklch(52% 0.08 282 / 0.4);

  /* Type */
  --font-display: "Prata", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Radius (brand register: square buttons, soft editorial containers) */
  --radius-sm: 0.5rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;

  /* Elevation — quiet, explains stacking order */
  --shadow-hairline: 0 1px 2px oklch(0% 0 0 / 0.04);
  --shadow-card: 0 1px 6px oklch(0% 0 0 / 0.06), 0 1px 2px oklch(0% 0 0 / 0.04);
  --shadow-elevated: 0 10px 28px oklch(0% 0 0 / 0.12), 0 2px 8px oklch(0% 0 0 / 0.06);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

/* Dark — brand brightens, surfaces gain a faint violet tint */
.dark .sp-public {
  --brand: oklch(65% 0.07 282);
  --brand-hover: oklch(72% 0.07 282);
  --brand-wash: oklch(65% 0.07 282 / 0.12);
  --accent: oklch(75% 0.05 185);
  --accent-hover: oklch(80% 0.05 185);
  --text: oklch(92% 0.01 280);
  --text-muted: oklch(65% 0.02 280);
  --surface: oklch(12% 0.01 280);
  --surface-elevated: oklch(16% 0.01 280);
  --border: oklch(100% 0 0 / 0.08);
  --border-strong: oklch(100% 0 0 / 0.18);
  --destructive: oklch(65% 0.09 25);
  --success: oklch(68% 0.07 145);
  --warning: oklch(75% 0.06 85);
  --ring-brand: oklch(65% 0.07 282 / 0.4);
}

/* High contrast (WCAG AAA baseline) — brand chroma rises here only */
.high-contrast .sp-public {
  --brand: oklch(45% 0.25 280);
  --brand-hover: oklch(38% 0.25 280);
  --brand-wash: oklch(45% 0.25 280 / 0.12);
  --text: oklch(0% 0 0);
  --text-muted: oklch(25% 0.01 280);
  --surface: oklch(100% 0 0);
  --surface-elevated: oklch(100% 0 0);
  --border: oklch(0% 0 0 / 0.25);
  --border-strong: oklch(0% 0 0 / 0.45);
  --ring-brand: oklch(45% 0.25 280 / 0.8);
}
.high-contrast.dark .sp-public {
  --brand: oklch(80% 0.20 280);
  --brand-hover: oklch(85% 0.20 280);
  --text: oklch(100% 0 0);
  --text-muted: oklch(80% 0.01 280);
  --surface: oklch(0% 0 0);
  --surface-elevated: oklch(8% 0.01 280);
  --border: oklch(100% 0 0 / 0.35);
  --border-strong: oklch(100% 0 0 / 0.6);
  --ring-brand: oklch(80% 0.20 280 / 0.8);
}

.sp-public *,
.sp-public *::before,
.sp-public *::after { box-sizing: border-box; }
.sp-public ::selection { background: var(--brand-wash); color: var(--brand); }

/* ============================================================
   2. Typographic primitives
   ============================================================ */
.sp-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.04;
}
.sp-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sp-italic { color: var(--brand); font-style: italic; }
.sp-mono { font-family: var(--font-mono); }

/* ============================================================
   3. Buttons (brand register: square, mono, uppercase)
   ============================================================ */
.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: 0;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s var(--ease-out-expo), color 0.18s var(--ease-out-expo),
    border-color 0.18s var(--ease-out-expo), transform 0.18s var(--ease-out-expo);
}
.sp-btn-sm { padding: 0.5rem 0.875rem; font-size: 11px; }
.sp-btn-lg { padding: 0.9rem 1.5rem; font-size: 12.5px; }
.sp-btn-primary { background: var(--brand); color: oklch(100% 0 0); }
.sp-btn-primary:hover { background: var(--brand-hover); }
.dark .sp-public .sp-btn-primary { color: oklch(14% 0.01 280); }
.sp-btn-secondary {
  background: var(--surface-elevated);
  color: var(--text);
  border-color: var(--border-strong);
}
.sp-btn-secondary:hover { background: var(--surface); border-color: var(--brand); }
.sp-btn-ghost { background: transparent; color: var(--text-muted); }
.sp-btn-ghost:hover { color: var(--text); }
.sp-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.sp-btn-block { width: 100%; }

/* Icon button */
.sp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sp-icon-btn:hover { background: var(--surface); border-color: var(--border-strong); }

/* Chips (pill, compact) */
.sp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s var(--ease-out-expo);
}
.sp-chip:hover { border-color: var(--border-strong); color: var(--text); }
.sp-chip[aria-pressed="true"],
.sp-chip.is-selected {
  background: var(--brand-wash);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}

/* Inputs */
.sp-input,
.sp-textarea,
.sp-select {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sp-input::placeholder, .sp-textarea::placeholder { color: var(--text-muted); }
.sp-input:focus,
.sp-textarea:focus,
.sp-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring-brand);
}
.sp-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ============================================================
   4. Focus (two-ring brand treatment, WCAG AA)
   ============================================================ */
.sp-public a:focus-visible,
.sp-public button:focus-visible,
.sp-public [tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand);
}
.sp-public .sp-input:focus-visible,
.sp-public .sp-textarea:focus-visible,
.sp-public .sp-select:focus-visible {
  box-shadow: 0 0 0 3px var(--ring-brand);
}
.high-contrast .sp-public a:focus-visible,
.high-contrast .sp-public button:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  box-shadow: none;
}

/* ============================================================
   5. Drawing-board grid + crop marks (brand signature)
   ============================================================ */
.sp-grid-bg {
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
}
.sp-grid-bg-lg { background-size: 64px 64px; }

.sp-crop { position: relative; }
.sp-crop::before,
.sp-crop::after,
.sp-crop > .sp-crop-bl,
.sp-crop > .sp-crop-br {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1;
  color: var(--text-muted);
  user-select: none;
  pointer-events: none;
  content: "+";
}
.sp-crop::before { top: -6px; left: -3px; }
.sp-crop::after { top: -6px; right: -3px; }
.sp-crop > .sp-crop-bl { bottom: -6px; left: -3px; }
.sp-crop > .sp-crop-br { bottom: -6px; right: -3px; }

/* Section divider rule with centered tag */
.sp-rule { display: flex; align-items: center; gap: 16px; }
.sp-rule::before, .sp-rule::after { content: ""; height: 1px; background: var(--border); flex: 1; }

/* ============================================================
   6. Grayscale -> color photo reveal
   ============================================================ */
.sp-photo {
  filter: grayscale(1) contrast(1.18);
  transition: filter 0.35s var(--ease-out-expo);
}
.sp-photo-hover:hover .sp-photo,
.sp-photo.is-color { filter: none; }

/* ============================================================
   7. Logo marquee
   ============================================================ */
.sp-marquee {
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.sp-marquee-track {
  display: flex;
  gap: 56px;
  padding-right: 56px;
  flex-shrink: 0;
  animation: sp-marq 32s linear infinite;
}
.sp-marquee:hover .sp-marquee-track { animation-play-state: paused; }
@keyframes sp-marq { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .sp-marquee-track { animation: none; } }

/* ============================================================
   8. Reveal (enhancement-only; resting + worst-case state is VISIBLE)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .reveal-ready .sp-public .sp-reveal {
    opacity: 1;
    transform: translateY(16px);
    transition: transform 0.6s var(--ease-out-expo);
  }
  .reveal-ready .sp-public .sp-reveal.is-in { transform: none; }
  .sp-reveal-2 { transition-delay: 0.08s; }
  .sp-reveal-3 { transition-delay: 0.16s; }
  .sp-reveal-4 { transition-delay: 0.24s; }
}

/* Hero fade-up: resting state is the VISIBLE end-state */
@media (prefers-reduced-motion: no-preference) {
  .sp-fadeup { animation: sp-fadeup 0.7s var(--ease-out-expo); }
  .sp-fadeup-2 { animation-delay: 0.08s; }
  .sp-fadeup-3 { animation-delay: 0.16s; }
  @keyframes sp-fadeup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}

/* ============================================================
   9. Shimmer (sandbox "generating")
   ============================================================ */
.sp-shimmer {
  background: linear-gradient(90deg, var(--surface) 0%,
    color-mix(in oklab, var(--brand) 10%, var(--surface)) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: sp-shim 1.3s ease-in-out infinite;
}
@keyframes sp-shim { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sp-shimmer { animation: none; } }

/* ============================================================
   10. Accordion (FAQ)
   ============================================================ */
.sp-acc-panel { overflow: hidden; transition: grid-template-rows 0.28s var(--ease-out-expo); display: grid; grid-template-rows: 0fr; }
.sp-acc-panel.is-open { grid-template-rows: 1fr; }
.sp-acc-panel > div { min-height: 0; }

/* ============================================================
   11. Nav link underline-on-hover
   ============================================================ */
.sp-navlink {
  position: relative;
  text-decoration: none;
  color: var(--text-muted);
  transition: color 0.15s;
}
.sp-navlink:hover { color: var(--text); }
.sp-navlink::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 1px;
  background: var(--brand);
  transition: right 0.2s var(--ease-out-expo);
}
.sp-navlink:hover::after { right: 0; }

/* ============================================================
   12. Sticky bottom CTA (appears on scroll)
   ============================================================ */
.sp-stickybar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  transform: translateY(110%);
  transition: transform 0.4s var(--ease-out-expo);
  background: color-mix(in oklab, var(--surface-elevated) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 30px oklch(0% 0 0 / 0.08);
}
.sp-stickybar.is-in { transform: translateY(0); }

/* ============================================================
   13. Mobile nav drawer
   ============================================================ */
.sp-drawer { position: fixed; inset: 0; z-index: 80; display: none; }
.sp-drawer.is-open { display: block; }
.sp-drawer-scrim { position: absolute; inset: 0; background: oklch(0% 0 0 / 0.4); backdrop-filter: blur(2px); }
.sp-drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(86vw, 360px);
  background: var(--surface-elevated);
  border-left: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: sp-slidein 0.28s var(--ease-out-expo);
}
@keyframes sp-slidein { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ============================================================
   14. Responsive collapse helpers
   ============================================================ */
.sp-only-mobile { display: none !important; }
@media (max-width: 980px) {
  .sp-2col { grid-template-columns: 1fr !important; }
  .sp-hide-mobile { display: none !important; }
  .sp-only-mobile { display: inline-flex !important; }
  .sp-hero-art { display: none !important; }
}
@media (max-width: 760px) {
  .sp-3col { grid-template-columns: 1fr !important; }
  .sp-4col { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 520px) {
  .sp-4col { grid-template-columns: 1fr !important; }
}
