/* Cati — pàgina de Funcions. Va a sobre de vendor + cati.css (mateixa tipografia i tokens que l'index). */

:root {
  --fx-ink: hsl(var(--text-primary));
  --fx-muted: hsl(var(--text-secondary));
  --fx-soft: hsl(var(--background-secondary));
  --fx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fx-maxw: 1240px;
  --fx-gut: 20px;
}
@media (min-width: 768px) { :root { --fx-gut: 40px; } }

.fx-wrap { width: 100%; max-width: var(--fx-maxw); margin: 0 auto; padding: 0 var(--fx-gut); }
.fx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fx-lead { color: var(--fx-muted); max-width: 460px; }

/* ---------- sections ---------- */
.fx-sec { padding: 64px 0; }
@media (min-width: 992px) { .fx-sec { padding: 120px 0; } }
.fx-hero { position: relative; overflow: hidden; padding: 140px 0 72px; text-align: center; }
@media (min-width: 768px) { .fx-hero { padding: 200px 0 120px; } }
.fx-hero-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.fx-hero-title { font-size: min(44px, calc((100vw - 40px) / 8.2)); line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
@media (min-width: 768px) { .fx-hero-title { font-size: 64px; } }
@media (min-width: 1200px) { .fx-hero-title { font-size: 80px; } }
.fx-hero .fx-lead { max-width: 560px; text-wrap: balance; }
.fx-hero-cta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.fx-float { position: absolute; z-index: 1; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 26%; overflow: hidden; background: #fff;
  box-shadow: var(--shadow-logo-inset), 0 14px 30px rgba(0, 0, 0, 0.08); opacity: var(--o, 1); filter: blur(var(--b, 0px)); transform: rotate(var(--r, 0deg));
  animation: fx-float 7s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
.fx-float img { width: 100%; height: 100%; display: block; }
@keyframes fx-float { from { translate: 0 0; } to { translate: 0 -14px; } }
@media (max-width: 767px) { .fx-float.is-desk { display: none; } }
@media (max-width: 767px) { .fx-hero { padding-top: 196px; } .fx-float { left: var(--mx); top: var(--my); width: 64px; height: 64px; } }

/* text + scene; the scene's colour runs out to the edge of the window (like the reference) */
.fx-split { display: flex; flex-direction: column; gap: 40px; }
.fx-text { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
@media (min-width: 992px) {
  .fx-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 80px; align-items: center; }
  .fx-split.is-flip { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
  .fx-split.is-flip > .fx-text { grid-column: 2; grid-row: 1; }
  .fx-split.is-flip > .fx-scene { grid-column: 1; grid-row: 1; }
}

.fx-scene { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; padding: 48px 0; }
@media (min-width: 992px) { .fx-scene { padding: 72px 0; min-height: 560px; } }
.fx-bg { position: absolute; z-index: -1; top: 0; bottom: 0; left: calc(-1 * var(--fx-gut)); right: calc(-1 * var(--fx-gut)); overflow: hidden; background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)); }
@media (min-width: 992px) {
  /* scene on the right: bleeds to the right edge */
  .fx-split:not(.is-flip) .fx-bg { left: -44px; right: calc(-1 * ((100vw - min(100vw, var(--fx-maxw))) / 2 + var(--fx-gut))); border-radius: 32px 0 0 32px; }
  /* scene on the left: bleeds to the left edge */
  .fx-split.is-flip .fx-bg { right: -44px; left: calc(-1 * ((100vw - min(100vw, var(--fx-maxw))) / 2 + var(--fx-gut))); border-radius: 0 32px 32px 0; }
}

/* soft painted clouds */
.fx-bg::before, .fx-bg::after { content: ''; position: absolute; pointer-events: none; }
.fx-bg::before { inset: 40% -10% -25% 25%;
  background:
    radial-gradient(ellipse 28% 22% at 70% 62%, var(--cloud) 60%, transparent 62%),
    radial-gradient(ellipse 22% 26% at 82% 46%, var(--cloud) 58%, transparent 60%),
    radial-gradient(ellipse 30% 18% at 52% 78%, var(--cloud) 60%, transparent 62%),
    radial-gradient(ellipse 40% 20% at 66% 92%, var(--cloud) 60%, transparent 62%);
  filter: blur(20px); opacity: 0.85; animation: fx-drift 26s ease-in-out infinite alternate; }
.fx-bg::after { inset: 10% 50% 45% -12%;
  background:
    radial-gradient(ellipse 30% 14% at 40% 60%, var(--cloud) 55%, transparent 60%),
    radial-gradient(ellipse 16% 10% at 66% 50%, var(--cloud) 55%, transparent 60%);
  filter: blur(16px); opacity: 0.5; animation: fx-drift 32s ease-in-out infinite alternate-reverse; }
@keyframes fx-drift { from { transform: translateX(-2%); } to { transform: translateX(3%); } }

.sky-blue  { --sky-top: #1f93d6; --sky-bottom: #84d4f2; --cloud: rgba(255, 255, 255, 0.95); }
.sky-dawn  { --sky-top: #f2a68b; --sky-bottom: #fde3cc; --cloud: rgba(255, 246, 236, 0.95); }
.sky-gold  { --sky-top: #e3953a; --sky-bottom: #f8d38a; --cloud: rgba(255, 244, 214, 0.9); }
.sky-grove { --sky-top: #4a9160; --sky-bottom: #cfe8bf; --cloud: rgba(236, 248, 226, 0.85); }
.sky-noon  { --sky-top: #2560c4; --sky-bottom: #73c3f2; --cloud: rgba(255, 255, 255, 0.92); }
.sky-mint  { --sky-top: #27b36a; --sky-bottom: #c9f1d9; --cloud: rgba(240, 255, 246, 0.9); }
.sky-night { --sky-top: #55655d; --sky-bottom: #95a59c; --cloud: rgba(255, 255, 255, 0.22); }
.sky-red   { --sky-top: #e5383b; --sky-bottom: #f47a6c; --cloud: rgba(255, 220, 214, 0.55); }

/* the screen inside a light frame (reference: a2-pane) */
.fx-pane { position: relative; width: min(600px, 92%); padding: 6px; border-radius: 24px; background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 30px 60px -40px rgba(20, 40, 60, 0.45); }
.fx-shots { position: relative; aspect-ratio: 900 / 669; border-radius: 18px; overflow: hidden; background: #fff; border: 1px solid rgba(0, 0, 0, 0.06); }
.fx-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0; transform: scale(0.985); filter: blur(4px);
  transition: opacity 0.5s var(--fx-ease), transform 0.7s var(--fx-ease), filter 0.5s var(--fx-ease); }
.fx-shot.is-on { opacity: 1; transform: none; filter: none; }
/* full-bleed screens (missa, videotrucada, notícies): black tablet frame */
.fx-pane { transition: background 0.35s var(--fx-ease), border-color 0.35s var(--fx-ease); }
.fx-pane:has(.fx-shot.is-on[data-dark]) { background: #111; border-color: #111; }
.fx-pane:has(.fx-shot.is-on[data-dark]) .fx-shots { background: #000; border-color: transparent; }

/* icon tiles that drive the preview */
.fx-tiles { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
.fx-tile { all: unset; position: relative; cursor: pointer; width: 40px; height: 40px; border-radius: 30%; box-shadow: var(--shadow-logo-inset);
  transition: transform 0.3s var(--fx-ease), opacity 0.3s, filter 0.3s; opacity: 0.4; filter: saturate(0.6); }
.fx-tile img { width: 100%; height: 100%; border-radius: inherit; display: block; pointer-events: none; }
.fx-tile:hover { transform: translateY(-2px); opacity: 0.8; }
.fx-tile[aria-pressed=true] { opacity: 1; filter: none; transform: translateY(-2px); }
.fx-tile:focus-visible { outline: 2px solid var(--cati-green); outline-offset: 5px; }
.fx-tile::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translate(-50%, 4px); padding: 4px 10px; border-radius: 8px;
  background: #1b1b1b; color: #fff; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; }
.fx-tile:hover::after, .fx-tile:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.fx-note { color: var(--fx-muted); max-width: 440px; min-height: 44px; }
.fx-note b { color: var(--fx-ink); font-weight: 500; }
.fx-fine { color: var(--fx-muted); max-width: 440px; }

/* ---------- always safe: just the button, on red ---------- */
.fx-safe { position: relative; isolation: isolate; overflow: hidden; color: #fff; background: radial-gradient(70% 80% at 75% 70%, #ef4f4a 0%, transparent 65%), linear-gradient(180deg, #d93033 0%, #b81f26 100%); }
.fx-safe-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 992px) { .fx-safe-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 64px; } }
.fx-safe-copy { display: flex; flex-direction: column; gap: 20px; }
.fx-safe .fx-lead { color: rgba(255, 255, 255, 0.82); }
.fx-safe-list { display: grid; gap: 14px; margin-top: 16px; padding: 0; list-style: none; }
.fx-safe-list li { display: flex; align-items: center; gap: 16px; }
.fx-ic { flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, 0.12); color: #fff; }

.fx-safe-visual { position: relative; height: 340px; display: flex; align-items: center; justify-content: center; }
@media (min-width: 992px) { .fx-safe-visual { height: 420px; } }
.fx-arc { position: absolute; left: 50%; top: 50%; width: calc(130px + var(--k) * 90px); height: calc(130px + var(--k) * 90px); margin: calc((130px + var(--k) * 90px) / -2) 0 0 calc((130px + var(--k) * 90px) / -2);
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, calc(0.32 - var(--k) * 0.07)); }
.fx-sos { position: relative; z-index: 2; width: 120px; height: 120px; }
.fx-sos::before { content: ''; position: absolute; inset: -40%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 235, 230, 0.55), transparent); z-index: -1; }
.fx-sos img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 16px 22px rgba(80, 0, 0, 0.35)); animation: fx-breathe 4s ease-in-out infinite; }
@keyframes fx-breathe { 50% { transform: scale(1.04); } }
.fx-floor { position: absolute; left: 5%; right: 5%; bottom: 8%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent); }

/* ---------- family app ---------- */
.fx-family { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.fx-family .cati-stores { justify-content: center; margin-top: 8px; }
.fx-phones-bg { position: relative; isolation: isolate; width: 100%; margin-top: 28px; border-radius: 32px; overflow: hidden; }
.fx-phones-bg .fx-bg { left: 0; right: 0; border-radius: 0; }
.fx-phones { display: flex; justify-content: center; align-items: flex-end; padding: 56px 12px 0; }
.fx-phone { position: relative; z-index: 2; width: 34%; max-width: 230px; margin-bottom: -60px; padding: clamp(3px, 0.9vw, 6px); border-radius: clamp(20px, 6.4vw, 36px);
  background: #1a1a1a; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 30px 60px -20px rgba(0, 0, 0, 0.35); }
.fx-phone img { display: block; width: 100%; aspect-ratio: 480 / 1000; object-fit: cover; object-position: top; border-radius: clamp(17px, 5.6vw, 31px); background: #fff; }
.fx-phone:nth-child(2) { z-index: 3; width: 38%; max-width: 260px; margin-left: -3%; margin-right: -3%; transform: translateY(-24px); }
.fx-phone:first-child { transform: rotate(-6deg) translateY(16px); }
.fx-phone:last-child { transform: rotate(6deg) translateY(16px); }
@media (max-width: 767px) { .fx-phones { padding-top: 36px; } .fx-phone { margin-bottom: -40px; } }

/* ---------- FAQ ---------- */
.fx-faq-grid { display: grid; gap: 32px; }
@media (min-width: 992px) { .fx-faq-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 64px; } }
.fx-faq-list { border-top: 1px solid rgba(0, 0, 0, 0.1); }
.fx-faq-item { border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
.fx-faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; }
.fx-faq-item summary::-webkit-details-marker { display: none; }
.fx-faq-item summary:focus-visible { outline: 2px solid var(--cati-green); outline-offset: 4px; border-radius: 6px; }
.fx-faq-plus { flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--fx-soft); transition: background 0.2s; }
.fx-faq-plus svg { display: block; }
.fx-faq-plus .v { transform-origin: 7px 7px; transition: transform 0.3s var(--fx-ease); }
.fx-faq-item[open] .fx-faq-plus .v { transform: rotate(90deg); }
.fx-faq-item summary:hover .fx-faq-plus { background: hsl(var(--background-tertiary)); }
.fx-faq-a { padding: 0 48px 24px 0; color: var(--fx-muted); }
.fx-faq-a a { color: var(--fx-ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- final CTA ---------- */
.fx-end { padding: 24px 0 96px; }
@media (min-width: 768px) { .fx-end { padding: 40px 0 128px; } }
.fx-end-card { position: relative; isolation: isolate; overflow: hidden; border-radius: 28px; text-align: center; color: #fff;
  min-height: 460px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 72px 24px; }
@media (min-width: 768px) { .fx-end-card { border-radius: 32px; min-height: 540px; } }
.fx-end-card .fx-bg { left: 0; right: 0; border-radius: 0; }
.fx-end-card h2 { text-shadow: 0 2px 18px rgba(0, 40, 80, 0.18); }
.fx-end-card .fx-lead { color: rgba(255, 255, 255, 0.92); margin: 18px auto 0; max-width: 560px; text-wrap: balance; }
.fx-end-cta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 32px; }
.fx-btn-light { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; background: #fff; color: #111; font-weight: 500; transition: transform 0.2s var(--fx-ease), box-shadow 0.2s; box-shadow: 0 10px 24px rgba(0, 30, 60, 0.18); }
.fx-btn-light:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(0, 30, 60, 0.22); }
.fx-btn-ghost { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); color: #fff; font-weight: 500; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background 0.2s; }
.fx-btn-ghost:hover { background: rgba(255, 255, 255, 0.28); }
.fx-end-fine { margin-top: 18px; color: rgba(255, 255, 255, 0.85); }
.fx-end-fine a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* header link for the current page */
.cati-nav-links a[aria-current=page], .cati-mobile-link[aria-current=page] { color: var(--cati-green-dark); }

[data-reveal] { transition: opacity 1000ms cubic-bezier(0.19, 1, 0.22, 1), transform 1000ms cubic-bezier(0.19, 1, 0.22, 1); }

@media (prefers-reduced-motion: reduce) {
  .fx-bg::before, .fx-bg::after { animation: none; }
  .fx-shot { transition: none; }
  .fx-sos img, .fx-float { animation: none; }
}
