/* ui-kit.css — layout tokens + Game-Day Kinetic utility classes
 * shared across every authenticated portal AND public marketing
 * surface.
 *
 * @sportfed/theme/tokens.css owns *visual* tokens (color, type,
 * radius, motion). This file owns *layout tokens* + *utility classes*
 * that are reusable across surfaces.
 *
 * Two roles, one file:
 *   1. Layout tokens (--sf-page-*, --sf-side-nav-*, …) — uniform
 *      across portals regardless of palette.
 *   2. Utility classes (.sf-btn, .sf-pill, .sf-eyebrow, .sf-card,
 *      .sf-display-italic, .sf-3d-placeholder, .sf-marquee, …) —
 *      ported from design/system/claude-design/. These are reusable
 *      enough that componentizing each into a Lit element would be
 *      over-engineering; they sit cleanly as classes on plain HTML.
 *      Lit primitives that NEED encapsulation (sf-service-mark,
 *      sf-ticker, sf-3d-placeholder) live in src/* and may consume
 *      these classes from the host document.
 *
 * Every host portal MUST include this stylesheet at the document
 * level so the variables resolve and the utility classes are
 * available to slotted content.
 */

:root {
  /* ── Layout containers ─────────────────────────────────────────── */
  /* Horizontal gutter is owned ONCE by app-portal-shell main (16/24/32px).
   * Pages and portal components must not add their own horizontal page
   * padding; standalone mounts opt in via --sf-page-padding-x. Card /
   * section inner padding uses --sf-pad-x, which collapses on phones. */
  --sf-pad-x: clamp(12px, 3vw, 24px);
  --sf-page-padding-x: 0;
  --sf-page-padding-y: 2rem;
  --sf-page-max-width: 100%;
  --sf-page-gap: 1.5rem;

  --sf-section-padding-x: var(--sf-pad-x);
  --sf-section-padding-y: 1.5rem;
  --sf-section-gap: 1rem;

  --sf-frame-gap: 2rem;

  /* ── Side nav ──────────────────────────────────────────────────── */
  --sf-side-nav-w: var(--side-nav-w, 256px);
  --sf-side-nav-w-collapsed: var(--side-nav-w-collapsed, 64px);
  --sf-side-nav-padding: 1rem 0.75rem;
  --sf-side-nav-item-padding: 0.6rem 0.85rem;
  --sf-side-nav-item-radius: var(--sf-r-md);
  --sf-side-nav-section-gap: 1.25rem;
  --sf-side-nav-label-size: 0.72rem;
  --sf-side-nav-letter-spacing: 0.08em;

  /* ── Breadcrumbs ───────────────────────────────────────────────── */
  --sf-breadcrumbs-h: 36px;
  --sf-breadcrumbs-gap: 0.4rem;
  --sf-breadcrumbs-font-size: 0.85rem;

  /* ── Status pill / chip ────────────────────────────────────────── */
  --sf-pill-padding: 5px 11px;
  --sf-pill-font-size: 11px;
  --sf-pill-letter-spacing: 0.06em;
  --sf-pill-radius: 999px;

  /* ── Form ──────────────────────────────────────────────────────── */
  --sf-input-padding: 0.55rem 0.75rem;
  --sf-input-radius: var(--sf-r-md);
  --sf-form-field-gap: 0.35rem;
  --sf-form-actions-gap: 0.6rem;
  --sf-form-actions-margin-top: 1.25rem;

  /* ── List rows ─────────────────────────────────────────────────── */
  --sf-row-padding: 0.85rem 1.1rem;
  --sf-row-gap: 1rem;
  --sf-row-radius: var(--sf-r-md);

  /* ── State cards (loading / empty / error) ─────────────────────── */
  --sf-state-padding: 1.5rem;
  --sf-state-radius: var(--sf-r-md);
}

/* =================================================================
 * Game-Day Kinetic utility classes
 *
 * Ported from design/system/claude-design/sportfed-design/theme.css.
 * Reusable across every surface. Kept here so a single import of
 * @sportfed/ui-kit/styles/ui-kit.css makes them available portal-wide.
 * ================================================================= */

