/* ============================================================
   CASHlib — Homepage rebuild · design-system base (scoped)
   Ported from design-handoff/source/{styles,layout}.css.
   EVERYTHING is scoped under .cl-home so the new tokens/typography
   never leak into the shared header/footer or other pages.
   Brand rule: only two hues — blue #014360 + orange #FF9735.
   Shadows neutral (never coloured) except the orange CTA glow.
   ============================================================ */

.cl-home {
  /* ---- Brand ---- */
  --blue: #014360;
  --blue-700: #013345;
  --blue-800: #01242f;
  --blue-900: #011a23;
  --blue-600: #0a5b79;
  --orange: #ff9735;
  --orange-600: #ef861f;
  --orange-700: #d9760f;

  /* ---- Neutrals (cool, derived from blue) ---- */
  --ink: #082b3a;
  --ink-soft: #516772;
  --ink-faint: #8aa0ab;
  --line: #e2ecf1;
  --line-soft: #eef4f8;
  --bg: #ffffff;
  --surface: #f5fafd;
  --surface-2: #ecf5fb;
  --cream: #fbf7f1;

  /* ---- Type families ---- */
  --display: "Archivo Narrow", "Archivo", system-ui, sans-serif;
  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Montserrat", "Archivo", system-ui, sans-serif;

  /* ---- Type scale (fluid) ---- */
  --t-d1: clamp(44px, 6vw, 84px);
  --t-d2: clamp(34px, 4.4vw, 56px);
  --t-h2: clamp(28px, 3.4vw, 44px);
  --t-h3: clamp(20px, 1.6vw, 25px);
  --t-lead: clamp(17px, 1.4vw, 20px);
  --t-body: 16px;
  --t-sm: 14px;
  --t-xs: 12.5px;

  /* ---- Spacing scale (8pt) ---- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px; --s10: 128px;

  /* ---- Radii ---- */
  --r-sm: 12px; --r: 18px; --r-lg: 26px; --r-xl: 36px; --r-pill: 999px;

  /* ---- Shadows (soft, neutral) ---- */
  --sh-sm: 0 1px 2px rgba(1,36,47,.06), 0 4px 12px rgba(1,36,47,.05);
  --sh-md: 0 12px 30px -12px rgba(1,36,47,.22), 0 4px 12px rgba(1,36,47,.06);
  --sh-lg: 0 38px 70px -30px rgba(1,36,47,.38), 0 12px 30px -16px rgba(1,36,47,.16);
  --sh-cta: 0 10px 24px -10px rgba(255,151,53,.7);
  --sh-cta-hover: 0 16px 30px -10px rgba(255,151,53,.75);

  /* ---- Layout ---- */
  --maxw: 1200px;
  --header-h: 76px;

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --ease-reveal: cubic-bezier(.2,.7,.2,1);

  /* the whole home is a query container so the same markup reflows
     by container width (desktop OR phone frame) */
  container: app / inline-size;

  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- base resets (scoped) ---- */
.cl-home *, .cl-home *::before, .cl-home *::after { box-sizing: border-box; }
.cl-home h1, .cl-home h2, .cl-home h3, .cl-home h4 {
  font-family: var(--display); margin: 0; line-height: 1; letter-spacing: -0.012em; font-weight: 700;
}
.cl-home p { margin: 0; }
.cl-home a { color: inherit; text-decoration: none; }
.cl-home button { font-family: inherit; cursor: pointer; }
.cl-home img { display: block; max-width: 100%; }

.cl-home .wrap {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 36px);
}

/* ---- Buttons ---- */
.cl-home .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: none; border-radius: var(--r-pill); font-weight: 700; font-family: var(--sans);
  cursor: pointer; white-space: nowrap; line-height: 1; letter-spacing: -0.01em;
  transition: transform .18s var(--ease-out), box-shadow .25s, background .2s, color .2s, border-color .2s;
}
.cl-home .btn:active { transform: translateY(1px) scale(.99); }
.cl-home .btn-lg { font-size: 16.5px; padding: 17px 28px; }
.cl-home .btn-md { font-size: 15px; padding: 13px 22px; }
.cl-home .btn-sm { font-size: 14px; padding: 10px 18px; }

