/* ============================================================
   RALLY · Hulo layer  (BRAND.md v5 — "graph paper met a highlighter")
   ------------------------------------------------------------
   Loaded LAST in <head> on Rally-owned pages only:
     index · login · signup · forgot · reset · onboarding ·
     dashboard · admin · offline
   It is NEVER loaded by book / embed / confirm. Those pages are the
   club's white-label surface (BRAND.md §9) and stay in the club's
   colours with neutral hairlines.

   What this layer does, from the Hulo brand guidelines:
     · 1.5px Ink strokes on everything drawn (via --edge tokens)
     · Hard 4×4 Ink offset shadows, no blur; 7×7 + lift −2px on hover
     · Paper-grid texture (36px) behind heroes, faded downward
     · Marquee strip: uppercase phrases + lime dots, looping on Forest
     · Outline numerals, dashed 8/10 paths, stroked icon chips
     · Button light-band sweep, magnetic CTA (motion.js)
     · One curve: cubic-bezier(0.22, 1, 0.36, 1); reveal y+34, 720ms
   Everything respects prefers-reduced-motion.
   ============================================================ */

:root {
  --hulo-ink: var(--ink-fixed);
  --hulo-shadow-c: var(--ink-fixed);
  /* v6: drawn edges REST as hairlines; the bold Ink stroke is a hover/press
     state (§9 at the end of this file). */
  --edge: var(--line);
  --edge-strong: var(--line-strong);

  --shadow-hard-sm: 3px 3px 0 var(--hulo-shadow-c);
  --shadow-hard:    4px 4px 0 var(--hulo-shadow-c);
  --shadow-hard-lg: 7px 7px 0 var(--hulo-shadow-c);

  --hulo-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease: var(--hulo-ease);
  --t-lift: 240ms;
  --t-reveal: 720ms;
  --reveal-rise: 34px;
  --t-3: 720ms;
}
[data-theme="dark"] {
  /* On Ink the stroke flips to Paper and the shadow drops to black,
     so the "panel on paper" read survives the inversion. */
  --hulo-ink: rgba(252, 250, 247, 0.86);
  --hulo-shadow-c: #000;
}

/* ── 1 · Drawn objects get the hard shadow ───────────────────── */
.card:not(.card-flat), .card-soft, .panel,
.stat, .bcard, .court-card, .plan-card, .plan-now, .qr-box, .brand-preview,
.kpi, .pane, .metric, .moneycard, .limit, .confirm-box,
.sport-card, .hours-card, .acct, .pay,
.mock, .price-card, .ba-card, .swatch, .spot-illo, .urdu-illo {
  box-shadow: var(--shadow-hard);
}
.card-moss, .card-forest, .ba-card.after, .price-card.featured {
  border: var(--stroke-2) solid var(--hulo-ink) !important;
}

/* Interactive cards lift against their shadow. */
a.card, button.card, .card.is-link, .court-card, .plan-card, .sport-card,
.bcard, .kpi, .metric, .price-card, .swatch, .preset {
  transition: transform var(--t-lift) var(--hulo-ease),
              box-shadow var(--t-lift) var(--hulo-ease),
              background-color var(--t-lift) var(--hulo-ease);
}
@media (hover: hover) {
  a.card:hover, button.card:hover, .card.is-link:hover, .court-card:hover,
  .plan-card:hover, .sport-card:hover, .bcard:hover, .kpi:hover, .metric:hover,
  .price-card:hover, .swatch:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hard-lg);
    border-color: var(--hulo-ink);
  }
}
.card:hover { border-color: var(--hulo-ink); }

/* Tables and list rows stay hairline — a stroke on every row is noise. */
.dtable tbody tr, .dtable td, .dtable th { border-color: var(--line) !important; box-shadow: none; }