/* Display — editorial italic / non-italic display headlines.
 *
 * IMPORTANT: per design-statement.md, .sf-display-italic is voice-
 * loaded ("game-day kinetic"). Use it ONLY for:
 *   - hero headlines on splash, saas-home, service-page, protocol-site
 *   - section headlines on those marketing surfaces
 *   - outcome screens ("You're in.", "Request received.")
 *
 * NEVER use it for:
 *   - data tables, forms, operator console UI
 *   - in-product chrome (sidebar, tabs, breadcrumbs, page headers)
 *   - toasts, alerts, status messages
 */
.sf-display {
  font-family: var(--sf-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 0.95;
}
.sf-display-italic {
  font-family: var(--sf-display);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 0.92;
}
.sf-mono {
  font-family: var(--sf-mono);
  font-variant-numeric: tabular-nums;
}

/* Eyebrow — uppercase mono label that precedes a section/title */
.sf-eyebrow {
  font-family: var(--sf-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sf-ink-3);
  font-weight: 500;
}

/* Page help — the paragraph-length page explainer that sits in
 * <sf-page-shell slot="help">. The shell styles the slotted
 * paragraph itself, but ::slotted() cannot reach descendants, so the
 * code/strong rules live here for light-DOM consumers. Shadow-DOM
 * consumers spread `pageHelpStyles` from
 * @sportfed/ui-kit/page/sf-page-shell.ts instead.
 * See design/system/page-explainer.md. */
.sf-page-help {
  margin: 0 0 1.25rem;
  max-width: 70ch;
  color: var(--sf-ink-2);
  font-size: 0.95rem;
  line-height: 1.55;
}
.sf-page-help code,
[slot='help'] code {
  font-family: var(--sf-mono);
  font-size: 0.85em;
  padding: 0.05em 0.35em;
  border-radius: 3px;
  background: var(--sf-paper-card);
  color: var(--sf-ink);
}
.sf-page-help a,
[slot='help'] a {
  color: var(--sf-link, var(--sf-cobalt, #2148ff));
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sf-page-help strong,
[slot='help'] strong {
  color: var(--sf-ink);
}

/* Buttons — five variants, all pill-shaped by default
 * Matches the design's .sf-btn / .sf-btn--ink / --fire / --ghost
 * with --paper added for dark surfaces and --danger for destructive
 * confirms. Apply both classes (.sf-btn .sf-btn--ink) on the same
 * element. Sizes: default, .sf-btn--sm, .sf-btn--lg.
 */
.sf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--sf-sans);
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  background: none;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}
.sf-btn:hover {
  transform: translateY(-1px);
}
.sf-btn:focus-visible {
  outline: 2px solid rgba(255, 59, 31, 0.6);
  outline-offset: 2px;
}
.sf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.sf-btn--ink {
  background: var(--sf-ink);
  color: var(--sf-paper);
}
.sf-btn--ink:hover {
  background: var(--sf-fire);
}
.sf-btn--fire {
  background: var(--sf-fire);
  color: #fff;
}
.sf-btn--fire:hover {
  background: var(--sf-fire-deep);
}
.sf-btn--ghost {
  background: transparent;
  color: var(--sf-ink);
  border: 1.5px solid var(--sf-line);
}
.sf-btn--ghost:hover {
  background: var(--sf-ink);
  color: var(--sf-paper);
}
.sf-btn--paper {
  background: var(--sf-paper);
  color: var(--sf-ink);
}
.sf-btn--paper:hover {
  background: var(--sf-paper-card);
}
.sf-btn--danger {
  background: var(--sf-fire-deep);
  color: #fff;
}
.sf-btn--danger:hover {
  background: var(--sf-fire);
}
.sf-btn--sm {
  padding: 8px 14px;
  font-size: 13px;
}
.sf-btn--lg {
  padding: 18px 28px;
  font-size: 16px;
}

/* Pills — mono-uppercase chips, three flavors, plus the live pulse
 * indicator. The existing <sf-status-pill> primitive remains for
 * status-tone-aware cells; this is the lighter-weight inline chip
 * for telemetry, version tags, eyebrows, etc.
 */
.sf-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--sf-pill-padding, 5px 11px);
  border-radius: var(--sf-pill-radius, 999px);
  font-family: var(--sf-mono);
  font-size: var(--sf-pill-font-size, 11px);
  font-weight: 500;
  letter-spacing: var(--sf-pill-letter-spacing, 0.06em);
  text-transform: uppercase;
  border: 1px solid var(--sf-line-soft);
  color: var(--sf-ink-2);
  background: var(--sf-paper-card);
}
.sf-pill--fire {
  background: var(--sf-fire);
  color: #fff;
  border-color: var(--sf-fire);
}
.sf-pill--ink {
  background: var(--sf-ink);
  color: var(--sf-paper);
  border-color: var(--sf-ink);
}
.sf-pill--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sf-fire);
  box-shadow: 0 0 0 0 rgba(255, 59, 31, 0.6);
  animation: sf-pulse 1.6s infinite;
}
@keyframes sf-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 31, 0.55);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(255, 59, 31, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 31, 0);
  }
}

