/* ============================================================
   Frame Theory — design system (public site redesign)
   Tokens, type, buttons, floating nav, footer, floating widgets.
   Loaded by redesigned pages only; css/style.css stays untouched
   because /admin, /portal and /game still load it.
   ============================================================ */

@font-face {
  font-family: 'Inter Tight';
  src: url('../fonts/InterTight-latin-wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Caveat';
  src: url('../fonts/Caveat-latin-wght.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Tokens: light is the :root base, dark overrides it. The no-flash
      script always sets data-theme, defaulting to dark. ── */
:root {
  --bg:        #f5f0ea;
  --bg-raised: #ebe5db;
  --bg-inset:  #e3dccf;
  --text:      #0d0b09;
  --text-2:    rgba(13, 11, 9, 0.72);
  --muted:     rgba(13, 11, 9, 0.52);
  --line:      rgba(13, 11, 9, 0.13);
  --line-2:    rgba(13, 11, 9, 0.22);
  --gold:      #a07830;
  --gold-soft: #c8a96e;
  --coral:     #e0553a;
  --violet:    #7c4dff;
  --crayon:    #d9261c;
  --nav-bg:    rgba(245, 240, 234, 0.62);
  --silver:    linear-gradient(180deg, #0d0b09 0%, #77706a 100%);
  --grad:      linear-gradient(98deg, #b8892f 0%, #e0553a 55%, #7c4dff 100%);
  --shadow:    0 30px 80px rgba(40, 30, 10, 0.18);

  --font: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Caveat', 'Segoe Print', cursive;

  --ease-out:   cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-move:  cubic-bezier(0.65, 0.02, 0.35, 1);

  --r-card: 28px;
  --r-pill: 999px;
  --gutter: clamp(18px, 4vw, 56px);

  /* legacy aliases so the shared cookie/newsletter/toast scripts' markup works */
  --bg-card:        var(--bg-raised);
  --border:         var(--line-2);
  --text-secondary: var(--text-2);
  --black:          var(--bg);
  --font-sans:      var(--font);
  --ease-drawer:    var(--ease-out);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg:        #000;
  --bg-raised: #0b0b0c;
  --bg-inset:  #131315;
  --text:      #f3f3f3;
  --text-2:    rgba(243, 243, 243, 0.74);
  --muted:     rgba(243, 243, 243, 0.5);
  --line:      rgba(255, 255, 255, 0.12);
  --line-2:    rgba(255, 255, 255, 0.22);
  --gold:      #c8a96e;
  --gold-soft: #e2c98e;
  --coral:     #ff7a59;
  --violet:    #9b7bff;
  --nav-bg:    rgba(10, 10, 11, 0.55);
  --silver:    linear-gradient(180deg, #f3f3f3 0%, #6e6e72 100%);
  --grad:      linear-gradient(98deg, #e2c98e 0%, #ff7a59 52%, #9b7bff 100%);
  --shadow:    0 30px 90px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* The pinned frame-zoom hands the page over to the light theme without
   touching the visitor's saved preference. */
html.ft-lit[data-theme="dark"] {
  --bg:        #f5f0ea;
  --bg-raised: #ebe5db;
  --bg-inset:  #e3dccf;
  --text:      #0d0b09;
  --text-2:    rgba(13, 11, 9, 0.72);
  --muted:     rgba(13, 11, 9, 0.52);
  --line:      rgba(13, 11, 9, 0.13);
  --line-2:    rgba(13, 11, 9, 0.22);
  --gold:      #a07830;
  --gold-soft: #c8a96e;
  --coral:     #e0553a;
  --violet:    #7c4dff;
  --nav-bg:    rgba(245, 240, 234, 0.62);
  --silver:    linear-gradient(180deg, #0d0b09 0%, #77706a 100%);
  --grad:      linear-gradient(98deg, #b8892f 0%, #e0553a 55%, #7c4dff 100%);
  --shadow:    0 30px 80px rgba(40, 30, 10, 0.18);
  color-scheme: light;
}

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  overflow-x: clip;
  transition: background-color 0.6s var(--ease-move), color 0.6s var(--ease-move);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.nav-open { overflow: hidden; }

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.ft-skip {
  position: fixed; left: 16px; top: -60px; z-index: 1000;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--r-pill);
  transition: top 0.2s var(--ease-out);
}
.ft-skip:focus { top: 12px; }

/* ── Type helpers ── */
.ft-eyebrow {
  font-size: 0.8125rem; font-weight: 500; letter-spacing: 0.02em; color: var(--muted);
}
.ft-grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.ft-silver-text {
  background: var(--silver);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ── Buttons: pills ── */
.ft-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  height: 52px; padding: 0 1.7em;
  border-radius: var(--r-pill);
  font-weight: 600; font-size: 1rem; letter-spacing: -0.01em;
  background: var(--text); color: var(--bg);
  border: 1px solid transparent;
  transition: transform 0.45s var(--ease-out), background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), color 0.3s var(--ease-out);
  white-space: nowrap;
}
.ft-btn:active { transform: scale(0.96); }
.ft-btn-ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.ft-btn-sm { height: 40px; padding: 0 1.2em; font-size: 0.9rem; }
@media (hover: hover) and (pointer: fine) {
  .ft-btn:hover { transform: translateY(-2px); }
  .ft-btn-ghost:hover { border-color: var(--text); }
}

/* ── Floating pill nav ── */
.ft-nav {
  position: fixed; z-index: 900;
  top: 14px; left: 50%;
  width: min(1180px, calc(100% - 28px));
  transform: translateX(-50%);
  height: 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 10px 0 16px;
  border-radius: var(--r-pill);
  background: var(--nav-bg);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  transition: background-color 0.6s var(--ease-move), border-color 0.6s var(--ease-move);
}
.ft-logo { display: inline-flex; align-items: center; position: relative; }
.ft-logo-img { width: 34px; height: 34px; object-fit: contain; }
.ft-logo-for-light { display: none; }
[data-theme="light"] .ft-logo-for-dark, html.ft-lit .ft-logo-for-dark { display: none; }
[data-theme="light"] .ft-logo-for-light, html.ft-lit .ft-logo-for-light { display: block; }

.ft-nav-links { display: flex; align-items: center; gap: 2px; }
.ft-nav-links a {
  padding: 8px 14px; border-radius: var(--r-pill);
  font-size: 0.9375rem; font-weight: 500; color: var(--text-2);
  transition: color 0.25s var(--ease-out), background-color 0.25s var(--ease-out);
}
.ft-nav-links a:hover, .ft-nav-links a[aria-current="page"] { color: var(--text); background: var(--line); }
.ft-nav-right { display: flex; align-items: center; gap: 8px; }

.ft-theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--text);
  transition: background-color 0.25s var(--ease-out), transform 0.4s var(--ease-out);
}
.ft-theme-toggle:hover { background: var(--line); }
.ft-theme-toggle:active { transform: scale(0.92); }
.ft-theme-toggle .icon-moon { display: none; }
[data-theme="light"] .ft-theme-toggle .icon-sun { display: none; }
[data-theme="light"] .ft-theme-toggle .icon-moon { display: block; }

.ft-burger { display: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); position: relative; }
.ft-burger span {
  position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--text);
  transition: transform 0.45s var(--ease-move);
}
.ft-burger span:nth-child(1) { top: 16px; }
.ft-burger span:nth-child(2) { top: 23px; }
.ft-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.ft-burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

.ft-sheet {
  position: fixed; inset: 0; z-index: 880;
  background: var(--bg);
  padding: 96px var(--gutter) 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; transform: translateY(-12px);
  transition: opacity 0.4s var(--ease-out), transform 0.5s var(--ease-out);
}
.ft-sheet[hidden] { display: none; }
.ft-sheet.is-open { opacity: 1; transform: none; }
.ft-sheet nav { display: flex; flex-direction: column; gap: 4px; }
.ft-sheet nav a {
  font-size: clamp(2rem, 9vw, 3rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1.15; padding: 6px 0;
}
.ft-sheet-cta { color: var(--gold); }
.ft-sheet-clocks { display: flex; gap: 20px; flex-wrap: wrap; }

/* ── Odometer clocks ── */
.ft-clock {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.75rem; font-weight: 500; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ft-clock-label { letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.6875rem; }
.ft-clock-time { display: inline-flex; align-items: center; color: var(--text); font-weight: 600; }
.ft-od {
  display: inline-block; height: 1.2em; line-height: 1.2; overflow: hidden; position: relative;
}
.ft-od-roll {
  display: block;
  transition: transform 0.7s var(--ease-move);
  will-change: transform;
}
.ft-od-roll span { display: block; height: 1.2em; line-height: 1.2; text-align: center; min-width: 0.62em; }
.ft-clock-sep { opacity: 0.55; padding: 0 1px; }
.ft-clock-live {
  width: 6px; height: 6px; border-radius: 50%; background: #34c759;
  animation: ft-pulse 2.4s var(--ease-move) infinite;
}
@keyframes ft-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.ft-clocks { display: flex; gap: 16px; padding-right: 8px; }

/* ── Footer ── */
.ft-footer {
  position: relative;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: clamp(56px, 8vw, 110px) var(--gutter) 28px;
}
.ft-footer-top {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: clamp(28px, 4vw, 64px);
}
.ft-footer-brand p { color: var(--text-2); max-width: 34ch; margin: 18px 0 12px; font-size: 0.98rem; }
.ft-footer-phone { font-weight: 600; }
.ft-footer-col h4 { font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin-bottom: 16px; letter-spacing: 0.02em; }
.ft-footer-col li + li { margin-top: 10px; }
.ft-footer-col a { color: var(--text-2); transition: color 0.25s var(--ease-out); }
.ft-footer-col a:hover { color: var(--text); }
.ft-footer-clocks { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; font-size: 0.9rem; }
.ft-footer-clocks .ft-clock { font-size: 0.9rem; }
.ft-social { display: flex; gap: 10px; }
.ft-social a {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--text-2);
  transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out);
}
.ft-social a:hover { color: var(--text); border-color: var(--text); }
.ft-footer-bottom {
  max-width: 1280px; margin: clamp(40px, 6vw, 80px) auto 0;
  padding-top: 22px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: 0.85rem;
}
.footer-newsletter { margin-top: 22px; max-width: 320px; }
.footer-newsletter-label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.footer-newsletter-row { display: flex; gap: 8px; }
.footer-newsletter-input {
  flex: 1 1 auto; min-width: 0; height: 42px; padding: 0 16px;
  background: var(--bg-raised); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--r-pill); font: inherit; font-size: 0.9rem;
  -webkit-user-select: text; user-select: text;
}
.footer-newsletter-input:focus { outline: none; border-color: var(--gold); }
.footer-newsletter-btn {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; background: var(--text); color: var(--bg);
  transition: transform 0.4s var(--ease-out);
}
.footer-newsletter-btn:active { transform: scale(0.92); }
.footer-newsletter-btn:disabled { opacity: 0.55; cursor: default; }
.footer-newsletter-msg { min-height: 1.2em; margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.footer-newsletter-msg.is-success { color: var(--gold); }
.footer-newsletter-msg.is-error { color: var(--coral); }

/* ── Floating widgets ── */
.whatsapp-float, .game-float {
  position: fixed; left: 20px; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; z-index: 850;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s var(--ease-out);
}
.whatsapp-float { bottom: 20px; background: #25d366; color: #fff; }
.game-float { bottom: 84px; background: var(--gold-soft); color: #14110b; }
.whatsapp-float:active, .game-float:active { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) {
  .whatsapp-float:hover, .game-float:hover { transform: scale(1.07); }
}
.game-float-tooltip {
  position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translateY(-50%) translateX(-6px);
  white-space: nowrap; background: var(--text); color: var(--bg);
  font-size: 0.8rem; font-weight: 500; padding: 8px 14px; border-radius: var(--r-pill);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .game-float:hover .game-float-tooltip { opacity: 1; transform: translateY(-50%); }
}
@media (max-width: 560px) { .game-float-tooltip { display: none; } }

.ft-toast {
  position: fixed; z-index: 840; left: 20px; bottom: 148px; max-width: 270px;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-raised); border: 1px solid var(--line-2); color: var(--text);
  box-shadow: var(--shadow); border-radius: var(--r-pill);
  padding: 9px 11px 9px 15px;
  opacity: 0; transform: translateY(12px) scale(0.96); pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.ft-toast.ft-toast-show { opacity: 1; transform: none; pointer-events: auto; }
.ft-toast-link { display: flex; align-items: center; gap: 9px; min-width: 0; }
.ft-toast-icon { font-size: 1.05rem; line-height: 1; flex-shrink: 0; }
.ft-toast-text { font-size: 0.8rem; font-weight: 500; line-height: 1.3; }
.ft-toast-close { flex-shrink: 0; width: 22px; height: 22px; font-size: 1.1rem; line-height: 1; color: var(--muted); border-radius: 50%; }
.ft-toast-close:hover { color: var(--text); }

.ft-cookie-banner {
  position: fixed; z-index: 1100; left: 50%; bottom: 20px;
  transform: translate(-50%, 130%);
  width: min(560px, calc(100% - 32px));
  background: var(--bg-raised); border: 1px solid var(--line-2); color: var(--text);
  border-radius: 22px; padding: 20px 22px; box-shadow: var(--shadow);
  transition: transform 0.5s var(--ease-out);
}
.ft-cookie-banner[hidden] { display: none; }
.ft-cookie-banner.ft-show { transform: translate(-50%, 0); }
.ft-cookie-text { font-size: 0.85rem; line-height: 1.55; color: var(--text-2); margin-bottom: 14px; }
.ft-cookie-link { color: var(--gold); text-decoration: underline; }
.ft-cookie-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ft-email-input {
  flex: 1 1 200px; min-width: 0; height: 40px; padding: 0 16px;
  background: var(--bg); border: 1px solid var(--line-2); color: var(--text);
  border-radius: var(--r-pill); font: inherit; font-size: 0.85rem;
  -webkit-user-select: text; user-select: text;
}
.ft-email-input:focus { outline: none; border-color: var(--gold); }
.ft-cookie-actions { display: flex; gap: 8px; margin-left: auto; }
.ft-cookie-btn {
  height: 40px; padding: 0 20px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); font-size: 0.85rem; font-weight: 600;
  transition: opacity 0.2s, transform 0.3s var(--ease-out);
}
.ft-cookie-btn:active { transform: scale(0.95); }
.ft-cookie-btn-solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.ft-cookie-success { font-size: 0.9rem; color: var(--gold); text-align: center; }
@media (max-width: 560px) {
  .ft-cookie-row { flex-direction: column; align-items: stretch; }
  .ft-cookie-actions { margin-left: 0; justify-content: flex-end; }
}

/* ── Responsive nav/footer ── */
@media (max-width: 1180px) { .ft-clocks { display: none; } }
@media (max-width: 1040px) {
  .ft-nav-links, .ft-nav-cta { display: none; }
  .ft-burger { display: block; }
}
@media (max-width: 920px) {
  .ft-footer-top { grid-template-columns: 1fr 1fr; }
  .ft-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .ft-footer-top { grid-template-columns: 1fr; }
  .ft-toast { max-width: calc(100vw - 100px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