/* ── 2 · Buttons: pill, Ink stroke, hard shadow, sweep ───────── */
.btn {
  border-color: var(--hulo-ink);
  box-shadow: var(--shadow-hard-sm);
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--t-lift) var(--hulo-ease),
              box-shadow var(--t-lift) var(--hulo-ease),
              background-color var(--t-lift) var(--hulo-ease);
}
.btn-lime, .btn-dark, .btn-forest, .btn-brand { border-color: var(--hulo-ink); }
[data-theme="dark"] .btn-dark { border-color: var(--hulo-ink); }
.btn:hover { border-color: var(--hulo-ink); }
@media (hover: hover) {
  .btn:hover:not(:disabled):not([aria-disabled="true"]) {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hard);
  }
}
.btn:active:not(:disabled):not([aria-disabled="true"]) {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--hulo-shadow-c);
}
.btn-ghost, .btn-ghost:hover, .btn-ghost:active,
.btn-icon.btn-ghost { box-shadow: none !important; border-color: transparent; transform: none !important; }
.btn:disabled, .btn[aria-disabled="true"] { box-shadow: none; border-color: var(--line-strong); }

/* The sweep — a light band crosses once on hover (550ms, skew −14°). */
.btn-lime::after, .btn-dark::after, .btn-forest::after, .btn-brand::after {
  content: "";
  position: absolute;
  inset: -2px auto -2px -60%;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-14deg);
  z-index: -1;
  pointer-events: none;
  opacity: 0;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .btn-lime:hover::after, .btn-dark:hover::after,
  .btn-forest:hover::after, .btn-brand:hover::after {
    opacity: 1;
    animation: hulo-sweep 550ms var(--hulo-ease) forwards;
  }
}
@keyframes hulo-sweep { from { left: -60%; } to { left: 120%; } }

/* ── 3 · Inputs: Ink stroke, lime focus underline ────────────── */
.input, .select, .textarea { border-color: var(--hulo-ink); }
.input:hover:not(:disabled), .select:hover:not(:disabled),
.textarea:hover:not(:disabled) { border-color: var(--hulo-ink); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  box-shadow: var(--shadow-hard-sm), inset 0 -3px 0 var(--acid);
}
.toggle-track { border-color: var(--hulo-ink); }

/* ── 4 · Tags, pills, badges: stroked, uppercase labels ──────── */
.tag, .badge, .pill {
  border: var(--stroke-2) solid var(--hulo-ink);
}
.tag.is-inverse, .pill.is-inverse { background: var(--ink); color: var(--paper); }

/* ── 5 · Graphic language, switched back on ──────────────────── */
.paper-grid { position: relative; isolation: isolate; }
.paper-grid::before,
.paper-grid-inverse::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(21,23,20,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21,23,20,.07) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.6) 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.6) 55%, transparent 100%);
}
.paper-grid-inverse { position: relative; isolation: isolate; }
.paper-grid-inverse::before {
  background-image:
    linear-gradient(to right, rgba(252,250,247,.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(252,250,247,.08) 1px, transparent 1px);
}
[data-theme="dark"] .paper-grid::before {
  background-image:
    linear-gradient(to right, rgba(252,250,247,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(252,250,247,.06) 1px, transparent 1px);
}

.dashed-path { fill: none; stroke-width: 2; stroke-dasharray: 8 10; stroke-linecap: round; stroke: var(--leaf); }
.dashed-path.is-lime { stroke: var(--acid); }
.dashed-path.is-ink  { stroke: var(--ink); }
.dashed-rule { border-top: 2px dashed var(--line-strong); }
@media (prefers-reduced-motion: no-preference) {
  .dashed-crawl { animation: hulo-crawl 1.2s linear infinite; }
}
@keyframes hulo-crawl { to { stroke-dashoffset: -18; } }

.outline-type {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  font-weight: 800;
  letter-spacing: -0.045em;
}

/* Marquee — markup duplicates the group for a seamless loop. */
.marquee {
  display: block;
  overflow: hidden;
  background: var(--leaf);
  color: var(--paper-fixed);
  border-block: var(--stroke-2) solid var(--hulo-ink);
  padding: 16px 0;
}
.marquee-track { display: flex; width: max-content; }
.marquee-group { display: flex; align-items: center; flex: none; }
.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding-inline-end: 22px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee-item::after {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--acid);
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: hulo-marquee 26s linear infinite; }
  [dir="rtl"] .marquee-track { animation-direction: reverse; }
}
@keyframes hulo-marquee { to { transform: translateX(-50%); } }

