/* =====================================================================
   El inicio: cada archivo es un papel de verdad (la miniatura sale de su
   contenido): las hojas, apaisadas y con rejilla; los documentos, una
   página vertical. Los filtros tienen su gota que se desliza.
   ===================================================================== */
:root { --papel: oklch(100% 0 0); }

/* ---------- barra ---------- */
.buscador-inicio {
  display: flex; align-items: center; gap: var(--e2); flex: 0 1 380px; min-width: 0; height: 44px; margin-left: var(--e4);
  padding: 0 var(--e4); border-radius: var(--pastilla); background: var(--cristal); border: 1px solid var(--cristal-borde); color: var(--tinta-3);
  transition: background-color var(--d-rapida), border-color var(--d-rapida);
}
.buscador-inicio:focus-within { background: var(--hoja); border-color: var(--a); color: var(--a-tinta); }
.buscador-inicio__campo { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: var(--t-s); color: var(--tinta); }
.buscador-inicio__campo::-webkit-search-cancel-button { cursor: pointer; }
@media (max-width: 640px) { .buscador-inicio { margin-left: var(--e2); } }

/* ---------- el inicio ---------- */
.inicio { width: min(1180px, calc(100% - 2 * var(--e4))); margin: 0 auto; padding: var(--e7) 0 var(--e6); display: grid; gap: var(--e6); }
.cabecera-inicio { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--e4); flex-wrap: wrap; }
.saludo { font-size: clamp(2.2rem, 1.4rem + 3vw, 3.4rem); }
.saludo__sub { margin-top: var(--e2); color: var(--tinta-2); }

/* ---------- empieza algo nuevo ---------- */
.bloque-nuevo { display: grid; gap: var(--e3); }
.nuevos {
  display: flex; gap: var(--e4); overflow-x: auto; padding: var(--e2) var(--e1) var(--e4); margin: 0 calc(-1 * var(--e1));
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--linea-fuerte) transparent;
}
.nuevo {
  display: grid; justify-items: start; align-content: start; gap: 6px; flex: none; padding: 0; border: 0; background: none; text-align: left; color: var(--tinta);
  scroll-snap-align: start;
}
.nuevo + .nuevo--texto.nuevo--vacio { margin-left: var(--e5); }
.nuevo__papel {
  position: relative; display: grid; place-items: center; height: 148px; overflow: hidden; border-radius: var(--r-m);
  background: var(--papel); border: 1px solid oklch(30% 0.04 var(--h) / .08);
  box-shadow: 0 1px 2px oklch(30% 0.04 var(--h) / .06), 0 14px 30px -18px oklch(30% 0.08 var(--h) / .4);
  transition: transform 260ms var(--gota), box-shadow 260ms var(--suave);
}
.nuevo--hoja .nuevo__papel { width: 200px; }
.nuevo--texto .nuevo__papel { width: 116px; }
.nuevo__nombre { font-size: var(--t-s); font-weight: 600; }
.nuevo__app { display: inline-flex; align-items: center; gap: 6px; margin-top: -4px; font-size: var(--t-xs); color: var(--a-tinta); }
.nuevo__app::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--a); }
.nuevo__mas {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: var(--a-texto);
  background: radial-gradient(circle at 35% 28%, oklch(100% 0 0 / .55) 0 14%, transparent 42%), var(--a);
  box-shadow: inset 0 -6px 12px -8px oklch(20% 0.1 var(--h) / .5), 0 10px 20px -10px var(--a);
  transition: transform 260ms var(--gota);
}
.nuevo__mas .icono { width: 26px; height: 26px; stroke-width: 2.2; }
.nuevo--vacio .nuevo__papel { background: color-mix(in oklab, var(--a) 6%, var(--papel)); border-style: dashed; border-color: color-mix(in oklab, var(--a) 40%, transparent); }
@media (hover: hover) {
  .nuevo:hover .nuevo__papel { transform: translateY(-4px); box-shadow: 0 1px 2px oklch(30% 0.04 var(--h) / .06), 0 22px 40px -20px oklch(30% 0.1 var(--h) / .5); }
  .nuevo:hover .nuevo__mas { transform: scale(1.08); }
}
.nuevo:active .nuevo__papel { transform: scale(.98); }
.nuevo:focus-visible { outline: none; }
.nuevo:focus-visible .nuevo__papel { outline: 2px solid var(--a); outline-offset: 3px; }
.nuevo:disabled { opacity: .6; cursor: progress; }