.cl-home .btn-primary { background: var(--orange); color: var(--blue-900); box-shadow: var(--sh-cta); }
.cl-home .btn-primary:hover { background: var(--orange-600); transform: translateY(-2px); box-shadow: var(--sh-cta-hover); }
.cl-home .btn-blue { background: var(--blue); color: #fff; box-shadow: var(--sh-md); }
.cl-home .btn-blue:hover { background: var(--blue-600); transform: translateY(-2px); box-shadow: var(--sh-lg); }
.cl-home .btn-ghost { background: transparent; color: var(--blue); border: 1.5px solid var(--line); }
.cl-home .btn-ghost:hover { border-color: var(--blue); background: var(--surface); transform: translateY(-2px); }
.cl-home .btn-ghost-light { background: rgba(255,255,255,.10); color: #fff; border: 1.5px solid rgba(255,255,255,.35); }
.cl-home .btn-ghost-light:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); }
.cl-home .btn-white { background: #fff; color: var(--blue); box-shadow: var(--sh-md); }
.cl-home .btn-white:hover { transform: translateY(-2px); box-shadow: var(--sh-lg); }

/* ---- Chips / eyebrows ---- */
.cl-home .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans);
  font-weight: 700; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--orange-700);
}
.cl-home .chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 16px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 600; background: var(--surface-2); color: var(--ink); white-space: nowrap;
}
.cl-home .chip-white { background: #fff; box-shadow: var(--sh-sm); }

.cl-home .dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); position: relative; flex: none; }
.cl-home .dot-live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--orange); animation: cl-ping 1.9s ease-out infinite; }
@keyframes cl-ping { 0% { transform: scale(.6); opacity: .9; } 80%, 100% { transform: scale(1.9); opacity: 0; } }

/* ---- Section rhythm ---- */
.cl-home .section { padding-block: clamp(56px, 7vw, 104px); }
.cl-home .section-sm { padding-block: clamp(36px, 4.5vw, 64px); }

/* ---- Scroll reveal (base visible; only hidden once JS arms .reveal-ready,
       revealed on viewport entry via .is-revealed). Reduced-motion / no-JS = visible. ---- */
.cl-home [data-reveal] { opacity: 1; transform: none; transition: opacity .6s var(--ease-reveal), transform .6s var(--ease-reveal); }
.cl-home.reveal-ready [data-reveal] { opacity: 0; transform: translateY(22px); }
.cl-home.reveal-ready [data-reveal].is-revealed { opacity: 1; transform: none; }

::selection { background: var(--orange); color: var(--blue-900); }
.cl-home :focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

