/* CADEELI polish layer. Part 1 pairs with assets/js/cadeeli-motion.js (Motion) and is only
   active once that script adds .motion-enhanced (never under reduced motion). */
.motion-sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0; }

/* Motion drives the hero entrance; the CSS keyframe stays as the no-JS fallback. */
.motion-enhanced .home-hero-art { animation:none; will-change:translate; }

/* Count-up digits keep their width so the layout never jumps while counting. */
.motion-enhanced .diversity-fact > strong,.motion-enhanced .learn-ornament { font-variant-numeric:tabular-nums; }

/* Tactile press feedback for primary actions (CSS, so it never fights Motion's inline styles). */
@media (prefers-reduced-motion:no-preference) {
  .motion-enhanced :is(.home-cta,.text-cta,.app-nav-item,.result-card,.photo-wall-item,.map-discovery-list button,.language-card,.word-entry-footer a):active { scale:.975; transition:scale .08s ease-out; }
}

@media print {
  .motion-enhanced [style*="opacity"] { opacity:1 !important; transform:none !important; }
}

/* ---------------------------------------------------------------------------
   UI/UX Pro Max pre-delivery pass (2026-10-04), measured with an automated audit
   at 390 and 1366 px on Inicio, Mapa, Archivo, Lenguas and Proyecto.
   Same palette; each color is only darkened enough to reach WCAG AA. */

/* Focus not obscured: anchors and focused controls clear the sticky header. */
html { scroll-padding-top:calc(var(--site-header-h,80px) + 12px); }