/* ---------- miniaturas ---------- */
.mini { display: block; width: 100%; height: 100%; color: oklch(25% 0.01 260); pointer-events: none; }
.mini--hoja { display: grid; grid-template-columns: 1.6fr repeat(5, 1fr); grid-auto-rows: 18px; font: 500 8px/18px var(--f-texto); background: var(--papel); }
.mini__celda { padding: 0 4px; overflow: hidden; white-space: nowrap; text-overflow: clip; border-right: 1px solid oklch(92% 0.006 var(--h)); border-bottom: 1px solid oklch(92% 0.006 var(--h)); }
.mini__celda.b { font-weight: 700; }
.mini__celda.n { text-align: right; font-variant-numeric: tabular-nums; }
.mini--texto { padding: 14px 13px; overflow: hidden; font-family: var(--f-texto); background: var(--papel); }
.mini--texto > span { display: block; overflow: hidden; color: oklch(35% 0.01 260); }
.mini__titulo { font: italic 500 12px/1.2 "Playfair Display", serif !important; color: oklch(20% 0.01 260) !important; margin-bottom: 2px; }
.mini__subtitulo { font-size: 6.5px; color: oklch(55% 0.02 var(--h)) !important; margin-bottom: 5px; }
.mini__h1 { font: 600 8.5px/1.3 "Playfair Display", serif; color: oklch(20% 0.01 260) !important; margin: 4px 0 1px; }
.mini__h2, .mini__h3 { font-size: 6.5px; font-weight: 700; margin: 3px 0 1px; color: oklch(25% 0.01 260) !important; }
.mini__p, .mini__li, .mini__blockquote, .mini__pre { font-size: 5.2px; line-height: 1.55; margin-bottom: 2px; max-height: 3.1em; }
.mini__li { padding-left: 6px; position: relative; }
.mini__li::before { content: ""; position: absolute; left: 1px; top: 3.2px; width: 2px; height: 2px; border-radius: 50%; background: var(--a); }
.mini__blockquote { border-left: 1.5px solid var(--a); padding-left: 4px; font-style: italic; }
.mini__pre { font-family: "DM Mono", monospace; background: oklch(96% 0.006 var(--h)); }