/* Icon chips — stroked, rounded, hard-shadowed feature markers. */
.icon-chip {
  border: var(--stroke-2) solid var(--hulo-ink);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-hard-sm);
}
.icon-chip-lg {
  width: 64px; height: 64px; border-radius: 20px;
  box-shadow: var(--shadow-hard);
}
.icon-chip-lg svg { width: 28px; height: 28px; }

/* Ambient loops — float, slow spin. */
@media (prefers-reduced-motion: no-preference) {
  .anim-float     { animation: hulo-float 6s var(--ease-in-out) infinite; }
  .anim-float-alt { animation: hulo-float 7.5s var(--ease-in-out) -2s infinite; }
  .anim-spin-slow { animation: hulo-spin 18s linear infinite; }
}
@keyframes hulo-float { 50% { transform: translateY(-8px); } }
@keyframes hulo-spin  { to { transform: rotate(360deg); } }

/* Wordmark dot gets a little life on hover. */
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
  .rally-wordmark:hover .dot, .brand:hover .dot { animation: hulo-bounce 600ms var(--hulo-ease); }
}
@keyframes hulo-bounce { 40% { transform: translateY(-4px); } }

/* ── 6 · Landing-page specifics ──────────────────────────────── */
.hero.paper-grid { padding-bottom: 24px; }
.hero-badge { box-shadow: var(--shadow-hard-sm); background: var(--paper); }
.sport-chip { box-shadow: var(--shadow-hard-sm); }

.feature {
  border: var(--stroke-2) solid var(--hulo-ink) !important;
  border-radius: var(--r-card);
  padding: 22px !important;
  background: var(--paper);
  box-shadow: var(--shadow-hard);
  transition: transform var(--t-lift) var(--hulo-ease), box-shadow var(--t-lift) var(--hulo-ease);
}
.feature > [data-icon], .feature > svg:first-child {
  display: grid; place-items: center;
  width: 46px !important; height: 46px !important;
  padding: 11px;
  border: var(--stroke-2) solid var(--hulo-ink);
  border-radius: 14px;
  background: var(--moss);
  color: var(--ink-fixed);
  box-shadow: var(--shadow-hard-sm);
  margin-bottom: 16px;
}
.feature > [data-icon] svg { margin: 0 !important; width: 22px; height: 22px; color: var(--ink-fixed); }
@media (hover: hover) {
  .feature:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-lg); }
}
.step-n { color: transparent; -webkit-text-stroke: 1.5px var(--ink); font-size: 40px !important; }
.mock-slot.on, .mock-date.on, .mock-court.on { box-shadow: var(--shadow-hard-sm); }
.footer { border-top: var(--stroke-2) solid var(--hulo-ink); }

/* ── 7 · Dashboard / admin chrome ────────────────────────────── */
.sidebar, .side { border-inline-end: var(--stroke-2) solid var(--hulo-ink); }
.nav-item.is-active, .side-nav a.is-on, .side-link.is-active {
  box-shadow: var(--shadow-hard-sm);
}
.sheet, .drawer { box-shadow: -7px 0 0 var(--hulo-shadow-c); border-color: var(--hulo-ink); }
.slotgrid button { border-color: var(--hulo-ink); }

/* Auth pages: the form is a stroked panel on a paper grid. */
.auth-card {
  border: var(--stroke-2) solid var(--hulo-ink);
  border-radius: var(--r-xl);
  padding: clamp(24px, 4vw, 36px);
  background: var(--paper);
  box-shadow: var(--shadow-hard-lg);
}

/* ── 8 · Reduced motion: no lift, no sweep, no loops ─────────── */
@media (prefers-reduced-motion: reduce) {
  .btn, .card, .feature, .court-card, .plan-card, .price-card, .swatch,
  .bcard, .kpi, .metric, .sport-card { transition: none !important; transform: none !important; }
  .marquee-track { animation: none; }
}