/* Gentle float (gated so paused/print contexts stay still) */
@keyframes cl-floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.cl-home.animate .float-soft { animation: cl-floaty 6s ease-in-out infinite; }
@keyframes cl-swap { from { opacity: .25; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes cl-pop { from { opacity: .3; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes cl-slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ============================================================
   VOUCHER RECEIPT — cut-out paper with sawtooth edges + motion
   ============================================================ */
.cl-home .receipt-paper {
  position: relative;
  --w: 18px; --h: 9px;
  -webkit-mask:
    conic-gradient(from 135deg at top, #0000 25%, #000 0) top/var(--w) var(--h) repeat-x,
    conic-gradient(from -45deg at bottom, #0000 25%, #000 0) bottom/var(--w) var(--h) repeat-x,
    linear-gradient(#000 0 0) center/100% calc(100% - 2*var(--h)) no-repeat;
  mask:
    conic-gradient(from 135deg at top, #0000 25%, #000 0) top/var(--w) var(--h) repeat-x,
    conic-gradient(from -45deg at bottom, #0000 25%, #000 0) bottom/var(--w) var(--h) repeat-x,
    linear-gradient(#000 0 0) center/100% calc(100% - 2*var(--h)) no-repeat;
  overflow: hidden;
}
.cl-home .receipt-sheen {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: linear-gradient(112deg, transparent 32%, rgba(255,255,255,.7) 48%, rgba(255,255,255,.7) 52%, transparent 68%);
  transform: translateX(-130%);
}
.cl-home.animate .receipt-sheen { animation: cl-sheen 5.5s ease-in-out 1.4s infinite; }
@keyframes cl-sheen { 0% { transform: translateX(-130%); } 18%, 100% { transform: translateX(130%); } }

.cl-home.animate .receipt-pin { animation: cl-pinpulse 5.5s ease-in-out 1.4s infinite; }
@keyframes cl-pinpulse { 0%, 12%, 100% { background: transparent; } 5% { background: rgba(255,151,53,.22); } }

.cl-home .receipt-print { will-change: clip-path, transform; }
.cl-home.animate .receipt-print { animation: cl-printOut 1.15s cubic-bezier(.2,.85,.2,1) both; }
@keyframes cl-printOut {
  0%   { clip-path: inset(0 0 100% 0); transform: translateY(-10px); }
  100% { clip-path: inset(0 0 0 0);    transform: translateY(0); }
}
.cl-home.animate .receipt-float { animation: cl-floaty 6.5s ease-in-out 1.2s infinite; }
.cl-home.animate .receipt-tag { animation: cl-tagpop .5s cubic-bezier(.2,.9,.3,1.3) 1.05s both, cl-floaty 6.5s ease-in-out 1.6s infinite; }
@keyframes cl-tagpop { from { opacity: 0; transform: translateY(8px) scale(.85); } to { opacity: 1; transform: none; } }

/* ============================================================
   UTILITIES
   ============================================================ */
.cl-home .hair { border: 1px solid var(--line); }
.cl-home .hair-2 { box-shadow: inset 0 0 0 1px var(--line); }
.cl-home .glass { background: rgba(255,255,255,.62); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border: 1px solid rgba(255,255,255,.7); }
.cl-home .glass-dark { background: rgba(1,36,47,.34); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border: 1px solid rgba(255,255,255,.18); }
.cl-home .mono-label { font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.cl-home .dot-grid { background-image: radial-gradient(rgba(1,67,96,.10) 1.1px, transparent 1.1px); background-size: 26px 26px; }
.cl-home .line-grid { background-image: linear-gradient(rgba(1,67,96,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(1,67,96,.05) 1px, transparent 1px); background-size: 56px 56px; }
.cl-home .mesh-blob { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .55; pointer-events: none; }
.cl-home .kicker-line { width: 38px; height: 3px; border-radius: 3px; background: var(--orange); display: inline-block; }

/* ---- Bento grid ---- */
.cl-home .bento { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 16px; }
.cl-home .bento > .b-lead { grid-column: span 2; grid-row: span 2; }
.cl-home .bento > .b-wide { grid-column: span 2; }
.cl-home .bento-cell { border-radius: var(--r-lg); padding: 26px; position: relative; overflow: hidden; transition: transform .3s var(--ease-out), box-shadow .3s; }
.cl-home .bento-cell:hover { transform: translateY(-5px); box-shadow: var(--sh-lg); }

/* ---- Marquee ---- */
.cl-home .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); }
.cl-home .marquee-track { display: flex; gap: 14px; padding-right: 14px; flex: none; animation: cl-marq 32s linear infinite; }
.cl-home:not(.animate) .marquee-track { animation: none; }
.cl-home .marquee-track--rev { animation-direction: reverse; }
@keyframes cl-marq { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.cl-home .marquee:hover .marquee-track { animation-play-state: paused; }

/* ============================================================
   LAYOUT — grid helpers (desktop defaults)
   ============================================================ */
.cl-home .hero-grid { display: grid; grid-template-columns: 1.04fr .96fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.cl-home .split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.cl-home .cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.cl-home .cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cl-home .cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cl-home .row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* Header helpers */
.cl-home .hdr-nav { display: flex; }
.cl-home .hdr-actions-full { display: flex; align-items: center; gap: 14px; }
.cl-home .hdr-burger { display: none; }
.cl-home .bottom-bar { display: none; }
.cl-home .only-mobile { display: none !important; }

/* ---------- CONTAINER BREAKPOINTS ---------- */
@container app (max-width: 920px) {
  .cl-home .hero-grid, .cl-home .split { grid-template-columns: 1fr; gap: 32px; }
  .cl-home .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cl-home .bento { grid-template-columns: repeat(2, 1fr); }
  .cl-home .bento > .b-lead { grid-column: span 2; grid-row: span 1; }
  .cl-home .hdr-nav { display: none; }
  .cl-home .hdr-actions-full { display: none; }
  .cl-home .hdr-burger { display: inline-flex; }
}
@container app (max-width: 680px) {
  .cl-home .cols-3, .cl-home .cols-2 { grid-template-columns: 1fr; }
  .cl-home .bento { grid-template-columns: 1fr; }
  .cl-home .bento > .b-lead, .cl-home .bento > .b-wide { grid-column: span 1; }
  .cl-home .bottom-bar { display: flex; }
  .cl-home .only-mobile { display: flex !important; }
  .cl-home .hide-mobile { display: none !important; }
  .cl-home .section { padding-block: clamp(44px, 9vw, 72px); }
  .cl-home .wrap { padding-inline: 18px; }
}

/* ---------- Reduced motion / print: cut decorative animation ---------- */
@media (prefers-reduced-motion: reduce) {
  .cl-home.animate [data-reveal] { animation: none; }
  .cl-home .dot-live::after { animation: none; }
  .cl-home.animate .receipt-print,
  .cl-home.animate .receipt-float,
  .cl-home.animate .receipt-sheen,
  .cl-home.animate .receipt-pin,
  .cl-home.animate .receipt-tag,
  .cl-home.animate .float-soft,
  .cl-home .marquee-track { animation: none; }
}
@media print {
  .cl-home [data-reveal] { animation: none !important; opacity: 1 !important; transform: none !important; }
}