/* ---------- filtros ---------- */
.bloque-archivos { display: grid; gap: var(--e4); }
.bloque-archivos__cabeza { display: flex; align-items: center; gap: var(--e2); flex-wrap: wrap; }
.filtros__caja { position: relative; padding: 4px; border-radius: var(--pastilla); background: var(--cristal); border: 1px solid var(--cristal-borde); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.filtros { position: relative; z-index: 1; display: flex; gap: 2px; }
.filtro {
  height: 38px; padding: 0 var(--e4); border: 0; border-radius: var(--pastilla); background: transparent;
  font-size: var(--t-s); font-weight: 500; color: var(--tinta-2); white-space: nowrap; transition: color var(--d) ease;
}
.filtro[aria-selected="true"] { color: var(--a-tinta); font-weight: 650; }
@media (hover: hover) { .filtro:not([aria-selected="true"]):hover { color: var(--tinta); } }
.filtros__gota {
  position: absolute; left: 4px; top: 4px; height: 38px; border-radius: var(--pastilla); z-index: 0; pointer-events: none;
  background: var(--hoja); box-shadow: var(--sombra-baja);
  transition: transform var(--d-lenta) var(--gota), width var(--d-lenta) var(--gota);
}

/* ---------- los archivos ---------- */
.archivos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--e5) var(--e4); }
.tarjeta__caja { position: relative; }
.tarjeta {
  display: grid; overflow: hidden; border-radius: var(--r-l); text-decoration: none; color: var(--tinta);
  background: var(--cristal); border: 1px solid var(--cristal-borde); box-shadow: var(--sombra-baja);
  -webkit-backdrop-filter: var(--desenfoque); backdrop-filter: var(--desenfoque);
  transition: transform 260ms var(--gota), box-shadow 260ms var(--suave);
}
.tarjeta__papel {
  position: relative; display: block; height: 156px; margin: var(--e2) var(--e2) 0; overflow: hidden; border-radius: calc(var(--r-l) - 6px);
  background: color-mix(in oklab, var(--a) 7%, var(--papel));
}
.tarjeta__papel .mini--hoja { background: var(--papel); }
.tarjeta[data-color="texto"] .tarjeta__papel .mini--texto {
  width: 64%; height: calc(100% - 14px); margin: 14px auto 0; border-radius: 6px 6px 0 0;
  box-shadow: 0 0 0 1px oklch(30% 0.04 var(--h) / .06), 0 8px 20px -12px oklch(30% 0.08 var(--h) / .4);
}
.tarjeta__pie { display: flex; align-items: center; gap: var(--e3); padding: var(--e3) var(--e4) var(--e4); min-width: 0; }
.tarjeta__icono { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; color: var(--a-tinta); background: var(--a-velo); }
.tarjeta__icono .icono { width: 18px; height: 18px; }
.tarjeta__texto { display: grid; min-width: 0; }
.tarjeta__titulo { font-weight: 600; font-size: var(--t-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarjeta__meta { font-size: var(--t-xs); color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarjeta--papelera { opacity: .8; }
.tarjeta--papelera .tarjeta__papel { filter: grayscale(.6); }
@media (hover: hover) { a.tarjeta:hover { transform: translateY(-3px); box-shadow: var(--sombra-gota); } }
a.tarjeta:focus-visible { outline: 2px solid var(--a); outline-offset: 3px; }
.tarjeta--esqueleto { height: 230px; border-radius: var(--r-l); }
.tarjeta__estrella, .tarjeta__menu {
  position: absolute; top: 14px; width: 36px; height: 36px; background: oklch(100% 0 0 / .85); color: var(--tinta-2);
  box-shadow: 0 2px 8px -3px oklch(20% 0.05 var(--h) / .35); opacity: 0; transition: opacity var(--d-rapida), transform 100ms;
}
.tarjeta__estrella { right: 56px; }
.tarjeta__menu { right: 14px; }
.tarjeta__estrella .icono, .tarjeta__menu .icono { width: 18px; height: 18px; }
.tarjeta__estrella[aria-pressed="true"] { opacity: 1; color: oklch(70% 0.15 75); background: oklch(100% 0 0 / .92); }
.tarjeta__estrella[aria-pressed="true"] .icono { fill: currentColor; }
.tarjeta__caja:hover .tarjeta__estrella, .tarjeta__caja:hover .tarjeta__menu,
.tarjeta__caja:focus-within .tarjeta__estrella, .tarjeta__caja:focus-within .tarjeta__menu, .tarjeta__menu[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .tarjeta__menu { opacity: 1; } }
.vacio { grid-column: 1 / -1; display: grid; justify-items: center; gap: var(--e2); padding: var(--e8) var(--e4); text-align: center; color: var(--tinta-2); }
.vacio__titulo { font: italic 500 var(--t-xl) var(--f-titulo); color: var(--tinta); }
.pie-inicio { padding: var(--e6) var(--e4) var(--e7); text-align: center; font-size: var(--t-xs); color: var(--tinta-3); }
.pie-inicio a { color: inherit; }

/* ---------- soltar archivos ---------- */
.soltar { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: oklch(40% 0.08 var(--h) / .18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: velo-entra 180ms ease; pointer-events: none; }
.soltar__caja { display: grid; justify-items: center; gap: var(--e2); padding: var(--e7) var(--e8); border-radius: var(--r-xl); border: 2px dashed color-mix(in oklab, var(--a) 60%, transparent); text-align: center; color: var(--tinta-2); animation: dialogo-entra 260ms var(--gota); }
.soltar__caja .icono { width: 40px; height: 40px; color: var(--a); }
.soltar__caja .titulo-gota { font-size: var(--t-xl); color: var(--tinta); }

/* ---------- cuenta ---------- */
.espacio { display: grid; gap: 4px; margin-top: var(--e3); }
.espacio__barra { height: 6px; border-radius: var(--pastilla); background: var(--linea); overflow: hidden; }
.espacio__barra span { display: block; height: 100%; border-radius: inherit; background: var(--a); }
.espacio small { font-size: var(--t-xs); color: var(--tinta-3); }
.plegable summary { cursor: pointer; font-size: var(--t-s); font-weight: 600; color: var(--a-tinta); }
.enlace-peligro { justify-self: start; padding: 0; border: 0; background: none; color: var(--peligro); font-size: var(--t-s); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- entrar ---------- */
.acceso { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 440px); align-items: center; gap: var(--e7); width: min(1120px, calc(100% - 2 * var(--e4))); margin: 0 auto; padding: var(--e7) 0; }
.acceso__marca { display: grid; gap: var(--e5); }
.acceso__logo { font: italic 600 1.6rem var(--f-titulo); letter-spacing: -0.02em; }
.acceso__lema { font-size: clamp(2.2rem, 1.3rem + 3vw, 3.6rem); max-width: 14ch; }
.acceso__muestras { position: relative; height: 170px; }
.muestra { position: absolute; border-radius: var(--r-m); background: var(--papel); box-shadow: 0 1px 2px oklch(30% 0.04 var(--h) / .08), 0 18px 40px -20px oklch(30% 0.1 var(--h) / .45); border: 1px solid oklch(30% 0.04 var(--h) / .06); }
.muestra--hoja { left: 0; top: 18px; width: 250px; padding: 8px 0; transform: rotate(-3deg); color: oklch(25% 0.01 260); animation: flotar 7s ease-in-out infinite; }
.muestra__fila { display: grid; grid-template-columns: 1.2fr 1fr; font-size: 12px; }
.muestra__fila span { padding: 5px 12px; border-bottom: 1px solid oklch(93% 0.006 var(--h)); }
.muestra__fila span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.muestra__fila.fuerte { font-weight: 700; }
.muestra__fila:first-child span { background: color-mix(in oklab, var(--a) 14%, var(--papel)); }
.muestra--texto { left: 268px; top: 0; width: 140px; height: 168px; padding: 16px 16px; display: grid; align-content: start; gap: 7px; transform: rotate(4deg); animation: flotar 8s ease-in-out -2s infinite; }
.muestra__titulo { font: italic 500 18px var(--f-titulo); color: oklch(22% 0.01 260); }
.muestra__linea { height: 5px; border-radius: 3px; background: oklch(90% 0.01 var(--h)); }
.muestra__linea.corta { width: 60%; background: color-mix(in oklab, var(--a) 30%, oklch(92% 0.01 var(--h))); }
@keyframes flotar { 50% { translate: 0 -6px; } }
.acceso__puntos { display: grid; gap: var(--e3); margin: 0; padding: 0; list-style: none; color: var(--tinta-2); font-size: var(--t-s); }
.acceso__puntos li { display: flex; gap: var(--e3); align-items: baseline; }
.punto { width: 10px; height: 10px; flex: none; border-radius: 50%; transform: translateY(1px); }
.punto--hoja { background: oklch(60% 0.11 165); }
.punto--texto { background: oklch(60% 0.13 245); }
.acceso__caja { padding: var(--e6); border-radius: var(--r-xl); }
.acceso__form { display: grid; gap: var(--e4); }
.acceso__form h2 { font-size: var(--t-xxl); }
.acceso__sub { color: var(--tinta-2); margin-top: calc(-1 * var(--e2)); }
.acceso__cambio { font-size: var(--t-s); color: var(--tinta-2); text-align: center; }
@media (max-width: 860px) {
  .acceso { grid-template-columns: 1fr; gap: var(--e5); padding-top: var(--e5); }
  .acceso__muestras { display: none; }
  .acceso__lema { font-size: 2.1rem; }
}
.campo > span.ayuda-campo { font-weight: 400; color: var(--tinta-3); }