/* ── 9 · v6 — quiet at rest, bold on hover (Nov 2026) ────────────────────────
   Sohail: "don't add a bold stroke by default, add it on hover — desktop and
   mobile." Everything below overrides the earlier sections:
     rest    → 1px-feel hairline (--line / --line-strong), no hard shadow
     hover   → 1.5px Ink stroke + hard 4px shadow; interactive pieces also
               lift −2px to a 7px shadow   (devices with a real pointer)
     press   → the same Ink stroke on :active, so phones get it on tap
     focus   → Ink stroke on :focus-visible / :focus-within (keyboard + inputs)
   Selected / current things (active nav item, selected slot) keep their fill,
   not a bold stroke. Reduced-motion: stroke still appears, nothing moves. */

/* rest */
.card, .card-soft, .panel, .stat, .bcard, .court-card, .plan-card, .plan-now, .qr-box,
.brand-preview, .kpi, .pane, .metric, .moneycard, .limit, .confirm-box, .sport-card,
.hours-card, .acct, .pay, .mock, .price-card, .ba-card, .swatch, .spot-illo, .urdu-illo,
.auth-card, .feature, .wa-card, .wa-step, .hero-badge, .sport-chip, .icon-chip,
.feature > [data-icon], .feature > svg:first-child, .tag, .badge, .pill {
  box-shadow: none !important;
  border-color: var(--line) !important;
  transform: none;
}
.card-moss, .card-forest, .ba-card.after, .price-card.featured { border-color: transparent !important; }
.btn { box-shadow: none; border-color: var(--line-strong); }
.btn-lime, .btn-dark, .btn-forest, .btn-brand { border-color: transparent; }
.input, .select, .textarea, .toggle-track { border-color: var(--line-strong); }
.sidebar, .side { border-inline-end-color: var(--line); }
.footer { border-top-color: var(--line); }
.marquee { border-block-color: transparent; }
.nav-item.is-active, .side-nav a.is-on, .side-link.is-active, .mock-slot.on, .mock-date.on, .mock-court.on { box-shadow: none; }
.sheet, .drawer { box-shadow: -1px 0 0 var(--line), 0 18px 48px rgba(21,23,20,.14); border-color: var(--line); }
.slotgrid button { border-color: var(--line-strong); }

/* the bold state, shared by hover / press / keyboard focus */
@media (hover: hover) {
  .card:hover, .card-soft:hover, .panel:hover, .stat:hover, .bcard:hover, .court-card:hover,
  .plan-card:hover, .kpi:hover, .pane:hover, .metric:hover, .moneycard:hover, .sport-card:hover,
  .hours-card:hover, .acct:hover, .pay:hover, .mock:hover, .price-card:hover, .ba-card:hover,
  .swatch:hover, .auth-card:hover, .feature:hover, .wa-card:hover, .wa-step:hover,
  .hero-badge:hover, .sport-chip:hover, .tag:hover, .pill:hover,
  .card-moss:hover, .card-forest:hover {
    border-color: var(--hulo-ink) !important;
    box-shadow: var(--shadow-hard) !important;
  }
  /* things you can click also lift */
  a.card:hover, button.card:hover, .card.is-link:hover, .court-card:hover, .plan-card:hover,
  .sport-card:hover, .bcard:hover, .price-card:hover, .swatch:hover, .feature:hover, .kpi:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hard-lg) !important;
  }
  .feature:hover > [data-icon], .feature:hover > svg:first-child, .icon-chip:hover {
    border-color: var(--hulo-ink) !important;
    box-shadow: var(--shadow-hard-sm) !important;
  }
  .btn:hover:not(:disabled):not([aria-disabled="true"]):not(.btn-ghost) {
    border-color: var(--hulo-ink);
    box-shadow: var(--shadow-hard);
    transform: translate(-2px, -2px);
  }
  .input:hover:not(:disabled):not(:focus), .select:hover:not(:disabled):not(:focus),
  .textarea:hover:not(:disabled):not(:focus) { border-color: var(--ink); }
  .slotgrid button:hover:not(:disabled) { border-color: var(--hulo-ink); }
}