/* Card — paper-card surface, line-soft border, lg radius.
 * Replaces the old GlassCard/Sheet duo with one flat surface.
 */
.sf-card {
  background: var(--sf-paper-card);
  border: 1px solid var(--sf-line-soft);
  border-radius: var(--sf-r-lg, 14px);
  box-shadow: var(--sf-shadow-sm);
}

/* Lift — hover translate + shadow upgrade. Combine with .sf-card
 * for clickable cards.
 */
.sf-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sf-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--sf-shadow-md);
}

/* Hairline rule */
.sf-hr {
  height: 1px;
  background: var(--sf-line-soft);
  border: 0;
  width: 100%;
}

/* Game-day grain overlay — apply to a positioned ancestor (relative).
 * Pseudo-element so it doesn't steal pointer events.
 */
.sf-grain {
  position: relative;
}
.sf-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Marquee — used by <sf-ticker> and any inline marquee blocks.
 * Translates 0 → -50% over 40s linear infinite. Markup duplicates
 * the content twice so the loop seam is invisible.
 */
@keyframes sf-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}
.sf-marquee {
  display: flex;
  gap: 48px;
  animation: sf-marquee 40s linear infinite;
  width: max-content;
}
@media (prefers-reduced-motion: reduce) {
  .sf-marquee {
    animation: none;
  }
}

/* 3D placeholder backdrop — for hero blocks where a real WebGL scene
 * will land later. Use the <sf-3d-placeholder> Lit component for the
 * full pattern; this class is exposed so portal-local heros can
 * reference the same striped warm-tone backdrop.
 */
.sf-3d-placeholder {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(14, 12, 11, 0.9), rgba(42, 37, 34, 0.85)),
    repeating-linear-gradient(
      45deg,
      rgba(255, 59, 31, 0.08) 0,
      rgba(255, 59, 31, 0.08) 2px,
      transparent 2px,
      transparent 14px
    );
  color: var(--sf-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}
.sf-3d-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 60% at 50% 100%, rgba(255, 59, 31, 0.35), transparent 60%),
    radial-gradient(50% 40% at 50% 0%, rgba(33, 72, 255, 0.2), transparent 60%);
  pointer-events: none;
}
.sf-3d-placeholder__note {
  position: relative;
  z-index: 2;
  font-family: var(--sf-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 16px;
  border: 1px dashed rgba(246, 243, 237, 0.4);
  border-radius: var(--sf-r-sm, 4px);
  color: rgba(246, 243, 237, 0.85);
  background: rgba(14, 12, 11, 0.4);
  max-width: 80%;
}
.sf-3d-placeholder__note small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-top: 4px;
  text-transform: none;
}