/* Contrast: small turquoise and grey text on ivory reached 4.0–4.3:1; now ≥ 4.5:1. */
.catalog-route span,.register-letter { color:#0d6b73; }
.catalog-ledger dd { color:#5d7c80; }
.register-source { color:#4a6873; opacity:1; }
.learn-search span { color:#52646d; }
.contribute-steps span,body.site-page .method-flow b,body.site-page .method-grid li > span { color:#0d6b73; }
body.site-page .method-flow i { color:#52707f; }
body.site-page .method-definitions small { color:#0b5f69; }
/* Prominence colors are tuned for map markers; as card text they are mixed toward night blue. */
.result-card-kicker em,.result-card-arrow { color:color-mix(in srgb,var(--marker-color) 42%,#07172b); }
.result-card-arrow { opacity:1; }

/* Target size: stand-alone links and buttons get at least 24 px (44 px for primary text actions). */
.hero-scroll { display:inline-flex; align-items:center; min-height:44px; }
.atlas-language-links button,.atlas-language-links a,.language-catalog-heading > a,.vocabulary-meta a,.word-entry-footer a { display:inline-flex; align-items:center; min-height:24px; }
.catalog-archive .text-cta { display:inline-flex; align-items:center; min-height:44px; }
#clear-filters { min-height:32px; padding-inline:.55rem; }
.inline-check { min-height:32px; display:inline-flex; align-items:center; gap:.5rem; cursor:pointer; }
.inline-check input[type="checkbox"] { width:18px; height:18px; flex:none; }

/* Icons are SVG, never glyphs or emoji. */
.global-assistant-trigger svg,.global-assistant-head svg { display:block; width:58%; height:58%; fill:currentColor; }

/* ---------------------------------------------------------------------------
   Photo-first screens (UI/UX Pro Max: museum/gallery, storytelling). Images are the
   published Supabase photographs; cadeeli-gallery.js builds the new chapters. */
body:not(.app-view-archive) :is(.archive-mosaic,.archive-communities) { display:none; }
.archive-mosaic[hidden],.archive-communities[hidden],.record-anatomy[hidden] { display:none !important; }

/* Shared photo tile: image fills, label sits on a short scrim at the bottom. */
:is(.archive-mosaic-tile,.archive-community) { position:relative; display:block; padding:0; overflow:hidden; border:0; background:#12384e; color:#fff; cursor:pointer; text-align:left; }
:is(.archive-mosaic-tile,.archive-community) img { display:block; width:100%; height:100%; object-fit:cover; transition:scale .5s cubic-bezier(.2,.7,.2,1),filter .3s ease; }
:is(.archive-mosaic-tile,.archive-community):is(:hover,:focus-visible) img { scale:1.04; filter:saturate(1.08); }
:is(.archive-mosaic-tile,.archive-community,.record-anatomy-figure):focus-visible { outline:3px solid #2d9eb4; outline-offset:3px; }
.archive-mosaic-tile > span { position:absolute; inset:auto 0 0; padding:2.2rem .8rem .7rem; background:linear-gradient(transparent,rgba(4,18,33,.82)); font:700 .66rem system-ui,sans-serif; letter-spacing:.08em; text-transform:uppercase; }

/* Archivo · mosaic */
.archive-mosaic { display:grid; grid-template-columns:1.25fr 1fr 1fr; grid-template-rows:1fr 1fr; gap:.45rem; height:clamp(360px,34vw,500px); }
.archive-mosaic-tile:first-child { grid-row:1 / 3; }
.archive-mosaic:has(> :nth-child(3):last-child) { grid-template-columns:1.25fr 1fr; }

/* Archivo · por comunidad */
.archive-communities { margin:2.6rem 0 1rem; padding-top:1.6rem; border-top:1px solid #afc7c3; }
.archive-communities-head { margin-bottom:1.1rem; }
body.site-page .archive-communities-head .section-index { margin:0 0 .45rem; color:#0d6b73; font:800 .68rem system-ui,sans-serif; letter-spacing:.16em; }
.archive-communities-head h2 { margin:0; color:#071f39; font:400 clamp(1.7rem,2.6vw,2.4rem)/1.05 Georgia,serif; letter-spacing:-.03em; }
.archive-communities-list { display:grid; grid-auto-flow:column; grid-auto-columns:clamp(172px,15vw,214px); gap:.85rem; overflow-x:auto; padding:.25rem .1rem 1rem; scroll-snap-type:x proximity; overscroll-behavior-inline:contain; scrollbar-width:thin; scrollbar-color:#8fb3b6 transparent; }
.archive-community { display:grid; grid-template-rows:auto 1fr; scroll-snap-align:start; border:1px solid #c6d5d2; border-radius:3px; background:#fff; color:#071f39; transition:border-color .2s ease,box-shadow .2s ease,translate .2s ease; }
.archive-community img { aspect-ratio:4 / 3; height:auto; }
.archive-community-copy { display:grid; gap:.25rem; padding:.7rem .75rem .8rem; }
.archive-community-copy strong { font:400 1.08rem/1.15 Georgia,serif; }
.archive-community-copy small { color:#4a6873; font:600 .7rem system-ui,sans-serif; }
.archive-community:hover { border-color:#49a9ae; box-shadow:0 10px 24px rgba(7,31,57,.12); translate:0 -2px; }
.archive-community[aria-pressed="true"] { border-color:#073968; box-shadow:inset 0 -4px #49d1d1,0 10px 24px rgba(7,31,57,.14); }
.archive-community[aria-pressed="true"] .archive-community-copy strong::after { content:'  ✓'; color:#0d6b73; font:700 .9rem system-ui,sans-serif; }

/* Archivo · records as photographs first */
body.site-page.app-view-archive .result-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(232px,1fr)); gap:2rem 1.3rem; overflow:visible; }
body.site-page.app-view-archive .result-card { position:relative; display:flex; flex-direction:column; align-items:stretch; gap:.8rem; width:100%; min-width:0; min-height:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; transition:translate .25s ease; }
body.site-page.app-view-archive .result-card:hover,body.site-page.app-view-archive .result-card.active { padding:0; background:transparent; translate:0 -3px; }
body.site-page.app-view-archive .result-card-photo { width:100%; height:auto; min-height:0; aspect-ratio:4 / 3; border-radius:3px; object-fit:cover; box-shadow:0 1px 0 rgba(7,31,57,.08); transition:box-shadow .25s ease,filter .25s ease; }
body.site-page.app-view-archive .result-card:hover .result-card-photo { box-shadow:0 14px 30px rgba(7,31,57,.2); filter:saturate(1.08); }
body.site-page.app-view-archive .result-card.active .result-card-photo { box-shadow:0 0 0 3px #f6f5ef,0 0 0 6px #49d1d1; }
body.site-page.app-view-archive .result-card-placeholder { height:auto; aspect-ratio:4 / 3; }
body.site-page.app-view-archive .result-card-copy { padding:0 .1rem; }
body.site-page.app-view-archive .result-card-kicker { font-size:.62rem; }
body.site-page.app-view-archive .result-card-kicker em { display:inline; }
body.site-page.app-view-archive .result-card-title { font-size:1.22rem; line-height:1.15; }
body.site-page.app-view-archive .result-card-arrow { top:.65rem; right:.65rem; bottom:auto; display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:rgba(246,245,239,.94); font-size:.8rem; }
body.site-page.app-view-archive .result-photo-count { position:absolute; top:.65rem; left:.65rem; margin:0; padding:.25rem .5rem; border-radius:99px; background:rgba(7,23,43,.82); color:#fff; font:700 .62rem system-ui,sans-serif; }

/* Archivo · every photograph, larger and portrait like the field captures */
body.site-page.app-view-archive .photo-wall { grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:1.6rem 1.1rem; }
body.site-page.app-view-archive .photo-wall-item { border:0; background:transparent; transition:translate .25s ease; }
body.site-page.app-view-archive .photo-wall-item img { aspect-ratio:3 / 4; border-radius:3px; transition:box-shadow .25s ease; }
body.site-page.app-view-archive .photo-wall-item:hover { translate:0 -3px; }
body.site-page.app-view-archive .photo-wall-item:hover img { box-shadow:0 14px 30px rgba(7,31,57,.2); }
body.site-page.app-view-archive .photo-wall-caption { padding:.7rem .1rem 0; }

/* Archivo · desktop: title beside the mosaic, sticky filter rail beside the gallery. */
@media (min-width:1024px) {
  body.site-page.app-view-archive .explorer-panel { display:grid; grid-template-columns:minmax(240px,280px) minmax(0,1fr) minmax(0,.95fr); grid-template-rows:auto auto auto auto auto 1fr; column-gap:clamp(2rem,4vw,4.5rem); align-items:start;
    grid-template-areas:"bar bar mosaic" "eyebrow eyebrow mosaic" "title title mosaic" "intro intro mosaic" "links links mosaic" "pulse pulse mosaic" "comm comm comm" "notice notice notice" "search heading heading" "filters switch switch" "filters list list" "filters wall wall"; }
  body.site-page.app-view-archive .explorer-panel::before { grid-area:bar; }
  body.site-page.app-view-archive .explorer-panel > .eyebrow { grid-area:eyebrow; }
  body.site-page.app-view-archive .explorer-panel > h1 { grid-area:title; }
  body.site-page.app-view-archive .explorer-panel > .intro { grid-area:intro; }
  body.site-page.app-view-archive .atlas-language-links { grid-area:links; }
  body.site-page.app-view-archive .atlas-pulse { grid-area:pulse; align-self:end; margin-bottom:0; }
  body.site-page.app-view-archive .archive-mosaic { grid-area:mosaic; align-self:stretch; height:auto; min-height:clamp(380px,36vw,540px); }
  body.site-page.app-view-archive .archive-communities { grid-area:comm; min-width:0; }
  body.site-page.app-view-archive .archive-connection { grid-area:notice; }
  body.site-page.app-view-archive .search-box { grid-area:search; max-width:none; margin:2.1rem 0 1rem; }
  body.site-page.app-view-archive .results-heading { grid-area:heading; align-self:end; margin:2.1rem 0 1rem; }
  body.site-page.app-view-archive .archive-view-switch { grid-area:switch; margin-top:0; }
  body.site-page.app-view-archive .result-list { grid-area:list; }
  body.site-page.app-view-archive .photo-wall { grid-area:wall; }
  body.site-page.app-view-archive :is(.mobile-sheet-toolbar,.mobile-filter-toggle) { display:none; }
  body.site-page.app-view-archive .filter-drawer { grid-area:filters; margin:0; position:sticky; top:1.2rem; display:block; max-height:calc(100svh - var(--site-header-h,80px) - 2.4rem); overflow-y:auto; padding:1rem 1rem 1.2rem; border:1px solid #c6d5d2; border-radius:4px; background:#fff; scrollbar-width:thin; }
  body.site-page.app-view-archive .filter-drawer .segmented { display:grid; grid-template-columns:1fr 1fr; gap:3px; }
  body.site-page.app-view-archive .filter-drawer .segmented button:first-child { grid-column:1 / -1; }
  body.site-page.app-view-archive .filter-drawer .filter-grid { grid-template-columns:1fr; }
}

/* Archivo · phones and tablets: photographs open the page. */
@media (max-width:1023px) {
  body.site-page.app-view-archive .archive-mosaic { grid-template-columns:none; grid-template-rows:none; grid-auto-flow:column; grid-auto-columns:minmax(150px,46%); height:clamp(190px,52vw,300px); margin:0 0 1.6rem; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; }
  body.site-page.app-view-archive .archive-mosaic-tile { scroll-snap-align:start; }
  body.site-page.app-view-archive .archive-mosaic-tile:first-child { grid-row:auto; grid-column:span 1; }
  body.site-page.app-view-archive .archive-mosaic { grid-auto-columns:minmax(150px,46%); }
  body.site-page.app-view-archive .archive-mosaic-tile:first-child { min-width:72vw; }
  .archive-communities { margin-top:1.8rem; }
}
@media (max-width:560px) {
  body.site-page.app-view-archive .result-list { grid-template-columns:1fr 1fr; gap:1.4rem .8rem; }
  body.site-page.app-view-archive .result-card-title { font-size:1.02rem; }
  body.site-page.app-view-archive .result-card .result-meta,body.site-page.app-view-archive .result-card-kicker em { display:none; }
  body.site-page.app-view-archive .photo-wall { grid-template-columns:1fr 1fr; gap:1.2rem .8rem; }
  body.site-page.app-view-archive .photo-wall-caption strong { font-size:.98rem; }
}

/* Mapa · phone sheet: the collapsed sheet opens on a carousel of photographed records;
   search and filters follow. (Visual order only; the list keeps its own focus order.) */
@media (max-width:820px) {
  body.site-page:not(.app-view-archive):not(.mobile-list-open) .explorer-panel { display:flex; flex-direction:column; }
  body.site-page:not(.app-view-archive):not(.mobile-list-open) .explorer-panel > * { flex:none; }
  body.site-page:not(.app-view-archive):not(.mobile-list-open) .result-list { order:1; margin:.15rem 0 .9rem; }
  body.site-page:not(.app-view-archive):not(.mobile-list-open) .search-box { order:2; }
  body.site-page:not(.app-view-archive):not(.mobile-list-open) :is(.mobile-filter-toggle,.filter-drawer) { order:3; }
  body.site-page:not(.app-view-archive):not(.mobile-list-open) :is(.results-heading,.archive-view-switch,.atlas-language-links) { order:4; }
  body.site-page:not(.app-view-archive):not(.mobile-list-open) .result-list { display:flex; flex-direction:row; overflow-x:auto; gap:.6rem; }
  body.site-page:not(.app-view-archive):not(.mobile-list-open) .result-card { flex:0 0 auto; display:grid; grid-template-columns:none; grid-template-rows:auto 1fr; align-items:start; gap:.45rem; width:min(58vw,224px); min-width:0; min-height:0; padding:.4rem .4rem .55rem; }
  body.site-page:not(.app-view-archive):not(.mobile-list-open) .result-card-photo { width:100%; height:auto; min-height:0; aspect-ratio:16 / 9; }
  body.site-page:not(.app-view-archive):not(.mobile-list-open) .result-card :is(.result-meta,.result-languages,.result-photo-count) { display:none; }
  body.site-page:not(.app-view-archive):not(.mobile-list-open) .result-card-title { font-size:.98rem; }
}

/* Proyecto · a real record, field by field */
.record-anatomy { display:grid; grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr); gap:clamp(2rem,5vw,5.5rem); align-items:center; padding:clamp(3.5rem,7vw,7rem) clamp(1.5rem,7vw,7rem); background:#07172b; color:#fff; }
.record-anatomy-figure { position:relative; margin:0; }
.record-anatomy-figure img { display:block; width:100%; aspect-ratio:4 / 5; max-height:78svh; object-fit:cover; border-radius:3px; background:#12384e; }
.record-anatomy-figure figcaption { margin-top:.7rem; color:#9fbfca; font:600 .72rem system-ui,sans-serif; letter-spacing:.1em; text-transform:uppercase; }
body.site-page .record-anatomy .section-index { margin:0 0 .9rem; color:#7ed9dc; font:800 .68rem system-ui,sans-serif; letter-spacing:.16em; }
body.site-page .record-anatomy h2 { max-width:560px; margin:0; font:400 clamp(2.3rem,4vw,3.8rem)/1.02 Georgia,serif; letter-spacing:-.045em; text-wrap:balance; }
.record-anatomy-intro { max-width:520px; margin:1.1rem 0 1.8rem; color:#c3d6dc; line-height:1.65; }
.record-anatomy-fields { display:grid; margin:0 0 2rem; border-top:1px solid rgba(159,233,232,.28); }
.record-anatomy-fields > div { display:grid; grid-template-columns:minmax(150px,.7fr) minmax(0,1.3fr); gap:1rem; padding:.85rem 0; border-bottom:1px solid rgba(159,233,232,.18); }
.record-anatomy-fields dt { display:flex; gap:.6rem; color:#9fbfca; font:700 .7rem/1.5 system-ui,sans-serif; letter-spacing:.08em; text-transform:uppercase; }
.record-anatomy-fields dt span { color:#49d1d1; font-variant-numeric:tabular-nums; }
.record-anatomy-fields dd { margin:0; color:#fff; font:400 1.06rem/1.4 Georgia,serif; overflow-wrap:anywhere; }
.record-anatomy-fields dd[lang="yua"] { color:#9fe9e8; font-style:italic; }
.record-anatomy .home-cta-dark { background:#49d1d1; color:#071f39; }
.record-anatomy :focus-visible { outline-color:#ffd166; }
@media (max-width:820px) {
  .record-anatomy { grid-template-columns:1fr; padding:3rem 1.35rem; }
  .record-anatomy-figure img { aspect-ratio:4 / 3; }
  .record-anatomy-fields > div { grid-template-columns:1fr; gap:.25rem; }
}

/* Aportar · the wizard opens with the same night-blue masthead as the site. */
body.site-page .contribution-modal .wizard-header { background:#07172b; color:#fff; border-bottom:0; }
body.site-page .contribution-modal .wizard-header .eyebrow { color:#7ed9dc; }
body.site-page .contribution-modal .wizard-header h2 { color:#fff; }
body.site-page .contribution-modal .wizard-header .wizard-progress-label { color:#c3d6dc; }
body.site-page .contribution-modal .wizard-header .modal-close { border-color:rgba(255,255,255,.55); background:transparent; color:#fff; }
body.site-page .contribution-modal .wizard-header .modal-close:hover { background:#fff; color:#07172b; }
body.site-page .contribution-modal .wizard-header :focus-visible { outline-color:#ffd166; }

/* Inicio · the 68-name register: the names sit inline with no spaces between them, so a
   line had no wrap point and ran ~3000 px wide. Wrapping between items fixes it. */
.home-register-list { display:flex; flex-wrap:wrap; align-items:baseline; }
.home-register-list li { display:inline-block; }

/* ---------------------------------------------------------------------------
   UI/UX Pro Max pre-delivery checklist · touch (phones and touch screens).
   Apple and Android ask for 44 pt / 48 dp. Compact header and index controls keep
   their look and get an invisible 44 px hit area; standalone actions grow to 44 px. */
@media (max-width:820px), (pointer:coarse) {
  body.site-page :is(.lang-btn,.brand,.mobile-view-switch button) { position:relative; }
  body.site-page :is(.lang-btn,.brand,.mobile-view-switch button)::before { content:''; position:absolute; inset:min(0px,calc((100% - 44px) / 2)) 0; }
  body.site-page .header-actions :is(.connection-pill,#auth-button) { min-height:44px; }
  body.site-page .header-actions .connection-pill { width:44px; }
  body.site-page .catalog-letters button { height:44px; min-width:44px; }
  body.site-page :is(.text-cta,.register-action,.atlas-language-links button,.atlas-language-links a,.language-catalog-heading > a,.vocabulary-meta a,.word-entry-footer a,.home-footer button,.skip-link) { display:inline-flex; align-items:center; min-height:44px; }
  body.site-page :is(.archive-view-switch button,.vocabulary-categories button,.mobile-filter-toggle,.map-reset,#clear-filters,.archive-more button) { min-height:44px; }
  body.site-page .map-stage :is(.map-tools button,.maplibregl-ctrl-group button) { width:44px !important; height:44px !important; }
}
/* Focus not obscured: on phones the bottom tab bar is fixed too. */
@media (max-width:820px) { html { scroll-padding-bottom:calc(76px + env(safe-area-inset-bottom,0px)); } }

/* Password visibility toggle (added by cadeeli-ux.js) */
.password-field { position:relative; display:block; }
.password-field input { width:100%; padding-right:3.4rem; }
.password-toggle { position:absolute; top:50%; right:.3rem; display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:4px; background:transparent; color:#073968; cursor:pointer; translate:0 -50%; }
.password-toggle svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.password-toggle:focus-visible { outline:3px solid #2d9eb4; outline-offset:1px; }
/* Invalid wizard fields are marked by shape and text, not color alone. */
.wizard-step [aria-invalid="true"] { border-color:#b3412c !important; box-shadow:0 0 0 2px rgba(179,65,44,.18) !important; }

/* Navigation · phones keep five destinations in the bottom bar (UI/UX Pro Max: bottom nav ≤ 5).
   Proyecto is informational: it is reached from the Inicio footer and only joins the bar,
   highlighted, while it is the current page. */
@media (max-width:820px) {
  body.site-page .app-navigation [data-app-view="project"]:not([aria-current="page"]) { display:none; }
  body.site-page .app-navigation .app-nav-item { flex:1 1 0; width:auto; }
}

/* Record sheet · the photograph gets more room on wide screens, the shadow uses the
   night-blue tint, and the actions read as one primary + secondary + quiet link. */
body.site-page .detail-panel { box-shadow:-24px 0 60px rgba(7,23,43,.2); }
@media (min-width:1280px) { body.site-page.app-view-archive .detail-panel { width:clamp(420px,38vw,600px); } }
body.site-page .detail-actions { display:grid; grid-template-columns:1fr 1fr; gap:.55rem; }
body.site-page .detail-actions :is(.button,a) { justify-content:center; min-height:44px; padding:.55rem .7rem; font-size:.86rem; text-align:center; }
body.site-page .detail-actions [data-detail-action="angles"] { grid-column:1 / -1; border-color:#073968; background:#073968; color:#fff; }
body.site-page .detail-actions [data-detail-action="angles"]:hover { background:#07172b; }
body.site-page .detail-actions [data-detail-action="report"] { grid-column:1 / -1; border-color:transparent; background:transparent; color:#4a6873; text-decoration:underline; text-underline-offset:3px; }
/* The floating assistant would cover the sheet's last lines and actions. */
body.site-page:has(.detail-panel.open) .global-assistant-trigger { display:none; }