/* phones & tablets: the bold stroke shows while the finger is down */
.card:active, .bcard:active, .court-card:active, .plan-card:active, .sport-card:active,
.price-card:active, .swatch:active, .kpi:active, .feature:active, .pay:active, .wa-step:active,
a.card:active, button.card:active, .card.is-link:active {
  border-color: var(--hulo-ink) !important;
  box-shadow: var(--shadow-hard-sm) !important;
}
.btn:active:not(:disabled):not([aria-disabled="true"]):not(.btn-ghost) {
  border-color: var(--hulo-ink);
  box-shadow: 0 0 0 var(--hulo-shadow-c);
  transform: translate(1px, 1px);
}
.slotgrid button:active:not(:disabled) { border-color: var(--hulo-ink); }

/* keyboard focus and typing get the same treatment */
.btn:focus-visible { border-color: var(--hulo-ink); box-shadow: var(--shadow-hard-sm); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--hulo-ink);
  box-shadow: var(--shadow-hard-sm), inset 0 -3px 0 var(--acid);
}
.card:focus-within, .panel:focus-within, .auth-card:focus-within, .wa-step:focus-within {
  border-color: var(--hulo-ink) !important;
}

@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:active, .card:hover, .feature:hover, .court-card:hover { transform: none !important; }
}


/* ── 10 · v7 — soft, smooth buttons (Nov 2026) ───────────────────────────────
   Sohail: "button components should be smooth, 2026 simple app UI. Keep the
   colours and the design system, fonts not too bold, minimal."
   Buttons only — cards, inputs and the hover rule from §9 are unchanged.
     rest   → filled buttons have no edge; secondary has a hairline and a 1px
              soft shadow; type weight 600 (one notch lighter, see fonts.css)
     hover  → a quiet tone shift, −1px lift, a diffused shadow (no hard
              offset shadow, no sweep)
     press  → scale .97 in 90ms, shadow off — feels like a native app button
     focus  → a soft 3px ring in the button's own colour
   Same colours: lime stays lime, the club's --brand stays the club's. */
.btn {
  font-weight: 600;
  letter-spacing: -0.005em;
  border-width: 1px;
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(21, 23, 20, .06);
  overflow: visible;
  transition:
    background-color 180ms cubic-bezier(.2, .8, .2, 1),
    border-color 180ms cubic-bezier(.2, .8, .2, 1),
    box-shadow 220ms cubic-bezier(.2, .8, .2, 1),
    transform 180ms cubic-bezier(.2, .8, .2, 1),
    filter 180ms cubic-bezier(.2, .8, .2, 1);
  -webkit-tap-highlight-color: transparent;
}
.btn-lime, .btn-dark, .btn-forest, .btn-brand, .btn-danger { border-color: transparent; }
.btn-lime, .btn-brand { box-shadow: 0 1px 2px rgba(21, 23, 20, .10), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn::after, .btn-lime::after, .btn-dark::after, .btn-forest::after, .btn-brand::after { content: none !important; animation: none !important; }

@media (hover: hover) {
  .btn:hover:not(:disabled):not([aria-disabled="true"]):not(.btn-ghost) {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    box-shadow: 0 6px 16px -6px rgba(21, 23, 20, .22), 0 1px 2px rgba(21, 23, 20, .06);
  }
  .btn-lime:hover:not(:disabled), .btn-brand:hover:not(:disabled),
  .btn-dark:hover:not(:disabled), .btn-forest:hover:not(:disabled) {
    border-color: transparent !important;
    filter: brightness(.96);
  }
}
.btn:active:not(:disabled):not([aria-disabled="true"]):not(.btn-ghost) {
  transform: scale(.97);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  border-color: var(--line-strong);
  transition-duration: 90ms;
}
.btn-lime:active:not(:disabled), .btn-brand:active:not(:disabled),
.btn-dark:active:not(:disabled), .btn-forest:active:not(:disabled) { border-color: transparent !important; filter: brightness(.92); }

.btn-ghost { box-shadow: none !important; }
.btn-ghost:active:not(:disabled) { transform: scale(.97) !important; }

.btn:focus-visible {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 22%, transparent);
}
.btn-brand:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 38%, transparent); }
.btn-lime:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--acid, #A6C20B) 45%, transparent); }

.btn:disabled, .btn[aria-disabled="true"] { box-shadow: none; opacity: .5; filter: none; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .btn, .btn:hover, .btn:active { transform: none !important; transition-duration: 1ms !important; }
}
